[PowerPC] Fix VSX registers in linux core files
authorPedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com>
Tue, 22 May 2018 14:09:05 +0000 (11:09 -0300)
committerPedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com>
Tue, 22 May 2018 14:52:03 +0000 (11:52 -0300)
commit2c3305f6b0432e37d26ce7761d0c4415ab5ca911
treec3f2cfeb6eedcc5f382a063106ea284441cb7417
parent1d75a65809b49d41e97518b99c551a4bb2517500
[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.
gdb/ChangeLog
gdb/ppc-linux-nat.c
gdb/ppc-linux-tdep.c
gdb/ppc-linux-tdep.h
gdb/rs6000-tdep.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.arch/powerpc-vsx-gcore.exp [new file with mode: 0644]