AArch64: Read pauth section from core files
authorAlan Hayward <alan.hayward@arm.com>
Fri, 22 Mar 2019 10:43:17 +0000 (10:43 +0000)
committerAlan Hayward <alan.hayward@arm.com>
Fri, 22 Mar 2019 10:43:17 +0000 (10:43 +0000)
gdb/ChangeLog:

* aarch64-linux-tdep.c
(aarch64_linux_iterate_over_regset_sections): Check for pauth
section.
* aarch64-linux-tdep.h (AARCH64_LINUX_SIZEOF_PAUTH): New define.

gdb/ChangeLog
gdb/aarch64-linux-tdep.c
gdb/aarch64-linux-tdep.h

index c23881976c07f6bde57e2ceaf952059a463771b4..798bcc4142445f6a62449546a726850b9e46d982 100644 (file)
@@ -1,3 +1,11 @@
+2019-03-22  Alan Hayward  <alan.hayward@arm.com>
+           Jiong Wang  <jiong.wang@arm.com>
+
+       * aarch64-linux-tdep.c
+       (aarch64_linux_iterate_over_regset_sections): Check for pauth
+       section.
+       * aarch64-linux-tdep.h (AARCH64_LINUX_SIZEOF_PAUTH): New define.
+
 2019-03-22  Alan Hayward  <alan.hayward@arm.com>
            Jiong Wang  <jiong.wang@arm.com>
 
index d7db23ef38e9e4e2c59f4a7c1d9ba58ccdc0f7b1..bcd1961744dbb9dfe22653817f38ca85618a9c52 100644 (file)
@@ -627,6 +627,26 @@ aarch64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
   else
     cb (".reg2", AARCH64_LINUX_SIZEOF_FPREGSET, AARCH64_LINUX_SIZEOF_FPREGSET,
        &aarch64_linux_fpregset, NULL, cb_data);
+
+
+  if (tdep->has_pauth ())
+    {
+      /* Create this on the fly in order to handle the variable location.  */
+      const struct regcache_map_entry pauth_regmap[] =
+       {
+         { 2, AARCH64_PAUTH_DMASK_REGNUM (tdep->pauth_reg_base), 8},
+         { 0 }
+       };
+
+      const struct regset aarch64_linux_pauth_regset =
+       {
+         pauth_regmap, regcache_supply_regset, regcache_collect_regset
+       };
+
+      cb (".reg-aarch-pauth", AARCH64_LINUX_SIZEOF_PAUTH,
+         AARCH64_LINUX_SIZEOF_PAUTH, &aarch64_linux_pauth_regset,
+         "pauth registers", cb_data);
+    }
 }
 
 /* Implement the "core_read_description" gdbarch method.  */
index e9f7c9bccf4885447a61a24a22a02885581c21b9..ec494bfc5387ac47a5b979998e3541fbaad08c12 100644 (file)
@@ -33,6 +33,9 @@
    alignment.  */
 #define AARCH64_LINUX_SIZEOF_FPREGSET (33 * V_REGISTER_SIZE)
 
+/* The pauth regset consists of 2 X sized registers.  */
+#define AARCH64_LINUX_SIZEOF_PAUTH (2 * X_REGISTER_SIZE)
+
 extern const struct regset aarch64_linux_gregset;
 extern const struct regset aarch64_linux_fpregset;