[PATCH v3 02/16] [gdb/aarch64] refactor: Rename SVE-specific files

Luis Machado via Gdb-patches
2023-06-30T13:49:56Z

In preparation to the SME support patches, rename the SVE-specific files to
something a bit more meaningful that can be shared with the SME code.

In this case, I've renamed the "sve" in the names to "scalable".

No functional changes.

Regression-tested on aarch64-linux Ubuntu 22.04/20.04.
---
gdb/Makefile.in | 2 +-
gdb/aarch64-linux-nat.c | 2 +-
gdb/configure.nat | 2 +-
...ptrace.c => aarch64-scalable-linux-ptrace.c} | 17 +++++++++--------
...ptrace.h => aarch64-scalable-linux-ptrace.h} | 11 ++++++-----
...xt.h => aarch64-scalable-linux-sigcontext.h} | 11 +++++++----
gdbserver/Makefile.in | 2 +-
gdbserver/configure.srv | 2 +-
gdbserver/linux-aarch64-low.cc | 2 +-
9 files changed, 28 insertions(+), 23 deletions(-)
rename gdb/nat/{aarch64-sve-linux-ptrace.c => aarch64-scalable-linux-ptrace.c} (96%)
rename gdb/nat/{aarch64-sve-linux-ptrace.h => aarch64-scalable-linux-ptrace.h} (90%)
rename gdb/nat/{aarch64-sve-linux-sigcontext.h => aarch64-scalable-linux-sigcontext.h} (96%)

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index d909786792c..a58110d63a5 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1561,7 +1561,7 @@ HFILES_NO_SRCDIR = \
nat/aarch64-linux.h \
nat/aarch64-linux-hw-point.h \
nat/aarch64-mte-linux-ptrace.h \
- nat/aarch64-sve-linux-ptrace.h \
+ nat/aarch64-scalable-linux-ptrace.h \
nat/amd64-linux-siginfo.h \
nat/gdb_ptrace.h \
nat/gdb_thread_db.h \
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index 62656a7347b..0dd9652d001 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -35,7 +35,7 @@
#include "arch/arm.h"
#include "nat/aarch64-linux.h"
#include "nat/aarch64-linux-hw-point.h"
-#include "nat/aarch64-sve-linux-ptrace.h"
+#include "nat/aarch64-scalable-linux-ptrace.h"

#include "elf/external.h"
#include "elf/common.h"
diff --git a/gdb/configure.nat b/gdb/configure.nat
index aabcdeff989..8d26f521792 100644
--- a/gdb/configure.nat
+++ b/gdb/configure.nat
@@ -238,7 +238,7 @@ case ${gdb_host} in
aarch32-linux-nat.o nat/aarch64-hw-point.o \
nat/aarch64-linux-hw-point.o \
nat/aarch64-linux.o \
- nat/aarch64-sve-linux-ptrace.o \
+ nat/aarch64-scalable-linux-ptrace.o \
nat/aarch64-mte-linux-ptrace.o"
;;
arc)
diff --git a/gdb/nat/aarch64-sve-linux-ptrace.c b/gdb/nat/aarch64-scalable-linux-ptrace.c
similarity index 96%
rename from gdb/nat/aarch64-sve-linux-ptrace.c
rename to gdb/nat/aarch64-scalable-linux-ptrace.c
index 51146535672..cc43f510892 100644
--- a/gdb/nat/aarch64-sve-linux-ptrace.c
+++ b/gdb/nat/aarch64-scalable-linux-ptrace.c
@@ -1,4 +1,5 @@
-/* Common target dependent for AArch64 systems.
+/* Common target dependent routines for AArch64 Scalable Extensions
+ (SVE/SME).

Copyright (C) 2018-2023 Free Software Foundation, Inc.

@@ -22,13 +23,13 @@
#include "gdbsupport/common-defs.h"
#include "elf/external.h"
#include "elf/common.h"
-#include "aarch64-sve-linux-ptrace.h"
+#include "aarch64-scalable-linux-ptrace.h"
#include "arch/aarch64.h"
#include "gdbsupport/common-regcache.h"
#include "gdbsupport/byte-vector.h"
#include <endian.h>

-/* See nat/aarch64-sve-linux-ptrace.h. */
+/* See nat/aarch64-scalable-linux-ptrace.h. */

