* gdb.base/watch_thread_num.exp: Don't run tests that require
authorNathan Froyd <froydnj@codesourcery.com>
Tue, 13 May 2008 21:17:18 +0000 (21:17 +0000)
committerNathan Froyd <froydnj@codesourcery.com>
Tue, 13 May 2008 21:17:18 +0000 (21:17 +0000)
watchpoints if the target doesn't support them.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/watch_thread_num.exp

index f9589806fa9ea5ac91828439d21fc355c78d2d35..e184e02c71efdf1da096369d518fd5de4cb2984e 100644 (file)
@@ -1,3 +1,8 @@
+2008-05-13  Nathan Froyd  <froydnj@codesourcery.com>
+
+       * gdb.base/watch_thread_num.exp: Don't run tests that require
+       watchpoints if the target doesn't support them.
+
 2008-05-12  Doug Evans  <dje@google.com>
 
        * lib/gdbserver-support.exp (find_gdbserver): Use $GDBSERVER if set.
index 4d34d72e178540612f298127b48a7742c5680993..be8ed48b64978889fed3d4bab3cb186cef2c592e 100644 (file)
@@ -71,9 +71,15 @@ gdb_test "watch shared_var thread $thread_num" "Hardware watchpoint 3: shared_va
 gdb_test "info breakpoint 3" "stop only in thread $thread_num"
 
 for {set i 1} {$i <= 10} {incr i 1} {
-gdb_test "continue" "Hardware watchpoint 3: shared_var.*" \
-  "Watchpoint triggered iteration $i"
-gdb_test "thread" ".*Current thread is $thread_num .*" \
-  "Check thread that triggered iteration $i"
+    set watchpoint "Watchpoint triggered iteration $i"
+    set check "Check thread that triggered iteration $i"
+
+    if {[target_info exists gdb,no_hardware_watchpoints]} {
+        unsupported $watchpoint
+        unsupported $check
+    } else {
+        gdb_test "continue" "Hardware watchpoint 3: shared_var.*" $watchpoint
+        gdb_test "thread" ".*Current thread is $thread_num .*" $check
+    }
 }