public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb/testsuite: Run test when software watchpoints are used
@ 2018-07-04 16:40 Andrew Burgess
  2018-07-06  2:53 ` Simon Marchi
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Burgess @ 2018-07-04 16:40 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

The test gdb.base/watchpoint-reuse-slot.exp can be run when software
watchpoints are in use, we just need to update one test pattern to
look for 'Watchpoint' instead of 'Hardware watchpoint' in one case.

gdb/testsuite/ChangeLog:

	* gdb.base/watchpoint-reuse-slot.exp: Test can be run using
	software watchpoints, we just need to update a test pattern in one
	place.
---
 gdb/testsuite/ChangeLog                          |  6 ++++++
 gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp | 14 ++++++++------
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
index f196b89eab..445c350ef2 100644
--- a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
@@ -22,11 +22,6 @@
 # operation.  (Note that we don't have any of these watchpoints
 # trigger.)
 
-if [target_info exists gdb,no_hardware_watchpoints] {
-    unsupported "no target support"
-    return
-}
-
 standard_testfile
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
@@ -193,8 +188,15 @@ proc watch_command {cmd base offset width} {
 	gdb_test "hbreak $expr" "Hardware assisted breakpoint \[0-9\]+ at $hex"
     } elseif {$cmd == "watch"} {
 	set expr "*(buf.byte + $base + $offset)@$width"
+
+	if [target_info exists gdb,no_hardware_watchpoints] {
+	    set wp_prefix "Watchpoint"
+	} else {
+	    set wp_prefix "Hardware watchpoint"
+	}
+
 	gdb_test "$cmd $expr" \
-	    "Hardware watchpoint \[0-9\]+: [string_to_regexp $expr]"
+	    "${wp_prefix} \[0-9\]+: [string_to_regexp $expr]"
     } elseif {$cmd == "awatch"} {
 	set expr "*(buf.byte + $base + $offset)@$width"
 	gdb_test "$cmd $expr" \
-- 
2.14.4

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

end of thread, other threads:[~2018-10-31 13:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-04 16:40 [PATCH] gdb/testsuite: Run test when software watchpoints are used Andrew Burgess
2018-07-06  2:53 ` Simon Marchi
2018-07-06 13:59   ` Andrew Burgess
2018-07-06 14:43     ` Simon Marchi
2018-07-06 23:21       ` Andrew Burgess
2018-07-07  0:47         ` Simon Marchi
2018-07-10 14:01           ` Andrew Burgess
2018-10-31 13:52             ` Phil Muldoon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).