This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Fix ARMv8.1/v8.2 for hw watchpoint and breakpoint


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=49ecef2a7da2ee9df4ae675f99b70518fbf1bb23

commit 49ecef2a7da2ee9df4ae675f99b70518fbf1bb23
Author: Andrew Pinski <apinski@cavium.com>
Date:   Sat Jul 23 09:56:44 2016 -0700

    Fix ARMv8.1/v8.2 for hw watchpoint and breakpoint
    
    The problem here is ARMv8.1 (and ARMv8.2) define a
    different debug version than ARMv8 (7 and 8 respectively).
    This fixes hw watchpoints and breakpoints by checking
    for those debug versions too.
    
    Committed as obvious after a test on aarch64-linux-gnu
    (on a ThunderX machine which has ARMv8.1 support enabled).
    
    ChangeLog:
    	* nat/aarch64-linux-hw-point.c
    	(aarch64_linux_get_debug_reg_capacity): Handle
    	ARMv8.1 and ARMv8.2 debug versions.
    	* nat/aarch64-linux-hw-point.h
    	(AARCH64_DEBUG_ARCH_V8_1): New define.
    	(AARCH64_DEBUG_ARCH_V8_2): New define.
    
    Signed-off-by: Andrew Pinski <apinski@cavium.com>

Diff:
---
 gdb/ChangeLog                    | 9 +++++++++
 gdb/nat/aarch64-linux-hw-point.c | 8 ++++++--
 gdb/nat/aarch64-linux-hw-point.h | 2 ++
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0f4a8b6..56cd5ba 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,12 @@
+2016-07-23  Andrew Pinski  <apinski@cavium.com>
+
+	* nat/aarch64-linux-hw-point.c
+	(aarch64_linux_get_debug_reg_capacity): Handle
+	ARMv8.1 and ARMv8.2 debug versions.
+	* nat/aarch64-linux-hw-point.h
+	(AARCH64_DEBUG_ARCH_V8_1): New define.
+	(AARCH64_DEBUG_ARCH_V8_2): New define.
+
 2016-06-30  РÑ?Ñ?лан Ð?жбÑ?лаÑ?ов  <lrn1986@gmail.com>
 
 	PR gdb/14529
diff --git a/gdb/nat/aarch64-linux-hw-point.c b/gdb/nat/aarch64-linux-hw-point.c
index a06a6e6..f9e04d9 100644
--- a/gdb/nat/aarch64-linux-hw-point.c
+++ b/gdb/nat/aarch64-linux-hw-point.c
@@ -630,7 +630,9 @@ aarch64_linux_get_debug_reg_capacity (int tid)
 
   /* Get hardware watchpoint register info.  */
   if (ptrace (PTRACE_GETREGSET, tid, NT_ARM_HW_WATCH, &iov) == 0
-      && AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8)
+      && (AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8
+	  || AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8_1
+	  || AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8_2))
     {
       aarch64_num_wp_regs = AARCH64_DEBUG_NUM_SLOTS (dreg_state.dbg_info);
       if (aarch64_num_wp_regs > AARCH64_HWP_MAX_NUM)
@@ -650,7 +652,9 @@ aarch64_linux_get_debug_reg_capacity (int tid)
 
   /* Get hardware breakpoint register info.  */
   if (ptrace (PTRACE_GETREGSET, tid, NT_ARM_HW_BREAK, &iov) == 0
-      && AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8)
+      && (AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8
+	  || AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8_1
+	  || AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8_2))
     {
       aarch64_num_bp_regs = AARCH64_DEBUG_NUM_SLOTS (dreg_state.dbg_info);
       if (aarch64_num_bp_regs > AARCH64_HBP_MAX_NUM)
diff --git a/gdb/nat/aarch64-linux-hw-point.h b/gdb/nat/aarch64-linux-hw-point.h
index acf0a49..16efb7c 100644
--- a/gdb/nat/aarch64-linux-hw-point.h
+++ b/gdb/nat/aarch64-linux-hw-point.h
@@ -68,6 +68,8 @@
 
 /* Macro for the expected version of the ARMv8-A debug architecture.  */
 #define AARCH64_DEBUG_ARCH_V8 0x6
+#define AARCH64_DEBUG_ARCH_V8_1 0x7
+#define AARCH64_DEBUG_ARCH_V8_2 0x8
 
 /* ptrace expects control registers to be formatted as follows:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]