Blame SOURCES/gdb-rhbz1363635-aarch64-armv8182.patch

2c2fa1
commit 49ecef2a7da2ee9df4ae675f99b70518fbf1bb23
2c2fa1
Author: Andrew Pinski <apinski@cavium.com>
2c2fa1
Date:   Sat Jul 23 09:56:44 2016 -0700
2c2fa1
2c2fa1
    Fix ARMv8.1/v8.2 for hw watchpoint and breakpoint
2c2fa1
    
2c2fa1
    The problem here is ARMv8.1 (and ARMv8.2) define a
2c2fa1
    different debug version than ARMv8 (7 and 8 respectively).
2c2fa1
    This fixes hw watchpoints and breakpoints by checking
2c2fa1
    for those debug versions too.
2c2fa1
    
2c2fa1
    Committed as obvious after a test on aarch64-linux-gnu
2c2fa1
    (on a ThunderX machine which has ARMv8.1 support enabled).
2c2fa1
    
2c2fa1
    ChangeLog:
2c2fa1
    	* nat/aarch64-linux-hw-point.c
2c2fa1
    	(aarch64_linux_get_debug_reg_capacity): Handle
2c2fa1
    	ARMv8.1 and ARMv8.2 debug versions.
2c2fa1
    	* nat/aarch64-linux-hw-point.h
2c2fa1
    	(AARCH64_DEBUG_ARCH_V8_1): New define.
2c2fa1
    	(AARCH64_DEBUG_ARCH_V8_2): New define.
2c2fa1
    
2c2fa1
    Signed-off-by: Andrew Pinski <apinski@cavium.com>
2c2fa1
2c2fa1
### a/gdb/ChangeLog
2c2fa1
### b/gdb/ChangeLog
2c2fa1
## -1,3 +1,12 @@
2c2fa1
+2016-07-23  Andrew Pinski  <apinski@cavium.com>
2c2fa1
+
2c2fa1
+	* nat/aarch64-linux-hw-point.c
2c2fa1
+	(aarch64_linux_get_debug_reg_capacity): Handle
2c2fa1
+	ARMv8.1 and ARMv8.2 debug versions.
2c2fa1
+	* nat/aarch64-linux-hw-point.h
2c2fa1
+	(AARCH64_DEBUG_ARCH_V8_1): New define.
2c2fa1
+	(AARCH64_DEBUG_ARCH_V8_2): New define.
2c2fa1
+
2c2fa1
 2016-06-30  Руслан Ижбулатов  <lrn1986@gmail.com>
2c2fa1
 
2c2fa1
 	PR gdb/14529
2c2fa1
Index: gdb-7.6.1/gdb/aarch64-linux-nat.c
2c2fa1
===================================================================
2c2fa1
--- gdb-7.6.1.orig/gdb/aarch64-linux-nat.c	2016-08-03 23:00:09.338705164 +0200
2c2fa1
+++ gdb-7.6.1/gdb/aarch64-linux-nat.c	2016-08-03 23:00:55.016092435 +0200
2c2fa1
@@ -110,6 +110,8 @@
2c2fa1
 
2c2fa1
 /* Macro for the expected version of the ARMv8-A debug architecture.  */
2c2fa1
 #define AARCH64_DEBUG_ARCH_V8 0x6
2c2fa1
+#define AARCH64_DEBUG_ARCH_V8_1 0x7
2c2fa1
+#define AARCH64_DEBUG_ARCH_V8_2 0x8
2c2fa1
 
2c2fa1
 /* Number of hardware breakpoints/watchpoints the target supports.
2c2fa1
    They are initialized with values obtained via the ptrace calls
2c2fa1
@@ -789,7 +791,9 @@
2c2fa1
 
2c2fa1
   /* Get hardware watchpoint register info.  */
2c2fa1
   if (ptrace (PTRACE_GETREGSET, tid, NT_ARM_HW_WATCH, &iov) == 0
2c2fa1
-      && AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8)
2c2fa1
+      && (AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8
2c2fa1
+	  || AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8_1
2c2fa1
+	  || AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8_2))
2c2fa1
     {
2c2fa1
       aarch64_num_wp_regs = AARCH64_DEBUG_NUM_SLOTS (dreg_state.dbg_info);
2c2fa1
       if (aarch64_num_wp_regs > AARCH64_HWP_MAX_NUM)
2c2fa1
@@ -809,7 +813,9 @@
2c2fa1
 
2c2fa1
   /* Get hardware breakpoint register info.  */
2c2fa1
   if (ptrace (PTRACE_GETREGSET, tid, NT_ARM_HW_BREAK, &iov) == 0
2c2fa1
-      && AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8)
2c2fa1
+      && (AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8
2c2fa1
+	  || AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8_1
2c2fa1
+	  || AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8_2))
2c2fa1
     {
2c2fa1
       aarch64_num_bp_regs = AARCH64_DEBUG_NUM_SLOTS (dreg_state.dbg_info);
2c2fa1
       if (aarch64_num_bp_regs > AARCH64_HBP_MAX_NUM)
2c2fa1
Index: gdb-7.6.1/gdb/gdbserver/linux-aarch64-low.c
2c2fa1
===================================================================
2c2fa1
--- gdb-7.6.1.orig/gdb/gdbserver/linux-aarch64-low.c	2016-08-03 23:00:08.117694812 +0200
2c2fa1
+++ gdb-7.6.1/gdb/gdbserver/linux-aarch64-low.c	2016-08-03 23:02:00.471647393 +0200
2c2fa1
@@ -1187,6 +1187,8 @@
2c2fa1
 #define AARCH64_DEBUG_NUM_SLOTS(x) ((x) & 0xff)
2c2fa1
 #define AARCH64_DEBUG_ARCH(x) (((x) >> 8) & 0xff)
2c2fa1
 #define AARCH64_DEBUG_ARCH_V8 0x6
2c2fa1
+#define AARCH64_DEBUG_ARCH_V8_1 0x7
2c2fa1
+#define AARCH64_DEBUG_ARCH_V8_2 0x8
2c2fa1
 
2c2fa1
 static void
2c2fa1
 aarch64_arch_setup (void)
2c2fa1
@@ -1203,7 +1205,9 @@
2c2fa1
 
2c2fa1
   /* Get hardware watchpoint register info.  */
2c2fa1
   if (ptrace (PTRACE_GETREGSET, pid, NT_ARM_HW_WATCH, &iov) == 0
2c2fa1
-      && AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8)
2c2fa1
+      && (AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8
2c2fa1
+	  || AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8_1
2c2fa1
+	  || AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8_2))
2c2fa1
     {
2c2fa1
       aarch64_num_wp_regs = AARCH64_DEBUG_NUM_SLOTS (dreg_state.dbg_info);
2c2fa1
       if (aarch64_num_wp_regs > AARCH64_HWP_MAX_NUM)
2c2fa1
@@ -1223,7 +1227,9 @@
2c2fa1
 
2c2fa1
   /* Get hardware breakpoint register info.  */
2c2fa1
   if (ptrace (PTRACE_GETREGSET, pid, NT_ARM_HW_BREAK, &iov) == 0
2c2fa1
-      && AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8)
2c2fa1
+      && (AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8
2c2fa1
+	  || AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8_1
2c2fa1
+	  || AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8_2))
2c2fa1
     {
2c2fa1
       aarch64_num_bp_regs = AARCH64_DEBUG_NUM_SLOTS (dreg_state.dbg_info);
2c2fa1
       if (aarch64_num_bp_regs > AARCH64_HBP_MAX_NUM)