This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[AArch64][5/6] Implement gdbarch_core_read_description

Currently, AArch64 only have one target description which is tdesc_aarch64.  So,
we haven't implemented any target description detetion mechanism for core file.

This patch is an initial implement of core_read_description method.  The "pauth"
feature or any future feature can use this to conditionally return selected

2017-08-09  Jiong Wang<>

	* aarch64-linux-tdep.c (aarch64_linux_core_read_description): New
	(aarch64_linux_init_abi): Register gdbarch_core_read_description.

diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index d2ca70a..ec6125a 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -231,6 +231,20 @@ aarch64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
       NULL, cb_data);
+/* Determine target description from core file.  */
+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 (target_auxv_search (target, AT_HWCAP, &aarch64_hwcap) != 1)
+    return NULL;
+  return tdesc_aarch64;
 /* Implementation of `gdbarch_stap_is_single_operand', as defined in
    gdbarch.h.  */
@@ -1018,6 +1032,8 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
     (gdbarch, aarch64_linux_iterate_over_regset_sections);
+  set_gdbarch_core_read_description
+    (gdbarch, aarch64_linux_core_read_description);
   /* SystemTap related.  */
   set_gdbarch_stap_integer_prefixes (gdbarch, stap_integer_prefixes);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]