Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Alan Hayward <Alan.Hayward@arm.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: nd <nd@arm.com>, Alan Hayward <Alan.Hayward@arm.com>
Subject: [PATCH v2 8/8] AArch64: Read pauth section from core files
Date: Wed, 06 Mar 2019 13:33:00 -0000	[thread overview]
Message-ID: <20190306133325.2531-9-alan.hayward@arm.com> (raw)
In-Reply-To: <20190306133325.2531-1-alan.hayward@arm.com>

2019-03-06  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.
---
 gdb/aarch64-linux-tdep.c | 20 ++++++++++++++++++++
 gdb/aarch64-linux-tdep.h |  3 +++
 2 files changed, 23 insertions(+)

diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index 5eeafa456c..32c5eefa35 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -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.  */
diff --git a/gdb/aarch64-linux-tdep.h b/gdb/aarch64-linux-tdep.h
index 244095cbca..a8c9443cbe 100644
--- a/gdb/aarch64-linux-tdep.h
+++ b/gdb/aarch64-linux-tdep.h
@@ -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;
 
-- 
2.17.2 (Apple Git-113)


  parent reply	other threads:[~2019-03-06 13:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-06 13:33 [PATCH v2 0/8] Support for AArch64 Pointer Authentication Alan Hayward
2019-03-06 13:33 ` [PATCH v2 2/8] AArch64: Use HWCAP to detect pauth feature Alan Hayward
2019-03-21 20:51   ` Simon Marchi
2019-03-22 12:06     ` Alan Hayward
2019-03-06 13:33 ` [PATCH v2 5/8] AArch64: Add pauth DWARF registers Alan Hayward
2019-03-06 13:33 ` [PATCH v2 7/8] AArch64: Prologue scan unwinder support for signed return addresses Alan Hayward
2019-03-06 13:33 ` [PATCH v2 6/8] AArch64: DWARF " Alan Hayward
2019-03-06 13:33 ` [PATCH v2 1/8] AArch64: Add pointer authentication feature Alan Hayward
2019-03-06 15:36   ` Eli Zaretskii
2019-03-06 13:33 ` [PATCH v2 3/8] AArch64: Read pauth registers Alan Hayward
2019-03-21 20:56   ` Simon Marchi
2019-03-06 13:33 ` [PATCH v2 4/8] AArch64: gdbserver: read " Alan Hayward
2019-03-21 21:03   ` Simon Marchi
2019-03-06 13:33 ` Alan Hayward [this message]
2019-03-14 12:34 ` [PATCH v2 0/8] Support for AArch64 Pointer Authentication Alan Hayward
2019-03-21 21:29   ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190306133325.2531-9-alan.hayward@arm.com \
    --to=alan.hayward@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=nd@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox