From: David Carlton <carlton@math.stanford.edu>
To: gdb-patches@sources.redhat.com
Subject: [rfa/testsuite] Add test for PR gdb/38
Date: Mon, 17 Mar 2003 18:35:00 -0000 [thread overview]
Message-ID: <ro1bs09g7so.fsf@jackfruit.Stanford.EDU> (raw)
This patch adds a KFAILed test for PR gdb/38. That PR is about
watchpoints set at the same location as breakpoints, which can cause
the watchpoint to get triggered late. Right now, the only testsuite
case that tests this is in gdb.c++/annota2.exp, which is bad because
it has nothing to do with C++, nothing to do with annotation, and
because level 2 annotation is on its way out. So I'd like to get the
bug recorded in a more correct location.
Tested on i686-pc-linux-gnu, GCC 3.1, DWARF 2. I haven't been able to
test the pass branch, because it reliably fails on this platform, but
I did try to be careful with the pass regexp.
OK to commit?
David Carlton
carlton@math.stanford.edu
2003-03-17 David Carlton <carlton@math.stanford.edu>
* gdb.base/watchpoint.exp (test_watchpoint_and_breakpoint): New
test, for PR breakpoints/38.
Call test_watchpoint_and_breakpoint.
* gdb.base/watchpoint.c (func3): New function.
(main): Call func3.
Index: watchpoint.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/watchpoint.exp,v
retrieving revision 1.7
diff -u -p -r1.7 watchpoint.exp
--- watchpoint.exp 4 Feb 2003 22:49:19 -0000 1.7
+++ watchpoint.exp 17 Mar 2003 18:29:11 -0000
@@ -648,6 +648,27 @@ proc test_complex_watchpoint {} {
}
}
+proc test_watchpoint_and_breakpoint {} {
+ global gdb_prompt
+
+ # This is a test for PR gdb/38, which involves setting a
+ # watchpoint right after you've reached a breakpoint.
+
+ if [runto func3] then {
+ gdb_breakpoint [gdb_get_line_number "second x assignment"]
+ gdb_continue_to_breakpoint "second x assignment"
+ gdb_test "watch x" ".*atchpoint \[0-9\]+: x"
+ gdb_test_multiple "next" "next after watch x" {
+ -re ".*atchpoint \[0-9\]+: x\r\n\r\nOld value = 0\r\nNew value = 1\r\n.*$gdb_prompt $" {
+ pass "next after watch x"
+ }
+ -re "\[0-9\]+\[\t \]+y = 1;\r\n$gdb_prompt $" {
+ kfail "gdb/38" "next after watch x"
+ }
+ }
+ }
+}
+
# Start with a fresh gdb.
gdb_exit
@@ -799,6 +820,17 @@ if [initialize] then {
timeout {fail "(timeout) access watches disallowed"}
}
}
+
+ # See above.
+ if [istarget "mips-idt-*"] then {
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+ initialize
+ }
+
+ test_watchpoint_and_breakpoint
}
# Restore old timeout
Index: watchpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/watchpoint.c,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 watchpoint.c
--- watchpoint.c 28 Jun 1999 16:04:22 -0000 1.1.1.2
+++ watchpoint.c 17 Mar 2003 18:29:07 -0000
@@ -83,6 +83,18 @@ func2 ()
static_b = local_a;
}
+void
+func3 ()
+{
+ int x;
+ int y;
+
+ x = 0;
+ x = 1; /* second x assignment */
+ y = 1;
+ y = 2;
+}
+
int
func1 ()
{
@@ -170,5 +182,8 @@ int main ()
recurser (2);
marker6 ();
+
+ func3 ();
+
return 0;
}
next reply other threads:[~2003-03-17 18:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-17 18:35 David Carlton [this message]
2003-03-17 19:42 ` Daniel Jacobowitz
2003-03-17 19:52 ` David Carlton
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=ro1bs09g7so.fsf@jackfruit.Stanford.EDU \
--to=carlton@math.stanford.edu \
--cc=gdb-patches@sources.redhat.com \
/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