mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-19 09:14:14 +08:00
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.
This commit is contained in:
@ -2462,6 +2462,28 @@ linux_displaced_step_location (struct gdbarch *gdbarch)
|
||||
return addr;
|
||||
}
|
||||
|
||||
/* See linux-tdep.h. */
|
||||
|
||||
CORE_ADDR
|
||||
linux_get_hwcap (struct target_ops *target)
|
||||
{
|
||||
CORE_ADDR field;
|
||||
if (target_auxv_search (target, AT_HWCAP, &field) != 1)
|
||||
return 0;
|
||||
return field;
|
||||
}
|
||||
|
||||
/* See linux-tdep.h. */
|
||||
|
||||
CORE_ADDR
|
||||
linux_get_hwcap2 (struct target_ops *target)
|
||||
{
|
||||
CORE_ADDR field;
|
||||
if (target_auxv_search (target, AT_HWCAP2, &field) != 1)
|
||||
return 0;
|
||||
return field;
|
||||
}
|
||||
|
||||
/* Display whether the gcore command is using the
|
||||
/proc/PID/coredump_filter file. */
|
||||
|
||||
|
Reference in New Issue
Block a user