aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2014-08-12 09:14:08 +0800
committerYao Qi <yao@codesourcery.com>2014-08-19 21:31:36 +0800
commit13b448cdf796fdc4a92e37a6bc20ce785b7c65dd (patch)
treeec022f1d29df64e229823af8be236e233e51f1e5
parent817e0957a556d241be6f8c5e0e649ac53b1fb020 (diff)
downloadgdb-13b448cdf796fdc4a92e37a6bc20ce785b7c65dd.zip
gdb-13b448cdf796fdc4a92e37a6bc20ce785b7c65dd.tar.gz
gdb-13b448cdf796fdc4a92e37a6bc20ce785b7c65dd.tar.bz2
Set breakpoint on the right line
In gdb.base/watchpoint-hw-hit-once.exp, test scans source and set breakpoint on the line having "break-at-exit", gdb_breakpoint [gdb_get_line_number "break-at-exit"] However, in watchpoint-hw-hit-once.c, there are two lines having this key word: dummy = 1; /* Stub to catch break-at-exit after WATCHEE has been hit. */ dummy = 2; /* break-at-exit */ so the test sets breakpoint on the first one, while I think it is expected to set breakpoint on the second one, as far as I can tell from the comments in watchpoint-hw-hit-once.c: /* Stub lines are present as no breakpoints/watchpoint gets hit if current PC already stays on the line PC while entering "step"/"continue". */ This patch is to change the source matching pattern so that test can correctly set breakpoint on the right line. This patch fixes a fail we found on arm-none-eabi target. (gdb) PASS: gdb.base/watchpoint-hw-hit-once.exp: continue continue^M Continuing.^M ^M *** EXIT code 0^M [Inferior 1 (Remote target) exited normally]^M (gdb) FAIL: gdb.base/watchpoint-hw-hit-once.exp: continue to break-at-exit (the program exited) Run it again on x86_64-linux, no result changes. gdb/testsuite: 2014-08-19 Yao Qi <yao@codesourcery.com> * gdb.base/watchpoint-hw-hit-once.exp: Set breakpoint on the right line.
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp2
2 files changed, 6 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 29defab..060c7a1 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2014-08-19 Yao Qi <yao@codesourcery.com>
+
+ * gdb.base/watchpoint-hw-hit-once.exp: Set breakpoint on the
+ right line.
+
2014-08-18 David Blaikie <dblaikie@gmail.com>
* boards/fission.exp: Explicitly pass -ggnu-pubnames for clang.
diff --git a/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp b/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp
index 53de3d5..49c0d6a 100644
--- a/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp
@@ -29,7 +29,7 @@ if ![runto_main] {
gdb_test "rwatch watchee"
-gdb_breakpoint [gdb_get_line_number "break-at-exit"]
+gdb_breakpoint [gdb_get_line_number "dummy = 2"]
gdb_test "continue" "Continuing.\r\nHardware read watchpoint \[0-9\]+: watchee\r\n\r\nValue = 0\r\n.*"