aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/linux-ppc-low.c
diff options
context:
space:
mode:
authorPedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com>2018-05-22 11:09:05 -0300
committerPedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com>2018-05-22 11:52:02 -0300
commitd078308a2ed1290e587b4365e2d7382d951a26af (patch)
treeaf477b250fd1fcb1889e31c062a3c42942f34d15 /gdb/gdbserver/linux-ppc-low.c
parent7273b5fc4baef93f8caaed678476e8cb3625338d (diff)
downloadgdb-d078308a2ed1290e587b4365e2d7382d951a26af.zip
gdb-d078308a2ed1290e587b4365e2d7382d951a26af.tar.gz
gdb-d078308a2ed1290e587b4365e2d7382d951a26af.tar.bz2
[PowerPC] Consolidate linux vector regset sizes
This patch defines constants for the sizes of the two vector regsets (vector-scalar registers and regular vector registers). The native, gdbserver and core file targets are changed to use these constants. The Linux ptrace calls return (or read) a smaller regset than the one found in core files for vector registers, because ptrace uses a single 4-byte quantity for vrsave at the end of the regset, while the core-file regset uses a full 16-byte field for vrsave. For simplicity, the larger size is used in both cases, and so a buffer with 12 unused additional bytes is passed to ptrace in the native target. gdb/ChangeLog: 2018-05-22 Pedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com> * arch/ppc-linux-common.h (PPC_LINUX_SIZEOF_VRREGSET) (PPC_LINUX_SIZEOF_VSXREGSET): Define. * ppc-linux-nat.c (SIZEOF_VSXREGS, SIZEOF_VRREGS): Remove. (gdb_vrregset_t): Change array type size to PPC_LINUX_SIZEOF_VRREGSET. (gdb_vsxregset_t): Change array type size to PPC_LINUX_SIZEOF_VSXREGSET. * ppc-linux-tdep.c (ppc_linux_iterate_over_regset_sections): Change integer literals to PPC_LINUX_SIZEOF_VRREGSET and PPC_LINUX_SIZEOF_VSXREGSET. gdb/gdbserver/ChangeLog: 2018-05-22 Pedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com> * linux-ppc-low.c (SIZEOF_VSXREGS, SIZEOF_VRREGS): Remove. (ppc_arch_setup): Change SIZEOF_VRREGS and SIZEOF_VSXREGS to PPC_LINUX_SIZEOF_VRREGSET and PPC_LINUX_SIZEOF_VSXREGSET.
Diffstat (limited to 'gdb/gdbserver/linux-ppc-low.c')
-rw-r--r--gdb/gdbserver/linux-ppc-low.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
index b440b0e..3678518 100644
--- a/gdb/gdbserver/linux-ppc-low.c
+++ b/gdb/gdbserver/linux-ppc-low.c
@@ -459,8 +459,6 @@ static void ppc_fill_gregset (struct regcache *regcache, void *buf)
ppc_collect_ptrace_register (regcache, i, (char *) buf + ppc_regmap[i]);
}
-#define SIZEOF_VSXREGS 32*8
-
static void
ppc_fill_vsxregset (struct regcache *regcache, void *buf)
{
@@ -483,8 +481,6 @@ ppc_store_vsxregset (struct regcache *regcache, const void *buf)
supply_register (regcache, base + i, &regset[i * 8]);
}
-#define SIZEOF_VRREGS 33*16+4
-
static void
ppc_fill_vrregset (struct regcache *regcache, void *buf)
{
@@ -660,10 +656,10 @@ ppc_arch_setup (void)
switch (regset->get_request)
{
case PTRACE_GETVRREGS:
- regset->size = features.altivec ? SIZEOF_VRREGS : 0;
+ regset->size = features.altivec ? PPC_LINUX_SIZEOF_VRREGSET : 0;
break;
case PTRACE_GETVSXREGS:
- regset->size = features.vsx ? SIZEOF_VSXREGS : 0;
+ regset->size = features.vsx ? PPC_LINUX_SIZEOF_VSXREGSET : 0;
break;
case PTRACE_GETEVRREGS:
if (ppc_hwcap & PPC_FEATURE_HAS_SPE)