Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] watchpoint-reuse-slot.exp: skip some tests on targets have different wp and bp registers
@ 2015-03-13 14:41 Yao Qi
  2015-03-13 14:41 ` [PATCH 2/2] watchpoint-reuse-slot.exp: skip when requesting two breakpoints in one slot on aarch64 Yao Qi
  2015-03-16 12:35 ` [PATCH 1/2] watchpoint-reuse-slot.exp: skip some tests on targets have different wp and bp registers Pedro Alves
  0 siblings, 2 replies; 10+ messages in thread
From: Yao Qi @ 2015-03-13 14:41 UTC (permalink / raw)
  To: gdb-patches

From: Yao Qi <yao.qi@linaro.org>

watchpoint-reuse-slot.exp sets two hardware breakpoint and/or watchpoint,
to test the same debugging register can be used correctly.  However,
on some targets, such as arm and aarch64, hardware has different
registers for breakpoint and watchpoint, so don't have to do test
if one breakpoint and one watchpoint are requested and target hardware
has different debugging registers for breakpoint and watchpoint.

gdb/testsuite:

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

	* gdb.base/watchpoint-reuse-slot.exp (dbg_registers_for_watch_and_break):
	New proc.
	(top level): Skip tests if breakpoint and watchpoint are
	requested and dbg_registers_for_watch_and_break returns false.
---
 gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
index 844bf3a..df6eeb6 100644
--- a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
@@ -157,6 +157,19 @@ proc watch_command {cmd base offset width} {
     }
 }
 
+# Return true if the same debugging register can be used for both
+# watchpoint and breakpoint.
+
+proc dbg_registers_for_watch_and_break {} {
+    if { [istarget "arm*-linux*"] || [istarget "aarch64*-*-linux*"] } {
+	# arm and aarch64 has different registers for watchpoint and
+	# breakpoint.
+	return 0
+    }
+
+    return 1
+}
+
 # Run test proper.  See intro for description.
 
 foreach always_inserted {"off" "on" } {
@@ -171,6 +184,16 @@ foreach always_inserted {"off" "on" } {
 		    continue
 		}
 
+		if {($cmd1 == "hbreak" && $cmd2 != "hbreak"
+		     || $cmd1 != "hbreak" && $cmd2 == "hbreak")
+		    && ![dbg_registers_for_watch_and_break]} {
+		    # One breakpoint and watchpoint is requested, but
+		    # different registers are used for breakpoint and
+		    # watchpoint, then, the same slot can't be reused.
+		    # Skip it.
+		    continue
+		}
+
 		for {set x 0} {$x < 4} {incr x} {
 		    set prefix "always-inserted $always_inserted: "
 		    append prefix "$cmd1 x $cmd2: "
-- 
1.9.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-03-16 17:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-13 14:41 [PATCH 1/2] watchpoint-reuse-slot.exp: skip some tests on targets have different wp and bp registers Yao Qi
2015-03-13 14:41 ` [PATCH 2/2] watchpoint-reuse-slot.exp: skip when requesting two breakpoints in one slot on aarch64 Yao Qi
2015-03-16 12:35   ` Pedro Alves
2015-03-16 14:10     ` Yao Qi
2015-03-16 12:35 ` [PATCH 1/2] watchpoint-reuse-slot.exp: skip some tests on targets have different wp and bp registers Pedro Alves
2015-03-16 14:01   ` Yao Qi
2015-03-16 15:23     ` Pedro Alves
2015-03-16 16:37       ` Yao Qi
2015-03-16 16:55         ` Pedro Alves
2015-03-16 17:34           ` Yao Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox