From 0ec848ad25bb77edd9c9c3c097c3dd5b8874a6c0 Mon Sep 17 00:00:00 2001 From: Pedro Franco de Carvalho Date: Tue, 22 May 2018 11:09:06 -0300 Subject: [PowerPC] Recognize isa205 in linux core files Currently the ppc linux core file target doesn't return target descriptions with the lager FPSCR introduced in isa205. This patch changes the core file target so that the auxv is read from the core file to determine the size of FPSCR, so that the appropriate target description is selected. gdb/ChangeLog: 2018-05-22 Pedro Franco de Carvalho * arch/ppc-linux-common.c (ppc_linux_has_isa205): Change the parameter type to CORE_ADDR. * arch/ppc-linux-common.h (ppc_linux_has_isa205): Change the parameter type in declaration to CORE_ADDR. * ppc-linux-tdep.c (ppc_linux_core_read_description): Call target_auxv_search to get AT_HWCAP and use the result to get the target description. * ppc-linux-nat.c (ppc_linux_get_hwcap): Change the return type to CORE_ADDR. Remove the cast of the return value to unsigned long. Fix error predicate of target_auxv_search. (ppc_linux_nat_target::read_description): Change the type of the hwcap variable to CORE_ADDR. gdb/testsuite/ChangeLog: 2018-05-22 Pedro Franco de Carvalho * gdb.arch/powerpc-fpscr-gcore.exp: New file. --- gdb/arch/ppc-linux-common.c | 2 +- gdb/arch/ppc-linux-common.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/arch') diff --git a/gdb/arch/ppc-linux-common.c b/gdb/arch/ppc-linux-common.c index 87ccc42..45da105 100644 --- a/gdb/arch/ppc-linux-common.c +++ b/gdb/arch/ppc-linux-common.c @@ -31,7 +31,7 @@ #endif bool -ppc_linux_has_isa205 (unsigned long hwcap) +ppc_linux_has_isa205 (CORE_ADDR hwcap) { /* Power ISA 2.05 (implemented by Power 6 and newer processors) increases the FPSCR from 32 bits to 64 bits. Even though Power 7 diff --git a/gdb/arch/ppc-linux-common.h b/gdb/arch/ppc-linux-common.h index 798781c..2f535e8 100644 --- a/gdb/arch/ppc-linux-common.h +++ b/gdb/arch/ppc-linux-common.h @@ -32,7 +32,7 @@ struct target_desc; #define PPC_LINUX_SIZEOF_VSXREGSET 256 /* Check if the hwcap auxv entry indicates that isa205 is supported. */ -bool ppc_linux_has_isa205 (unsigned long hwcap); +bool ppc_linux_has_isa205 (CORE_ADDR hwcap); /* Features used to determine the target description. */ struct ppc_linux_features -- cgit v1.1