[PATCH v5 00/16] SME support for AArch64 gdb/gdbserver on Linux

Luis Machado via Gdb-patches
2023-09-07T15:21:47Z

The following series enables SME 1 (Scalable Matrix Extension) support for
AArch64 gdb and gdbserver.

SME expands on SVE by having a variable-sized matrix (ZA) of dimensions
SVL x SVL bytes.

The first few patches and some intermediate ones refactor the code and fix
issues prior to enabling SME support, and thus could go in independently.

I've kept them in the series as they are closely/logically related.

Luis Machado (16):
[gdb/aarch64] Fix register fetch/store order for native AArch64 Linux
[gdb/aarch64] refactor: Rename SVE-specific files
[gdb/gdbserver] refactor: Simplify SVE interface to read/write
registers
[gdb/aarch64] sve: Fix return command when using V registers in a
SVE-enabled target
[gdb/aarch64] sme: Enable SME registers and pseudo-registers
[gdbserver/aarch64] refactor: Adjust expedited registers dynamically
[gdbserver/aarch64] sme: Add support for SME
[gdb/aarch64] sve: Fix signal frame z/v register restore
[gdb/aarch64] sme: Signal frame support
[gdb/aarch64] sme: Fixup sigframe gdbarch when vg/svg changes
[gdb/aarch64] sme: Support TPIDR2 signal frame context
[gdb/generic] corefile/bug: Use thread-specific gdbarch when dumping
register state to core files
[gdb/generic] corefile/bug: Fixup (gcore) core file target description
reading order
[gdb/aarch64] sme: Core file support for Linux
[gdb/testsuite] sme: Add SVE/SME testcases
[gdb/docs] sme: Document SME registers and features

