aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/aarch64-linux-nat.c50
2 files changed, 19 insertions, 39 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 24a53a5..35a206e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2016-08-04 Yao Qi <yao.qi@linaro.org>
+
+ * aarch64-linux-nat.c (tdesc_arm_with_vfpv3): Remove the
+ declaration.
+ (aarch64_linux_read_description): Remove code on getting
+ auxv and select target description on it. Select target
+ description by the result of NT_ARM_VFP ptrace request.
+
2016-08-03 Tom Tromey <tom@tromey.com>
PR python/18565:
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index fe1631d..e431637 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -481,7 +481,6 @@ aarch64_linux_child_post_startup_inferior (struct target_ops *self,
super_post_startup_inferior (self, ptid);
}
-extern struct target_desc *tdesc_arm_with_vfpv3;
extern struct target_desc *tdesc_arm_with_neon;
/* Implement the "to_read_description" target_ops method. */
@@ -489,47 +488,20 @@ extern struct target_desc *tdesc_arm_with_neon;
static const struct target_desc *
aarch64_linux_read_description (struct target_ops *ops)
{
- CORE_ADDR at_phent;
-
- if (target_auxv_search (ops, AT_PHENT, &at_phent) == 1)
- {
- if (at_phent == sizeof (Elf64_External_Phdr))
- return tdesc_aarch64;
- else
- {
- CORE_ADDR arm_hwcap = 0;
-
- if (target_auxv_search (ops, AT_HWCAP, &arm_hwcap) != 1)
- return ops->beneath->to_read_description (ops->beneath);
-
-#ifndef COMPAT_HWCAP_VFP
-#define COMPAT_HWCAP_VFP (1 << 6)
-#endif
-#ifndef COMPAT_HWCAP_NEON
-#define COMPAT_HWCAP_NEON (1 << 12)
-#endif
-#ifndef COMPAT_HWCAP_VFPv3
-#define COMPAT_HWCAP_VFPv3 (1 << 13)
-#endif
-
- if (arm_hwcap & COMPAT_HWCAP_VFP)
- {
- char *buf;
- const struct target_desc *result = NULL;
-
- if (arm_hwcap & COMPAT_HWCAP_NEON)
- result = tdesc_arm_with_neon;
- else if (arm_hwcap & COMPAT_HWCAP_VFPv3)
- result = tdesc_arm_with_vfpv3;
+ int ret, tid;
+ gdb_byte regbuf[VFP_REGS_SIZE];
+ struct iovec iovec;
- return result;
- }
+ tid = ptid_get_lwp (inferior_ptid);
- return NULL;
- }
- }
+ iovec.iov_base = regbuf;
+ iovec.iov_len = VFP_REGS_SIZE;
- return tdesc_aarch64;
+ ret = ptrace (PTRACE_GETREGSET, tid, NT_ARM_VFP, &iovec);
+ if (ret == 0)
+ return tdesc_arm_with_neon;
+ else
+ return tdesc_aarch64;
}
/* Convert a native/host siginfo object, into/from the siginfo in the