[2/2] watchpoint-reuse-slot.exp: skip when requesting two breakpoints in one slot on aarch64

Message ID 1426257692-30461-2-git-send-email-qiyaoltc@gmail.com
State New
Headers show

Commit Message

Yao Qi March 13, 2015, 2:41 p.m.
From: Yao Qi <yao.qi@linaro.org>

watchpoint-reuse-slot.exp sets two hardware breakpoints in contiguous
address to reuse one debug register.  However, requested address for
breakpoint should be 4-byte aligned on aarch64, so it is impossible
to request two hardware breakpoints and use one debug register.  This
patch is to skip the test in the case on aarch64-linux.  Since arm
has Thumb mode, in which instruction address can be 2-byte aligned,
more thoughts are needed for arm in my next step.

gdb/testsuite:

2015-03-13  Yao Qi  <yao.qi@linaro.org>

	* gdb.base/watchpoint-reuse-slot.exp: Skip tests when two
	breakpoints are requested on aarch64-linux.
---
 gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
index df6eeb6..c646f22 100644
--- a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
@@ -178,10 +178,18 @@  foreach always_inserted {"off" "on" } {
 	foreach cmd2 $cmds {
 	    for {set width 1} {$width < 4} {incr width} {
 
-		if {$cmd1 == "hbreak" && $cmd2 == "hbreak" && $width > 1} {
-		    # hbreak ignores WIDTH, no use testing more than
-		    # once.
-		    continue
+		if {$cmd1 == "hbreak" && $cmd2 == "hbreak"} {
+		    if {$width > 1} {
+			# hbreak ignores WIDTH, no use testing more than
+			# once.
+			continue
+		    }
+
+		    if { [istarget "aarch64*-*-linux*"] } {
+			# The address for breakpoint should be 4-byte
+			# aligned, so can't reuse slot.
+			continue
+		    }
 		}
 
 		if {($cmd1 == "hbreak" && $cmd2 != "hbreak"