From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4911 invoked by alias); 9 Jun 2006 20:58:54 -0000 Received: (qmail 4893 invoked by uid 22791); 9 Jun 2006 20:58:51 -0000 X-Spam-Check-By: sourceware.org Received: from potter.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 09 Jun 2006 20:58:13 +0000 Received: (qmail 18699 invoked from network); 9 Jun 2006 20:58:11 -0000 Received: from unknown (HELO ?192.168.189.148?) (nathan@127.0.0.2) by mail.codesourcery.com with ESMTPA; 9 Jun 2006 20:58:11 -0000 Message-ID: <4489E0D8.2000702@codesourcery.com> Date: Fri, 09 Jun 2006 20:58:00 -0000 From: Nathan Sidwell User-Agent: Thunderbird 1.5.0.2 (X11/20060522) MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: adjust watchpoint testing Content-Type: multipart/mixed; boundary="------------000704040808020300030108" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-06/txt/msg00114.txt.bz2 This is a multi-part message in MIME format. --------------000704040808020300030108 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 475 the recurse.exp test presume there are at least two hardware watchpoints. This patch adds a gdb,hardware_watchpoint target info variable and adjust the test to only test where two watchpoints are used, if they exist on the target. I found it necessary to adjust the watchpoint.exp expected reply too. ok? nathan -- Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk --------------000704040808020300030108 Content-Type: text/x-patch; name="test-watch.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="test-watch.patch" Content-length: 6357 2006-06-09 Nathan Sidwell 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. Index: gdb/testsuite/gdb.base/recurse.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/recurse.exp,v retrieving revision 1.5 diff -c -3 -p -r1.5 recurse.exp *** gdb/testsuite/gdb.base/recurse.exp 19 Sep 2001 08:21:17 -0000 1.5 --- gdb/testsuite/gdb.base/recurse.exp 9 Jun 2006 20:50:09 -0000 *************** proc recurse_tests {} { *** 47,52 **** --- 47,56 ---- 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 *************** proc recurse_tests {} { *** 78,91 **** # 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; } # Continue inward for a few iterations --- 82,98 ---- # 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" ! 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 *************** proc recurse_tests {} { *** 98,128 **** 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; ! } ! # 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 { 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(). --- 105,137 ---- gdb_test "continue" "Breakpoint.* recurse \\(a=1\\).*" \ "continue to recurse (a = 1)" ! 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 { 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: gdb/testsuite/gdb.base/watchpoint.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/watchpoint.exp,v retrieving revision 1.11 diff -c -3 -p -r1.11 watchpoint.exp *** gdb/testsuite/gdb.base/watchpoint.exp 22 Mar 2004 14:24:18 -0000 1.11 --- gdb/testsuite/gdb.base/watchpoint.exp 9 Jun 2006 20:50:10 -0000 *************** proc initialize {} { *** 120,126 **** return 0; } - return 1 } --- 120,125 ---- *************** proc test_simple_watchpoint {} { *** 148,154 **** gdb_run_cmd set timeout 600 gdb_expect { ! -re "Breakpoint 1, marker1 .*$gdb_prompt $" { pass "run to marker1 in test_simple_watchpoint" } -re ".*$gdb_prompt $" { --- 147,153 ---- gdb_run_cmd set timeout 600 gdb_expect { ! -re "Breakpoint 1, .*marker1 .*$gdb_prompt $" { pass "run to marker1 in test_simple_watchpoint" } -re ".*$gdb_prompt $" { *************** proc test_disabling_watchpoints {} { *** 314,320 **** gdb_run_cmd set timeout 600 gdb_expect { ! -re "Breakpoint 1, marker1 .*$gdb_prompt $" { pass "run to marker1 in test_disabling_watchpoints" } -re ".*$gdb_prompt $" { --- 313,319 ---- gdb_run_cmd set timeout 600 gdb_expect { ! -re "Breakpoint 1, .*marker1 .*$gdb_prompt $" { pass "run to marker1 in test_disabling_watchpoints" } -re ".*$gdb_prompt $" { --------------000704040808020300030108--