gdb/Makefile.in | 6 +-
gdb/NEWS | 11 +
gdb/aarch64-linux-nat.c | 176 ++--
gdb/aarch64-linux-tdep.c | 959 ++++++++++++++---
gdb/aarch64-tdep.c | 724 ++++++++++++-
gdb/aarch64-tdep.h | 47 +
gdb/arch/aarch64-scalable-linux.c | 55 +
gdb/arch/aarch64-scalable-linux.h | 53 +
gdb/arch/aarch64.c | 5 +
gdb/arch/aarch64.h | 57 +-
gdb/configure.nat | 2 +-
gdb/configure.tgt | 1 +
gdb/corelow.c | 24 +-
gdb/doc/gdb.texinfo | 252 +++++
gdb/features/aarch64-sme.c | 63 ++
gdb/linux-tdep.c | 18 +-
gdb/nat/aarch64-scalable-linux-ptrace.c | 991 ++++++++++++++++++
gdb/nat/aarch64-scalable-linux-ptrace.h | 154 +++
....h => aarch64-scalable-linux-sigcontext.h} | 73 +-
gdb/nat/aarch64-sve-linux-ptrace.c | 392 -------
gdb/nat/aarch64-sve-linux-ptrace.h | 72 --
gdb/testsuite/gdb.arch/aarch64-sme-core-0.exp | 23 +
gdb/testsuite/gdb.arch/aarch64-sme-core-1.exp | 23 +
gdb/testsuite/gdb.arch/aarch64-sme-core-2.exp | 23 +
gdb/testsuite/gdb.arch/aarch64-sme-core-3.exp | 23 +
gdb/testsuite/gdb.arch/aarch64-sme-core-4.exp | 23 +
gdb/testsuite/gdb.arch/aarch64-sme-core.c | 372 +++++++
.../gdb.arch/aarch64-sme-core.exp.tcl | 179 ++++
.../gdb.arch/aarch64-sme-regs-available-0.exp | 26 +
.../gdb.arch/aarch64-sme-regs-available-1.exp | 26 +
.../gdb.arch/aarch64-sme-regs-available-2.exp | 26 +
.../gdb.arch/aarch64-sme-regs-available-3.exp | 26 +
.../gdb.arch/aarch64-sme-regs-available-4.exp | 26 +
.../gdb.arch/aarch64-sme-regs-available-5.exp | 26 +
.../gdb.arch/aarch64-sme-regs-available-6.exp | 26 +
.../gdb.arch/aarch64-sme-regs-available-7.exp | 26 +
.../gdb.arch/aarch64-sme-regs-available-8.exp | 26 +
.../gdb.arch/aarch64-sme-regs-available-9.exp | 26 +
.../gdb.arch/aarch64-sme-regs-available.c | 178 ++++
.../aarch64-sme-regs-available.exp.tcl | 237 +++++
.../gdb.arch/aarch64-sme-regs-sigframe-0.exp | 23 +
.../gdb.arch/aarch64-sme-regs-sigframe-1.exp | 23 +
.../gdb.arch/aarch64-sme-regs-sigframe-2.exp | 23 +
.../gdb.arch/aarch64-sme-regs-sigframe-3.exp | 23 +
.../gdb.arch/aarch64-sme-regs-sigframe-4.exp | 23 +
.../gdb.arch/aarch64-sme-regs-sigframe.c | 366 +++++++
.../aarch64-sme-regs-sigframe.exp.tcl | 171 +++
.../aarch64-sme-regs-unavailable-0.exp | 26 +
.../aarch64-sme-regs-unavailable-1.exp | 26 +
.../aarch64-sme-regs-unavailable-2.exp | 26 +
.../aarch64-sme-regs-unavailable-3.exp | 26 +
.../aarch64-sme-regs-unavailable-4.exp | 26 +
.../aarch64-sme-regs-unavailable-5.exp | 26 +
.../aarch64-sme-regs-unavailable-6.exp | 26 +
.../aarch64-sme-regs-unavailable-7.exp | 26 +
.../aarch64-sme-regs-unavailable-8.exp | 26 +
.../aarch64-sme-regs-unavailable-9.exp | 26 +
.../gdb.arch/aarch64-sme-regs-unavailable.c | 152 +++
.../aarch64-sme-regs-unavailable.exp.tcl | 204 ++++
gdb/testsuite/gdb.arch/aarch64-sme-sanity.c | 249 +++++
gdb/testsuite/gdb.arch/aarch64-sme-sanity.exp | 64 ++
gdb/testsuite/lib/aarch64-scalable.exp | 239 +++++
gdb/testsuite/lib/aarch64-test-sme.c | 90 ++
gdb/testsuite/lib/aarch64-test-sve.c | 90 ++
gdb/testsuite/lib/aarch64.exp | 153 +++
gdb/testsuite/lib/gdb.exp | 249 +++++
gdb/tramp-frame.c | 1 +
gdb/tramp-frame.h | 11 +
gdbserver/Makefile.in | 2 +-
gdbserver/configure.srv | 3 +-
gdbserver/linux-aarch64-low.cc | 86 +-
gdbserver/linux-aarch64-tdesc.cc | 28 +-
gdbserver/server.h | 2 +-
73 files changed, 7317 insertions(+), 694 deletions(-)
create mode 100644 gdb/arch/aarch64-scalable-linux.c
create mode 100644 gdb/arch/aarch64-scalable-linux.h
create mode 100644 gdb/features/aarch64-sme.c
create mode 100644 gdb/nat/aarch64-scalable-linux-ptrace.c
create mode 100644 gdb/nat/aarch64-scalable-linux-ptrace.h
rename gdb/nat/{aarch64-sve-linux-sigcontext.h => aarch64-scalable-linux-sigcontext.h} (78%)
delete mode 100644 gdb/nat/aarch64-sve-linux-ptrace.c
delete mode 100644 gdb/nat/aarch64-sve-linux-ptrace.h
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-core-0.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-core-1.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-core-2.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-core-3.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-core-4.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-core.c
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-core.exp.tcl
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-available-0.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-available-1.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-available-2.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-available-3.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-available-4.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-available-5.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-available-6.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-available-7.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-available-8.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-available-9.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-available.c
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-available.exp.tcl
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-sigframe-0.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-sigframe-1.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-sigframe-2.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-sigframe-3.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-sigframe-4.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-sigframe.c
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-sigframe.exp.tcl
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-unavailable-0.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-unavailable-1.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-unavailable-2.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-unavailable-3.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-unavailable-4.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-unavailable-5.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-unavailable-6.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-unavailable-7.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-unavailable-8.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-unavailable-9.exp
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-unavailable.c
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-regs-unavailable.exp.tcl
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-sanity.c
create mode 100644 gdb/testsuite/gdb.arch/aarch64-sme-sanity.exp
create mode 100644 gdb/testsuite/lib/aarch64-scalable.exp
create mode 100644 gdb/testsuite/lib/aarch64-test-sme.c
create mode 100644 gdb/testsuite/lib/aarch64-test-sve.c
create mode 100644 gdb/testsuite/lib/aarch64.exp

--
2.25.1