Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Luis Machado via Gdb-patches <gdb-patches@sourceware.org>
To: <gdb-patches@sourceware.org>
Subject: [PATCH] [gdb/aarch64] debug registers: Add missing debug version entry for FEAT_Debugv8p8
Date: Fri, 14 Apr 2023 11:20:28 +0100	[thread overview]
Message-ID: <20230414102028.23617-1-luis.machado@arm.com> (raw)

The Arm Architecture Reference Manual defines debug version 0b1010 for
FEAT_Debugv8p8. This is used to identify valid hardware debug registers.

gdb currently only knows about versions up to FEAT_Debugv8p4. This patch
teaches gdb about this new version.

No visible changes should happen as consequence of this patch, but in the
future gdb will be able to identify debug registers in newer hardware.

Regression-tested on aarch64-linux Ubuntu 20.04/22.04.
---
 gdb/nat/aarch64-hw-point.h       | 1 +
 gdb/nat/aarch64-linux-hw-point.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/gdb/nat/aarch64-hw-point.h b/gdb/nat/aarch64-hw-point.h
index 13ec0c5fe9d..f4662f7c782 100644
--- a/gdb/nat/aarch64-hw-point.h
+++ b/gdb/nat/aarch64-hw-point.h
@@ -58,6 +58,7 @@
 #define AARCH64_DEBUG_ARCH_V8_1 0x7
 #define AARCH64_DEBUG_ARCH_V8_2 0x8
 #define AARCH64_DEBUG_ARCH_V8_4 0x9
+#define AARCH64_DEBUG_ARCH_V8_8 0x10
 
 /* ptrace expects control registers to be formatted as follows:
 
diff --git a/gdb/nat/aarch64-linux-hw-point.c b/gdb/nat/aarch64-linux-hw-point.c
index 096c34fe9c8..ccb47cd5aa2 100644
--- a/gdb/nat/aarch64-linux-hw-point.c
+++ b/gdb/nat/aarch64-linux-hw-point.c
@@ -232,6 +232,8 @@ compatible_debug_arch (unsigned int debug_arch)
     return true;
   if (debug_arch == AARCH64_DEBUG_ARCH_V8_4)
     return true;
+  if (debug_arch == AARCH64_DEBUG_ARCH_V8_8)
+    return true;
 
   return false;
 }
-- 
2.25.1


             reply	other threads:[~2023-04-14 10:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-14 10:20 Luis Machado via Gdb-patches [this message]
2023-04-14 12:16 ` Luis Machado via Gdb-patches

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=20230414102028.23617-1-luis.machado@arm.com \
    --to=gdb-patches@sourceware.org \
    --cc=luis.machado@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