public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] [gdb/aarch64] debug registers: Add missing debug version entry for FEAT_Debugv8p8
@ 2023-04-14 10:20 Luis Machado
  2023-04-14 12:16 ` Luis Machado
  0 siblings, 1 reply; 2+ messages in thread
From: Luis Machado @ 2023-04-14 10:20 UTC (permalink / raw)
  To: gdb-patches

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] [gdb/aarch64] debug registers: Add missing debug version entry for FEAT_Debugv8p8
  2023-04-14 10:20 [PATCH] [gdb/aarch64] debug registers: Add missing debug version entry for FEAT_Debugv8p8 Luis Machado
@ 2023-04-14 12:16 ` Luis Machado
  0 siblings, 0 replies; 2+ messages in thread
From: Luis Machado @ 2023-04-14 12:16 UTC (permalink / raw)
  To: gdb-patches

On 4/14/23 11:20, Luis Machado via Gdb-patches wrote:
> 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;
>   }

Pushed now.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-14 12:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-14 10:20 [PATCH] [gdb/aarch64] debug registers: Add missing debug version entry for FEAT_Debugv8p8 Luis Machado
2023-04-14 12:16 ` Luis Machado

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).