aboutsummaryrefslogtreecommitdiff
path: root/gdb/ppc-linux-nat.c
diff options
context:
space:
mode:
authorPedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com>2018-05-22 11:09:06 -0300
committerPedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com>2018-05-22 11:52:03 -0300
commit0ec848ad25bb77edd9c9c3c097c3dd5b8874a6c0 (patch)
tree549c18bd9141c5917efe0b009c2e0255cdd8de8a /gdb/ppc-linux-nat.c
parent0fb2aaa15e04238644471f7d89be3667784b19c0 (diff)
downloadgdb-0ec848ad25bb77edd9c9c3c097c3dd5b8874a6c0.zip
gdb-0ec848ad25bb77edd9c9c3c097c3dd5b8874a6c0.tar.gz
gdb-0ec848ad25bb77edd9c9c3c097c3dd5b8874a6c0.tar.bz2
[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 <pedromfc@linux.vnet.ibm.com> * 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 <pedromfc@linux.vnet.ibm.com> * gdb.arch/powerpc-fpscr-gcore.exp: New file.
Diffstat (limited to 'gdb/ppc-linux-nat.c')
-rw-r--r--gdb/ppc-linux-nat.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index 0f7dd4c..eb21f91 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -1165,15 +1165,15 @@ store_ppc_registers (const struct regcache *regcache, int tid)
}
/* Fetch the AT_HWCAP entry from the aux vector. */
-static unsigned long
+static CORE_ADDR
ppc_linux_get_hwcap (void)
{
CORE_ADDR field;
- if (target_auxv_search (target_stack, AT_HWCAP, &field))
- return (unsigned long) field;
+ if (target_auxv_search (target_stack, AT_HWCAP, &field) != 1)
+ return 0;
- return 0;
+ return field;
}
/* The cached DABR value, to install in new threads.
@@ -2236,7 +2236,7 @@ ppc_linux_nat_target::read_description ()
features.wordsize = ppc_linux_target_wordsize (tid);
- unsigned long hwcap = ppc_linux_get_hwcap ();
+ CORE_ADDR hwcap = ppc_linux_get_hwcap ();
if (have_ptrace_getsetvsxregs
&& (hwcap & PPC_FEATURE_HAS_VSX))