diff options
author | Pedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com> | 2018-05-22 11:09:05 -0300 |
---|---|---|
committer | Pedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com> | 2018-05-22 11:52:03 -0300 |
commit | 2c3305f6b0432e37d26ce7761d0c4415ab5ca911 (patch) | |
tree | c3f2cfeb6eedcc5f382a063106ea284441cb7417 /gdb/rs6000-tdep.c | |
parent | 1d75a65809b49d41e97518b99c551a4bb2517500 (diff) | |
download | gdb-2c3305f6b0432e37d26ce7761d0c4415ab5ca911.zip gdb-2c3305f6b0432e37d26ce7761d0c4415ab5ca911.tar.gz gdb-2c3305f6b0432e37d26ce7761d0c4415ab5ca911.tar.bz2 |
[PowerPC] Fix VSX registers in linux core files
The functions used by the VSX regset to collect and supply registers
from core files where incorrect. This patch changes the regset to use
the standard regset collect/supply functions to fix this. The native
target is also changed to use the same regset.
gdb/ChangeLog:
2018-05-22 Pedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com>
* ppc-linux-tdep.c (ppc_linux_vsxregset): New function.
(ppc32_linux_vsxregmap): New global.
(ppc32_linux_vsxregset): Initialize with ppc32_linux_vsxregmap,
regcache_supply_regset, and regcache_collect_regset.
* ppc-linux-tdep.h (ppc_linux_vsxregset): Declare.
* ppc-linux-nat.c (supply_vsxregset, fill_vsxregset): Remove.
(fetch_vsx_register, store_vsx_register): Remove.
(fetch_vsx_registers): Add regno parameter. Get regset using
ppc_linux_vsxregset. Use regset to supply registers.
(store_vsx_registers): Add regno parameter. Get regset using
ppc_linux_vsxregset. Use regset to collect registers.
(fetch_register): Call fetch_vsx_registers instead of
fetch_vsx_register.
(store_register): Call store_vsx_registers instead of
store_vsx_register.
(fetch_ppc_registers): Call fetch_vsx_registers with -1 for the
new regno parameter.
(store_ppc_registers): Call store_vsx_registers with -1 for the
new regno parameter.
* rs6000-tdep.c (ppc_vsx_support_p, ppc_supply_vsxreget)
(ppc_collect_vsxregset): Remove.
gdb/testsuite/ChangeLog:
2018-05-22 Pedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com>
* gdb.arch/powerpc-vsx-gcore.exp: New file.
Diffstat (limited to 'gdb/rs6000-tdep.c')
-rw-r--r-- | gdb/rs6000-tdep.c | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 4ef6f9e..0a56c78 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -224,16 +224,6 @@ ppc_floating_point_unit_p (struct gdbarch *gdbarch) } /* Return non-zero if the architecture described by GDBARCH has - VSX registers (vsr0 --- vsr63). */ -static int -ppc_vsx_support_p (struct gdbarch *gdbarch) -{ - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - - return tdep->ppc_vsr0_regnum >= 0; -} - -/* Return non-zero if the architecture described by GDBARCH has Altivec registers (vr0 --- vr31, vrsave and vscr). */ int ppc_altivec_support_p (struct gdbarch *gdbarch) @@ -573,37 +563,6 @@ ppc_supply_fpregset (const struct regset *regset, struct regcache *regcache, regnum == tdep->ppc_fpscr_regnum ? offsets->fpscr_size : 8); } -/* Supply register REGNUM in the VSX register set REGSET - from the buffer specified by VSXREGS and LEN to register cache - REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */ - -void -ppc_supply_vsxregset (const struct regset *regset, struct regcache *regcache, - int regnum, const void *vsxregs, size_t len) -{ - struct gdbarch *gdbarch = regcache->arch (); - struct gdbarch_tdep *tdep; - - if (!ppc_vsx_support_p (gdbarch)) - return; - - tdep = gdbarch_tdep (gdbarch); - - if (regnum == -1) - { - int i; - - for (i = tdep->ppc_vsr0_upper_regnum; - i < tdep->ppc_vsr0_upper_regnum + 32; - i++) - ppc_supply_reg (regcache, i, (const gdb_byte *) vsxregs, 0, 8); - - return; - } - else - ppc_supply_reg (regcache, regnum, (const gdb_byte *) vsxregs, 0, 8); -} - /* Collect register REGNUM in the general-purpose register set REGSET from register cache REGCACHE into the buffer specified by GREGS and LEN. If REGNUM is -1, do this for all registers in @@ -695,39 +654,6 @@ ppc_collect_fpregset (const struct regset *regset, regnum == tdep->ppc_fpscr_regnum ? offsets->fpscr_size : 8); } -/* Collect register REGNUM in the VSX register set - REGSET from register cache REGCACHE into the buffer specified by - VSXREGS and LEN. If REGNUM is -1, do this for all registers in - REGSET. */ - -void -ppc_collect_vsxregset (const struct regset *regset, - const struct regcache *regcache, - int regnum, void *vsxregs, size_t len) -{ - struct gdbarch *gdbarch = regcache->arch (); - struct gdbarch_tdep *tdep; - - if (!ppc_vsx_support_p (gdbarch)) - return; - - tdep = gdbarch_tdep (gdbarch); - - if (regnum == -1) - { - int i; - - for (i = tdep->ppc_vsr0_upper_regnum; - i < tdep->ppc_vsr0_upper_regnum + 32; - i++) - ppc_collect_reg (regcache, i, (gdb_byte *) vsxregs, 0, 8); - - return; - } - else - ppc_collect_reg (regcache, regnum, (gdb_byte *) vsxregs, 0, 8); -} - static int insn_changes_sp_or_jumps (unsigned long insn) { |