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 | 1d75a65809b49d41e97518b99c551a4bb2517500 (patch) | |
tree | fa78d1d569616d20b3ad13629d870d53bbc13a06 /gdb/rs6000-aix-tdep.c | |
parent | d078308a2ed1290e587b4365e2d7382d951a26af (diff) | |
download | gdb-1d75a65809b49d41e97518b99c551a4bb2517500.zip gdb-1d75a65809b49d41e97518b99c551a4bb2517500.tar.gz gdb-1d75a65809b49d41e97518b99c551a4bb2517500.tar.bz2 |
[PowerPC] Fix access to VSCR in linux targets
The 4-byte VSCR register is found inside a 16-byte field in the regset
returned by ptrace and in core files. The position of VSCR depends on
the endianess of the target, which was previously assumed to be
big-endian for the purpose of getting VSCR. This patch removes this
assumption to fix access to VSCR in little-endian mode.
gdb/ChangeLog:
2018-05-22 Pedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com>
* ppc-tdep.h (struct ppc_reg_offsets): Remove vector register
offset fields.
* ppc-fbsd-tdep.c (ppc32_fbsd_reg_offsets): Remove initializers
for vector register offset fields.
(ppc64_fbsd_reg_offsets): Likewise.
* ppc-nbsd-tdep.c (_initialize_ppcnbsd_tdep): Remove assignment
to vector register offset fields.
* ppc-obsd-tdep.c (_initialize_ppcnbsd_tdep): Remove assignment
to vector register offset fields.
* ppc-obsd-nat.c (_initialize_ppcobsd_nat): Remove assignment to
vector register offset fields.
* rs6000-aix-tdep.c (rs6000_aix32_reg_offsets): Remove
initializers for vector register offset fields.
(rs6000_aix64_reg_offsets): Likewise.
* rs6000-tdep.c (ppc_vrreg_offset): Remove.
(ppc_supply_vrregset): Remove.
(ppc_collect_vrregset): Remove.
* ppc-linux-tdep.c (ppc_linux_collect_vrregset): New function.
(ppc_linux_vrregset) : New function.
(ppc32_le_linux_vrregmap, ppc32_be_linux_vrregmap)
(ppc32_le_linux_vrregset, ppc32_be_linux_vrregset): New globals.
(ppc32_linux_vrregset): Remove.
(ppc_linux_iterate_over_regset_sections): Call ppc_linux_vrregset
and use result instead of ppc32_linux_vrregset.
(ppc32_linux_reg_offsets): Remove initializers for vector register
offset fields.
(ppc64_linux_reg_offsets): Likewise.
* ppc-linux-tdep.h (ppc_linux_vrregset): New declaration.
* ppc-linux-nat.c: Include regset.h.
(gdb_vrregset_t): Adjust comment to account for little-endian
mode.
(supply_vrregset, fill_vrregset): Remove.
(fetch_altivec_register, store_altivec_register): Remove.
(fetch_altivec_registers): Add regno parameter. Get regset using
ppc_linux_vrregset. Use regset to supply registers.
(store_altivec_registers): Add regno parameter. Get regset using
ppc_linux_vrregset. Use regset to collect registers.
(fetch_register): Call fetch_altivec_registers instead of
fetch_altivec_register.
(store_register): Call store_altivec_registers instead of
store_altivec_register.
(fetch_ppc_registers): Call fetch_altivec_registers with -1 for
the new regno parameter.
(store_ppc_registers): Call store_altivec_registers with -1 for
the new regno parameter.
gdb/gdbserver/ChangeLog:
2018-05-22 Pedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com>
* linux-ppc-low.c (ppc_fill_vrregset): Add vscr_offset variable.
Set vscr_offset to 0 in little-endian mode and 12 in big-endian
mode. Call collect_register_by_name with vscr using
vscr_offset. Zero-pad vscr and vrsave fields in collector buffer.
(ppc_store_vrregset): Add and set vscr_offset variable as in
ppc_fill_vrregset. Call supply_register_by_name with vscr using
vscr_offset.
Diffstat (limited to 'gdb/rs6000-aix-tdep.c')
-rw-r--r-- | gdb/rs6000-aix-tdep.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c index e3e086c..ecf6191 100644 --- a/gdb/rs6000-aix-tdep.c +++ b/gdb/rs6000-aix-tdep.c @@ -70,12 +70,7 @@ static struct ppc_reg_offsets rs6000_aix32_reg_offsets = /* Floating-point registers. */ 336, /* f0_offset */ 56, /* fpscr_offset */ - 4, /* fpscr_size */ - - /* AltiVec registers. */ - -1, /* vr0_offset */ - -1, /* vscr_offset */ - -1 /* vrsave_offset */ + 4 /* fpscr_size */ }; static struct ppc_reg_offsets rs6000_aix64_reg_offsets = @@ -95,12 +90,7 @@ static struct ppc_reg_offsets rs6000_aix64_reg_offsets = /* Floating-point registers. */ 312, /* f0_offset */ 296, /* fpscr_offset */ - 4, /* fpscr_size */ - - /* AltiVec registers. */ - -1, /* vr0_offset */ - -1, /* vscr_offset */ - -1 /* vrsave_offset */ + 4 /* fpscr_size */ }; |