aboutsummaryrefslogtreecommitdiff
path: root/gdb/aarch64-linux-tdep.c
diff options
context:
space:
mode:
authorAlan Hayward <alan.hayward@arm.com>2019-03-25 16:48:03 +0000
committerAlan Hayward <alan.hayward@arm.com>2019-03-25 16:50:38 +0000
commit0f83012ea0fb84d86d2a84a5feb51c0d63f0b7eb (patch)
treecb3bc9d4001b27d418fdb2f45f18ad3997e37547 /gdb/aarch64-linux-tdep.c
parent796d6298bb11deab06814cc38cfe74a1bfc57551 (diff)
downloadgdb-0f83012ea0fb84d86d2a84a5feb51c0d63f0b7eb.zip
gdb-0f83012ea0fb84d86d2a84a5feb51c0d63f0b7eb.tar.gz
gdb-0f83012ea0fb84d86d2a84a5feb51c0d63f0b7eb.tar.bz2
Add linux_get_hwcap
Tidy up calls to read HWCAP (and HWCAP2) by adding common functions, removing the PPC and AArch64 specific versions. The only function difference is in aarch64_linux_core_read_description - if the hwcap read fails it now return a valid description instead of nullptr. gdb/ChangeLog: 2019-03-25 Alan Hayward <alan.hayward@arm.com> * aarch64-linux-nat.c (aarch64_linux_nat_target::read_description): Call linux_get_hwcap. * aarch64-linux-tdep.c (aarch64_linux_core_read_description): Likewise. (aarch64_linux_get_hwcap): Remove function. * aarch64-linux-tdep.h (aarch64_linux_get_hwcap): Remove declaration. * arm-linux-nat.c (arm_linux_nat_target::read_description):Call linux_get_hwcap. * arm-linux-tdep.c (arm_linux_core_read_description): Likewise. * linux-tdep.c (linux_get_hwcap): Add function. (linux_get_hwcap2): Likewise. * linux-tdep.h (linux_get_hwcap): Add declaration. (linux_get_hwcap2): Likewise. * ppc-linux-nat.c (ppc_linux_get_hwcap): Remove function. (ppc_linux_get_hwcap2): Likewise. (ppc_linux_nat_target::region_ok_for_hw_watchpoint): Call linux_get_hwcap. (ppc_linux_nat_target::insert_watchpoint): Likewise. (ppc_linux_nat_target::watchpoint_addr_within_range): Likewise. (ppc_linux_nat_target::read_description): Likewise. * ppc-linux-tdep.c (ppc_linux_core_read_description): Likewise. * s390-linux-nat.c: Likewise. * s390-linux-tdep.c (s390_core_read_description): Likewise.
Diffstat (limited to 'gdb/aarch64-linux-tdep.c')
-rw-r--r--gdb/aarch64-linux-tdep.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index bcd1961..7f2193f 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -655,13 +655,10 @@ static const struct target_desc *
aarch64_linux_core_read_description (struct gdbarch *gdbarch,
struct target_ops *target, bfd *abfd)
{
- CORE_ADDR aarch64_hwcap = 0;
-
- if (!aarch64_linux_get_hwcap (target, &aarch64_hwcap))
- return nullptr;
+ CORE_ADDR hwcap = linux_get_hwcap (target);
return aarch64_read_description (aarch64_linux_core_read_vq (gdbarch, abfd),
- aarch64_hwcap & AARCH64_HWCAP_PACA);
+ hwcap & AARCH64_HWCAP_PACA);
}
/* Implementation of `gdbarch_stap_is_single_operand', as defined in
@@ -1439,15 +1436,6 @@ aarch64_linux_gcc_target_options (struct gdbarch *gdbarch)
return NULL;
}
-/* See aarch64-linux-tdep.h. */
-
-bool
-aarch64_linux_get_hwcap (struct target_ops *target, CORE_ADDR *hwcap)
-{
- *hwcap = 0;
- return target_auxv_search (target, AT_HWCAP, hwcap) == 1;
-}
-
static void
aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{