aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.mi/mi2-watch.exp
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2007-09-14 17:21:29 +0000
committerMaciej W. Rozycki <macro@linux-mips.org>2007-09-14 17:21:29 +0000
commit5509918fe41a6057f55bed6038c847026cb47a99 (patch)
treefebcc4bd2d80f61a7416432674146d9b8f564ca8 /gdb/testsuite/gdb.mi/mi2-watch.exp
parent83a3a68b2bf12d3300a26bbbd9c2d8999b45f015 (diff)
downloadgdb-5509918fe41a6057f55bed6038c847026cb47a99.zip
gdb-5509918fe41a6057f55bed6038c847026cb47a99.tar.gz
gdb-5509918fe41a6057f55bed6038c847026cb47a99.tar.bz2
[mti-fix-scope]
* gdb.mi/mi-watch.exp (test_watchpoint_all): New function. Move all the tests here and run them twice, once using software watchpoints and once using hardware watchpoints. * gdb.mi/mi2-watch.exp (test_watchpoint_all): Likewise.
Diffstat (limited to 'gdb/testsuite/gdb.mi/mi2-watch.exp')
-rw-r--r--gdb/testsuite/gdb.mi/mi2-watch.exp50
1 files changed, 39 insertions, 11 deletions
diff --git a/gdb/testsuite/gdb.mi/mi2-watch.exp b/gdb/testsuite/gdb.mi/mi2-watch.exp
index f09aa97..938e6d6 100644
--- a/gdb/testsuite/gdb.mi/mi2-watch.exp
+++ b/gdb/testsuite/gdb.mi/mi2-watch.exp
@@ -41,10 +41,6 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
return -1
}
-mi_delete_breakpoints
-mi_gdb_reinitialize_dir $srcdir/$subdir
-mi_gdb_load ${binfile}
-
proc test_watchpoint_creation_and_listing {} {
global mi_gdb_prompt
global srcfile
@@ -167,16 +163,48 @@ proc test_watchpoint_triggering {} {
}
}
-# Disable hardware watchpoints if necessary.
+proc test_watchpoint_all {type} {
+ global pf_prefix
+ upvar srcdir srcdir
+ upvar subdir subdir
+ upvar binfile binfile
+
+ set old_prefix $pf_prefix
+ lappend pf_prefix "$type:"
+
+ mi_delete_breakpoints
+ mi_gdb_reinitialize_dir $srcdir/$subdir
+ mi_gdb_load ${binfile}
+
+ mi_runto callee4
+ test_watchpoint_creation_and_listing
+ #test_rwatch_creation_and_listing
+ #test_awatch_creation_and_listing
+ test_watchpoint_triggering
+
+ set pf_prefix $old_prefix
+}
+
+# Run the tests twice, once using software watchpoints...
+mi_gdb_test "567-gdb-set can-use-hw-watchpoints 0" \
+ "567\\^done" \
+ "hw watchpoints toggle (1)"
+test_watchpoint_all sw
+
+mi_gdb_exit
+
+# ... and unless requested otherwise...
if [target_info exists gdb,no_hardware_watchpoints] {
- mi_gdb_test "-gdb-set can-use-hw-watchpoints 0" "\\^done" ""
+ return 0
}
-mi_runto callee4
-test_watchpoint_creation_and_listing
-#test_rwatch_creation_and_listing
-#test_awatch_creation_and_listing
-test_watchpoint_triggering
+mi_gdb_start
+
+# ... once using hardware watchpoints (if available).
+mi_gdb_test "890-gdb-set can-use-hw-watchpoints 1" \
+ "890\\^done" \
+ "hw watchpoints toggle (2)"
+test_watchpoint_all hw
mi_gdb_exit
return 0