aboutsummaryrefslogtreecommitdiff
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:03 -0300
commit1d75a65809b49d41e97518b99c551a4bb2517500 (patch)
treefa78d1d569616d20b3ad13629d870d53bbc13a06 /gdb/ppc-obsd-nat.c
parent[PowerPC] Consolidate linux vector regset sizes (diff)
downloadbinutils-gdb-1d75a65809b49d41e97518b99c551a4bb2517500.tar.gz
binutils-gdb-1d75a65809b49d41e97518b99c551a4bb2517500.tar.bz2
binutils-gdb-1d75a65809b49d41e97518b99c551a4bb2517500.zip
[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/ppc-obsd-nat.c')
-rw-r--r--gdb/ppc-obsd-nat.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/gdb/ppc-obsd-nat.c b/gdb/ppc-obsd-nat.c
index 781b09c7fe4..4428dabd7b9 100644
--- a/gdb/ppc-obsd-nat.c
+++ b/gdb/ppc-obsd-nat.c
@@ -213,11 +213,6 @@ _initialize_ppcobsd_nat (void)
ppcobsd_fpreg_offsets.fpscr_size = 4;
#endif
- /* AltiVec registers. */
- ppcobsd_reg_offsets.vr0_offset = offsetof (struct vreg, vreg);
- ppcobsd_reg_offsets.vscr_offset = offsetof (struct vreg, vscr);
- ppcobsd_reg_offsets.vrsave_offset = offsetof (struct vreg, vrsave);
-
/* Support debugging kernel virtual memory images. */
bsd_kvm_add_target (ppcobsd_supply_pcb);
}