[gdb/aarch64] debug registers: Add missing debug version entry for FEAT_Debugv8p8

Message ID 20230414102028.23617-1-luis.machado@arm.com
State New
Headers
Series [gdb/aarch64] debug registers: Add missing debug version entry for FEAT_Debugv8p8 |

Commit Message

Luis Machado April 14, 2023, 10:20 a.m. UTC
  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(+)
  

Comments

Luis Machado April 14, 2023, 12:16 p.m. UTC | #1
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.
  

Patch

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;
 }