diff --git a/gdb-aarch64-v81-hwbreakpoints.diff b/gdb-aarch64-v81-hwbreakpoints.diff new file mode 100644 index 0000000..f4d8c85 --- /dev/null +++ b/gdb-aarch64-v81-hwbreakpoints.diff @@ -0,0 +1,65 @@ +From: Andrew Pinski +Date: Sat, 23 Jul 2016 16:56:44 +0000 (-0700) +Subject: Fix ARMv8.1/v8.2 for hw watchpoint and breakpoint +X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=49ecef2a7da2ee9df4ae675f99b70518fbf1bb23 + +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 +--- + +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: + diff --git a/gdb.changes b/gdb.changes index 5be4cd7..bb5f8c6 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Aug 3 14:38:49 UTC 2016 - matz@suse.com + +- Add gdb-aarch64-v81-hwbreakpoints.diff for detecting + debug capabilities on ARMv8.1/8.2. [bnc#990697] + ------------------------------------------------------------------- Mon Jun 20 16:36:04 UTC 2016 - matz@suse.com diff --git a/gdb.spec b/gdb.spec index bd93087..120ac03 100644 --- a/gdb.spec +++ b/gdb.spec @@ -221,6 +221,7 @@ Patch1002: gdb-6.6-buildid-locate-rpm-suse.patch Patch1003: gdb-pahole-python2.patch Patch1004: gdb-fix-buf-overflow.diff Patch1005: gdb-7.10-swo18929.patch +Patch1006: gdb-aarch64-v81-hwbreakpoints.diff BuildRequires: bison BuildRequires: flex @@ -492,6 +493,7 @@ find -name "*.info*"|xargs rm -f %patch1003 -p1 %patch1004 -p1 %patch1005 -p1 +%patch1006 -p1 find -name "*.orig" | xargs rm -f ! find -name "*.rej" # Should not happen.