aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
authorAlan Hayward <alan.hayward@arm.com>2019-06-25 11:02:32 +0100
committerAlan Hayward <alan.hayward@arm.com>2019-07-04 12:47:42 +0100
commit350fab54163e2dd178609d268e80bf31042d182d (patch)
treef7d48bdd52a381b2f876ae6cf3a4ac58ec29adf9 /gdb/gdbserver
parentf0452268d6c7296106aba81f532b04dc08187352 (diff)
downloadgdb-350fab54163e2dd178609d268e80bf31042d182d.zip
gdb-350fab54163e2dd178609d268e80bf31042d182d.tar.gz
gdb-350fab54163e2dd178609d268e80bf31042d182d.tar.bz2
Arm/AArch64: Use a single set of Arm register set size defines
Both targets were using a mixture of defines and hardcoded values. Add a standard set in arch/arm.h and use throughout, ensuring that none of the existing sizes change. No functionality changes. gdb/ChangeLog: * aarch32-linux-nat.h (VFP_REGS_SIZE): Remove define. * aarch64-linux-nat.c (fetch_fpregs_from_thread) (store_fpregs_to_thread) (aarch64_linux_nat_target::read_description): Use ARM_VFP3_REGS_SIZE. * arch/arm.h (IWMMXT_VEC_REGISTER_SIZE, ARM_CORE_REGS_SIZE) (ARM_FP_REGS_SIZE, ARM_VFP2_REGS_SIZE, ARM_VFP3_REGS_SIZE) (IWMMXT_REGS_SIZE): Add define. * arm-linux-nat.c (IWMMXT_REGS_SIZE): Remove define. (fetch_vfp_regs, store_vfp_regs) (arm_linux_nat_target::read_description): Use ARM_VFP3_REGS_SIZE. * arm-tdep.c (arm_register_g_packet_guesses): Use new defines. gdb/gdbserver/ChangeLog: * linux-aarch32-low.c (arm_read_description, arm_regsets): Use new defines. * linux-arm-low.c (arm_read_description, arm_regsets): Likewise.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog6
-rw-r--r--gdb/gdbserver/linux-aarch32-low.c6
-rw-r--r--gdb/gdbserver/linux-arm-low.c12
3 files changed, 14 insertions, 10 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index f351836..0bd6113 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,11 @@
2019-07-04 Alan Hayward <alan.hayward@arm.com>
+ * linux-aarch32-low.c (arm_read_description, arm_regsets): Use new
+ defines.
+ * linux-arm-low.c (arm_read_description, arm_regsets): Likewise.
+
+2019-07-04 Alan Hayward <alan.hayward@arm.com>
+
* configure.srv: Remove legacy xml.
* linux-aarch64-low.c (initialize_low_arch): Remove
initialize_low_tdesc call.
diff --git a/gdb/gdbserver/linux-aarch32-low.c b/gdb/gdbserver/linux-aarch32-low.c
index 051e614..a932373 100644
--- a/gdb/gdbserver/linux-aarch32-low.c
+++ b/gdb/gdbserver/linux-aarch32-low.c
@@ -143,10 +143,10 @@ arm_store_vfpregset (struct regcache *regcache, const void *buf)
/* Register sets with using PTRACE_GETREGSET. */
static struct regset_info aarch32_regsets[] = {
- { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_PRSTATUS, 18 * 4,
- GENERAL_REGS,
+ { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_PRSTATUS,
+ ARM_CORE_REGS_SIZE + ARM_INT_REGISTER_SIZE, GENERAL_REGS,
arm_fill_gregset, arm_store_gregset },
- { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_ARM_VFP, 32 * 8 + 4,
+ { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_ARM_VFP, ARM_VFP3_REGS_SIZE,
EXTENDED_REGS,
arm_fill_vfpregset, arm_store_vfpregset },
NULL_REGSET
diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c
index ff72a48..b323b19 100644
--- a/gdb/gdbserver/linux-arm-low.c
+++ b/gdb/gdbserver/linux-arm-low.c
@@ -876,7 +876,7 @@ arm_read_description (void)
/* Now make sure that the kernel supports reading these
registers. Support was added in 2.6.30. */
errno = 0;
- buf = (char *) xmalloc (32 * 8 + 4);
+ buf = (char *) xmalloc (ARM_VFP3_REGS_SIZE);
if (ptrace (PTRACE_GETVFPREGS, pid, 0, buf) < 0
&& errno == EIO)
result = tdesc_arm;
@@ -973,14 +973,12 @@ arm_get_syscall_trapinfo (struct regcache *regcache, int *sysno)
/* Register sets without using PTRACE_GETREGSET. */
static struct regset_info arm_regsets[] = {
- { PTRACE_GETREGS, PTRACE_SETREGS, 0, 18 * 4,
- GENERAL_REGS,
+ { PTRACE_GETREGS, PTRACE_SETREGS, 0,
+ ARM_CORE_REGS_SIZE + ARM_INT_REGISTER_SIZE, GENERAL_REGS,
arm_fill_gregset, arm_store_gregset },
- { PTRACE_GETWMMXREGS, PTRACE_SETWMMXREGS, 0, 16 * 8 + 6 * 4,
- EXTENDED_REGS,
+ { PTRACE_GETWMMXREGS, PTRACE_SETWMMXREGS, 0, IWMMXT_REGS_SIZE, EXTENDED_REGS,
arm_fill_wmmxregset, arm_store_wmmxregset },
- { PTRACE_GETVFPREGS, PTRACE_SETVFPREGS, 0, 32 * 8 + 4,
- EXTENDED_REGS,
+ { PTRACE_GETVFPREGS, PTRACE_SETVFPREGS, 0, ARM_VFP3_REGS_SIZE, EXTENDED_REGS,
arm_fill_vfpregset, arm_store_vfpregset },
NULL_REGSET
};