daily update
[external/binutils.git] / gdb / testsuite / gdb.base / watchpoints.exp
index 7abe14b..4779764 100644 (file)
@@ -1,5 +1,4 @@
-# Copyright 2009
-# Free Software Foundation, Inc.
+# Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -20,8 +19,6 @@ if $tracelevel then {
     strace $tracelevel
 }
 
-set prms_id 0
-set bug_id 0
 
 set testfile "watchpoints"
 set srcfile ${testfile}.c
@@ -45,10 +42,16 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load $binfile
 
+    # Disable hardware watchpoints if necessary.
+    if [target_info exists gdb,no_hardware_watchpoints] {
+        gdb_test_no_output "set can-use-hw-watchpoints 0" ""
+    }
+
     runto_main
-    gdb_test "watch ival1" "" ""
-    gdb_test "watch ival3" "" ""
+    gdb_test "watch ival1" ".*" ""
+    gdb_test "watch ival3" ".*" ""
 
+    set prev_timeout $timeout
     set timeout 600
 
     gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival1.*Old value = -1.*New value = 0.*ival1 = count; ival2 = count;.*" "watchpoint hit, first time"
@@ -76,7 +79,7 @@ gdb_load $binfile
     # Check that the hit count is reported correctly
     gdb_test "info break" ".*watchpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+ival1\r\n\[ \t]+breakpoint already hit 3 times.*" "Watchpoint ival1 hit count is 3"
     # Disable ival1 watchpoint
-    gdb_test "disable 2" "" ""
+    gdb_test_no_output "disable 2" ""
  
     # Continue until the next change, from 1 to 2.
     gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = 1.*New value = 2.*ival3 = count; ival4 = count;.*" "watchpoint hit, third time"
@@ -98,4 +101,4 @@ gdb_load $binfile
     # Check that the hit count is reported correctly
     gdb_test "info break" ".*watchpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+ival3\r\n\[ \t]+breakpoint already hit 5 times.*" "Watchpoint hit count is 5"
 
-   
+set timeout $prev_timeout