This is the mail archive of the gdb-testers@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] [PowerPC] Fix access to VSCR in linux targets


*** TEST RESULTS FOR COMMIT 1d75a65809b49d41e97518b99c551a4bb2517500 ***

Author: Pedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com>
Branch: master
Commit: 1d75a65809b49d41e97518b99c551a4bb2517500

[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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]