]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/testsuite/
authorNathan Sidwell <nathan@codesourcery.com>
Fri, 9 Jun 2006 20:53:31 +0000 (20:53 +0000)
committerNathan Sidwell <nathan@codesourcery.com>
Fri, 9 Jun 2006 20:53:31 +0000 (20:53 +0000)
* gdb.base/recurse.exp: Add gdb,hardware_watchpoint target
info.  Adjust testing to cope with a single watchpoint.
* gdb.base/watchpoint.exp: Adjust expected string.

ChangeLog.csl
gdb/testsuite/gdb.base/recurse.exp
gdb/testsuite/gdb.base/watchpoint.exp

index dfc9048f318e0a8324b63f6d3ebe134d2d09a556..bf3c87b7f0363f366ecd88ab82dadce418b55dd0 100644 (file)
@@ -1,5 +1,10 @@
 2006-06-09  Nathan Sidwell  <nathan@codesourcery.com>
 
+       gdb/testsuite/
+       * gdb.base/recurse.exp: Add gdb,hardware_watchpoint target
+       info.  Adjust testing to cope with a single watchpoint.
+       * gdb.base/watchpoint.exp: Adjust expected string.
+
        gdb/testsuite/
        * gdb.base/cursal.exp: Run to main before setting listing
        size.
index bd1ecee60d95f1a7cc40e22128c0a6eb7af57aaa..3cd76d551c5258100738aac26db26395eca4ebce 100644 (file)
@@ -47,6 +47,10 @@ proc recurse_tests {} {
     if [target_info exists gdb,no_hardware_watchpoints] {
        gdb_test "set can-use-hw-watchpoints 0" "" ""
     }
+    set nwatch 99
+    if [target_info exists gdb,hardware_watchpoints] {
+       set nwatch [target_info gdb,hardware_watchpoints]
+    }
 
     if [runto recurse] then {
        # First we need to step over the assignment of b, so it has a known
@@ -78,14 +82,17 @@ proc recurse_tests {} {
        # First we need to step over the assignment of b, so it has a known
        # value.
        gdb_test "next" "if \\(a == 1\\)" "next over b = 0 in second instance"
-       gdb_test "watch b" ".*\[Ww\]atchpoint \[0-9]*: b" \
-           "set second instance watchpoint"
 
-       # Continue until initial set of b (second instance).
-       if [gdb_test "continue" \
-           "Continuing.*\[Ww\]atchpoint.*: b.*Old value = 0.*New value = 5.*"\
-           "continue to second instance watchpoint, first time"] then {
-       gdb_suppress_tests;
+       if { $nwatch > 1 } {
+           gdb_test "watch b" ".*\[Ww\]atchpoint \[0-9]*: b" \
+               "set second instance watchpoint"
+
+           # Continue until initial set of b (second instance).
+           if [gdb_test "continue" \
+                   "Continuing.*\[Ww\]atchpoint.*: b.*Old value = 0.*New value = 5.*"\
+                   "continue to second instance watchpoint, first time"] then {
+               gdb_suppress_tests;
+           }
        }
 
        # Continue inward for a few iterations
@@ -98,31 +105,33 @@ proc recurse_tests {} {
        gdb_test "continue" "Breakpoint.* recurse \\(a=1\\).*" \
            "continue to recurse (a = 1)"
 
-       # Continue until second set of b (second instance).
-       if [gdb_test "continue" \
-           "Continuing.*\[Ww\]atchpoint.*: b.*Old value = 5.*New value = 120.*return.*" \
-           "continue to second instance watchpoint, second time"] then { 
-           gdb_suppress_tests;
-       }
-
-       # Continue again.  We should have a watchpoint go out of scope now
-       if [gdb_test "continue" \
-           "Continuing.*\[Ww\]atchpoint.*deleted.*recurse \\(a=6\\) .*" \
-           "second instance watchpoint deleted when leaving scope"] then {
-           gdb_suppress_tests;
+       if { $nwatch  > 1 } {
+           # Continue until second set of b (second instance).
+           if [gdb_test "continue" \
+                   "Continuing.*\[Ww\]atchpoint.*: b.*Old value = 5.*New value = 120.*return.*" \
+                   "continue to second instance watchpoint, second time"] then { 
+               gdb_suppress_tests;
+           }
+
+           # Continue again.  We should have a watchpoint go out of scope now
+           if [gdb_test "continue" \
+                   "Continuing.*\[Ww\]atchpoint.*deleted.*recurse \\(a=6\\) .*" \
+                   "second instance watchpoint deleted when leaving scope"] then {
+               gdb_suppress_tests;
+           }
        }
-
+       
        # Continue until second set of b (first instance).
        # 24320 is allowed as the final value for b as that's the value
        # b would have on systems with 16bit integers.
        #
        # We could fix the test program to deal with this too.
        if [gdb_test "continue" \
-           "Continuing.*\[Ww\]atchpoint.*b.*Old value = 10.*New value = \(3628800|24320\).*return.*" \
-           "continue to first instance watchpoint, second time"] then {
+               "Continuing.*\[Ww\]atchpoint.*b.*Old value = 10.*New value = \(3628800|24320\).*return.*" \
+               "continue to first instance watchpoint, second time"] then {
            gdb_suppress_tests
        }
-
+       
        # Continue again.  We should have a watchpoint go out of scope now.
        #
        # The former version expected the test to return to main().
index a69271b0affa09e2030c36f891dc397ba686ebff..4e97d775fd9db0b5f0dc23e8b99a47cff684be9b 100644 (file)
@@ -120,7 +120,6 @@ proc initialize {} {
       return 0; 
     }
 
-
     return 1
 }
 
@@ -148,7 +147,7 @@ proc test_simple_watchpoint {} {
     gdb_run_cmd
     set timeout 600
     gdb_expect {
-       -re "Breakpoint 1, marker1 .*$gdb_prompt $" {
+       -re "Breakpoint 1, .*marker1 .*$gdb_prompt $" {
            pass "run to marker1 in test_simple_watchpoint"
        }
        -re ".*$gdb_prompt $" {
@@ -314,7 +313,7 @@ proc test_disabling_watchpoints {} {
     gdb_run_cmd
     set timeout 600
     gdb_expect {
-       -re "Breakpoint 1, marker1 .*$gdb_prompt $" {
+       -re "Breakpoint 1, .*marker1 .*$gdb_prompt $" {
            pass "run to marker1 in test_disabling_watchpoints"
        }
        -re ".*$gdb_prompt $" {