uint64_t
aarch64_sve_get_vq (int tid)
@@ -60,7 +61,7 @@ aarch64_sve_get_vq (int tid)
return vq;
}

-/* See nat/aarch64-sve-linux-ptrace.h. */
+/* See nat/aarch64-scalable-linux-ptrace.h. */

bool
aarch64_sve_set_vq (int tid, uint64_t vq)
@@ -88,7 +89,7 @@ aarch64_sve_set_vq (int tid, uint64_t vq)
return true;
}

-/* See nat/aarch64-sve-linux-ptrace.h. */
+/* See nat/aarch64-scalable-linux-ptrace.h. */

bool
aarch64_sve_set_vq (int tid, struct reg_buffer_common *reg_buf)
@@ -117,7 +118,7 @@ aarch64_sve_set_vq (int tid, struct reg_buffer_common *reg_buf)
return aarch64_sve_set_vq (tid, sve_vq_from_vg (reg_vg));
}

-/* See nat/aarch64-sve-linux-ptrace.h. */
+/* See nat/aarch64-scalable-linux-ptrace.h. */

std::unique_ptr<gdb_byte[]>
aarch64_sve_get_sveregs (int tid)
@@ -161,7 +162,7 @@ aarch64_maybe_swab128 (gdb_byte *dst, const gdb_byte *src, size_t size)
#endif
}

-/* See nat/aarch64-sve-linux-ptrace.h. */
+/* See nat/aarch64-scalable-linux-ptrace.h. */

void
aarch64_sve_regs_copy_to_reg_buf (struct reg_buffer_common *reg_buf,
@@ -250,7 +251,7 @@ aarch64_sve_regs_copy_to_reg_buf (struct reg_buffer_common *reg_buf,
}
}

-/* See nat/aarch64-sve-linux-ptrace.h. */
+/* See nat/aarch64-scalable-linux-ptrace.h. */

