From: Nathan Sidwell <nathan@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: adjust watchpoint testing
Date: Fri, 09 Jun 2006 20:58:00 -0000 [thread overview]
Message-ID: <4489E0D8.2000702@codesourcery.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 475 bytes --]
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
[-- Attachment #2: test-watch.patch --]
[-- Type: text/x-patch, Size: 6357 bytes --]
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.
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 $" {
next reply other threads:[~2006-06-09 20:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-09 20:58 Nathan Sidwell [this message]
2006-06-12 16:30 ` Wu Zhou
2006-06-12 16:40 ` Nathan Sidwell
2006-06-13 6:12 ` Wu Zhou
2006-06-13 6:23 ` Nathan Sidwell
2006-06-13 6:43 ` Wu Zhou
2006-06-13 7:07 ` Nathan Sidwell
2006-06-13 10:20 ` Wu Zhou
2006-06-13 10:25 ` Nathan Sidwell
2006-06-13 17:30 ` Eli Zaretskii
2006-06-14 1:21 ` Wu Zhou
2006-06-14 2:52 ` Daniel Jacobowitz
2006-06-14 3:32 ` Eli Zaretskii
2006-06-13 13:11 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4489E0D8.2000702@codesourcery.com \
--to=nathan@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox