public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v3 0/5] Add support for AArch64 MOPS instructions
@ 2024-05-10  5:24 Thiago Jung Bauermann
  2024-05-10  5:24 ` [PATCH v3 1/5] gdb/aarch64: Disable displaced single-step for " Thiago Jung Bauermann
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Thiago Jung Bauermann @ 2024-05-10  5:24 UTC (permalink / raw)
  To: gdb-patches; +Cc: Christophe Lyon, Luis Machado

Hello,

This version is to adapt to Luis' clarification that MOPS instructions
don't need to be treated as atomic sequences and can be single-stepped.
If the OS reschedules the inferior to a different CPU while a main or
epilogue instruction is executed, it will reset the sequence back to the
prologue instruction.

Therefore patch 1 is now much smaller and only disables displaced stepping
on MOPS instructions, since they do need to appear consecutively in
memory.  Luis suggested relocating the whole sequence as a block.  I will
implement that suggestion in the near future, but in the mean time I would
like to suggest this approach.

Patch 4 is the only other one that was changed. The
gdb.arch/aarch64-mops-atomic-inst.exp testcase was renamed to
gdb.arch/aarch64-mops-single-step.exp, and adjusted to expect the MOPS
sequence to reset back to the prologue instruction. Also, a small bug was
fixed in its corresponding C file (the bug didn't affect the effectiveness
of the test).

The other patches are unchanged from v2.

Here is the original cover letter for convenience:

This patch series implements GDB support for the new instructions in
AArch64's MOPS feature.  Patch 1 has a small overview.

What is needed from GDB is recognizing the MOPS sequences of instructions
as atomic so that they can be stepped over during instruction single
stepping, and also to avoid doing displaced stepping with them.  This is
done in patch 1.

Patch 2 adds support for the new instructions to the record an replay
target.

The other patches add testcases to test each of the aspects above, plus
one testcase to verify the interaction of the MOPS instructions with
watchpoints.

Tested on Ubuntu 23.10 aarch64-linux-gnu with no regressions, using the
Arm FVP emulator as well as QEMU v8.2.

Thiago Jung Bauermann (5):
  gdb/aarch64: Disable displaced single-step for MOPS instructions
  gdb/aarch64: Add record support for MOPS instructions.
  gdb/testsuite: Add gdb.arch/aarch64-mops-watchpoint.exp
  gdb/testsuite: Add gdb.arch/aarch64-mops-single-step.exp
  gdb/testsuite: Add gdb.reverse/aarch64-mops.exp

 gdb/aarch64-tdep.c                            |  92 +++++++++-
 .../gdb.arch/aarch64-mops-single-step.c       |  73 ++++++++
 .../gdb.arch/aarch64-mops-single-step.exp     | 132 ++++++++++++++
 .../gdb.arch/aarch64-mops-watchpoint.c        |  66 +++++++
 .../gdb.arch/aarch64-mops-watchpoint.exp      |  79 ++++++++
 gdb/testsuite/gdb.reverse/aarch64-mops.c      |  71 ++++++++
 gdb/testsuite/gdb.reverse/aarch64-mops.exp    | 171 ++++++++++++++++++
 gdb/testsuite/lib/gdb.exp                     |  61 +++++++
 8 files changed, 742 insertions(+), 3 deletions(-)
 create mode 100644 gdb/testsuite/gdb.arch/aarch64-mops-single-step.c
 create mode 100644 gdb/testsuite/gdb.arch/aarch64-mops-single-step.exp
 create mode 100644 gdb/testsuite/gdb.arch/aarch64-mops-watchpoint.c
 create mode 100644 gdb/testsuite/gdb.arch/aarch64-mops-watchpoint.exp
 create mode 100644 gdb/testsuite/gdb.reverse/aarch64-mops.c
 create mode 100644 gdb/testsuite/gdb.reverse/aarch64-mops.exp


base-commit: 5021daf303393722f58f4422d7ad53d526aa2d50

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-05-23  2:09 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-10  5:24 [PATCH v3 0/5] Add support for AArch64 MOPS instructions Thiago Jung Bauermann
2024-05-10  5:24 ` [PATCH v3 1/5] gdb/aarch64: Disable displaced single-step for " Thiago Jung Bauermann
2024-05-10  5:24 ` [PATCH v3 2/5] gdb/aarch64: Add record support " Thiago Jung Bauermann
2024-05-10 12:59   ` Luis Machado
2024-05-23  2:04     ` Thiago Jung Bauermann
2024-05-10  5:24 ` [PATCH v3 3/5] gdb/testsuite: Add gdb.arch/aarch64-mops-watchpoint.exp Thiago Jung Bauermann
2024-05-10 13:04   ` Luis Machado
2024-05-23  2:06     ` Thiago Jung Bauermann
2024-05-10  5:24 ` [PATCH v3 4/5] gdb/testsuite: Add gdb.arch/aarch64-mops-single-step.exp Thiago Jung Bauermann
2024-05-10 13:07   ` Luis Machado
2024-05-23  2:08     ` Thiago Jung Bauermann
2024-05-10  5:24 ` [PATCH v3 5/5] gdb/testsuite: Add gdb.reverse/aarch64-mops.exp Thiago Jung Bauermann
2024-05-10 13:08   ` Luis Machado
2024-05-10 17:26   ` Guinevere Larsen
2024-05-23  1:55     ` Thiago Jung Bauermann
2024-05-10 14:16 ` [PATCH v3 0/5] Add support for AArch64 MOPS instructions Pedro Alves
2024-05-21 22:18   ` Thiago Jung Bauermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).