void
aarch64_sve_regs_copy_from_reg_buf (const struct reg_buffer_common *reg_buf,
diff --git a/gdb/nat/aarch64-sve-linux-ptrace.h b/gdb/nat/aarch64-scalable-linux-ptrace.h
similarity index 90%
rename from gdb/nat/aarch64-sve-linux-ptrace.h
rename to gdb/nat/aarch64-scalable-linux-ptrace.h
index 9539e199d34..2847c4e0263 100644
--- a/gdb/nat/aarch64-sve-linux-ptrace.h
+++ b/gdb/nat/aarch64-scalable-linux-ptrace.h
@@ -1,4 +1,5 @@
-/* Common target dependent for AArch64 systems.
+/* Common target dependent definitions for AArch64 Scalable Extensions
+ (SVE/SME).

Copyright (C) 2018-2023 Free Software Foundation, Inc.

@@ -17,8 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */

-#ifndef NAT_AARCH64_SVE_LINUX_PTRACE_H
-#define NAT_AARCH64_SVE_LINUX_PTRACE_H
+#ifndef NAT_AARCH64_SCALABLE_LINUX_PTRACE_H
+#define NAT_AARCH64_SCALABLE_LINUX_PTRACE_H

#include <signal.h>
#include <sys/utsname.h>
@@ -32,7 +33,7 @@
#include <asm/ptrace.h>

#ifndef SVE_SIG_ZREGS_SIZE
-#include "aarch64-sve-linux-sigcontext.h"
+#include "aarch64-scalable-linux-sigcontext.h"
#endif

/* Indicates whether a SVE ptrace header is followed by SVE registers or a
@@ -69,4 +70,4 @@ extern void
aarch64_sve_regs_copy_from_reg_buf (const struct reg_buffer_common *reg_buf,
void *buf);

-#endif /* NAT_AARCH64_SVE_LINUX_PTRACE_H */
+#endif /* NAT_AARCH64_SCALABLE_LINUX_PTRACE_H */
diff --git a/gdb/nat/aarch64-sve-linux-sigcontext.h b/gdb/nat/aarch64-scalable-linux-sigcontext.h
similarity index 96%
rename from gdb/nat/aarch64-sve-linux-sigcontext.h
rename to gdb/nat/aarch64-scalable-linux-sigcontext.h
index aba3c1595d0..e0120e093a0 100644
--- a/gdb/nat/aarch64-sve-linux-sigcontext.h
+++ b/gdb/nat/aarch64-scalable-linux-sigcontext.h
@@ -1,4 +1,7 @@
-/* Copyright (C) 2018-2023 Free Software Foundation, Inc.
+/* Linux Kernel sigcontext definitions for AArch64 Scalable Extensions
+ (SVE/SME).
+
+ Copyright (C) 2018-2023 Free Software Foundation, Inc.
Contributed by Arm Ltd.

This file is part of GDB.
@@ -16,8 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */

-#ifndef NAT_AARCH64_SVE_LINUX_SIGCONTEXT_H
-#define NAT_AARCH64_SVE_LINUX_SIGCONTEXT_H
+#ifndef NAT_AARCH64_SCALABLE_LINUX_SIGCONTEXT_H
+#define NAT_AARCH64_SCALABLE_LINUX_SIGCONTEXT_H

#define SVE_MAGIC 0x53564501

@@ -264,4 +267,4 @@ struct user_sve_header {
SVE_PT_SVE_OFFSET + SVE_PT_SVE_SIZE(vq, flags) \
: SVE_PT_FPSIMD_OFFSET + SVE_PT_FPSIMD_SIZE(vq, flags))

-#endif /* NAT_AARCH64_SVE_LINUX_SIGCONTEXT_H */
+#endif /* NAT_AARCH64_SCALABLE_LINUX_SIGCONTEXT_H */
diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
index 39cb9e7a151..b597515d428 100644
--- a/gdbserver/Makefile.in
+++ b/gdbserver/Makefile.in
@@ -218,7 +218,7 @@ SFILES = \
$(srcdir)/../gdb/arch/ppc-linux-common.c \
$(srcdir)/../gdb/arch/riscv.c \
$(srcdir)/../gdb/nat/aarch64-mte-linux-ptrace.c \
- $(srcdir)/../gdb/nat/aarch64-sve-linux-ptrace.c \
+ $(srcdir)/../gdb/nat/aarch64-scalable-linux-ptrace.c \
$(srcdir)/../gdb/nat/linux-btrace.c \
$(srcdir)/../gdb/nat/linux-namespaces.c \
$(srcdir)/../gdb/nat/linux-osdata.c \
diff --git a/gdbserver/configure.srv b/gdbserver/configure.srv
index f0101994529..f625c808859 100644
--- a/gdbserver/configure.srv
+++ b/gdbserver/configure.srv
@@ -51,7 +51,7 @@ case "${gdbserver_host}" in
srv_tgtobj="$srv_tgtobj arch/aarch64-mte-linux.o"
srv_tgtobj="$srv_tgtobj linux-aarch64-tdesc.o"
srv_tgtobj="$srv_tgtobj nat/aarch64-mte-linux-ptrace.o"
- srv_tgtobj="$srv_tgtobj nat/aarch64-sve-linux-ptrace.o"
+ srv_tgtobj="$srv_tgtobj nat/aarch64-scalable-linux-ptrace.o"
srv_tgtobj="${srv_tgtobj} $srv_linux_obj"
srv_linux_regsets=yes
srv_linux_thread_db=yes
diff --git a/gdbserver/linux-aarch64-low.cc b/gdbserver/linux-aarch64-low.cc
index 2474a000ea3..8b22f1979d6 100644
--- a/gdbserver/linux-aarch64-low.cc
+++ b/gdbserver/linux-aarch64-low.cc
@@ -44,7 +44,7 @@
#include "linux-aarch32-tdesc.h"
#include "linux-aarch64-tdesc.h"
#include "nat/aarch64-mte-linux-ptrace.h"
-#include "nat/aarch64-sve-linux-ptrace.h"
+#include "nat/aarch64-scalable-linux-ptrace.h"
#include "tdesc.h"

#ifdef HAVE_SYS_REG_H
--
2.25.1