aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-09-19 08:21:17 +0000
committerCorinna Vinschen <corinna@vinschen.de>2001-09-19 08:21:17 +0000
commitf3bcedc1a926796552d8932ab92ccd6632cd2dcf (patch)
treeb577917009b1044bde35235099593c955f7e4a72 /gdb/testsuite
parent44addf7f7b077fb7e9d32527ff75088b486fcad3 (diff)
downloadgdb-f3bcedc1a926796552d8932ab92ccd6632cd2dcf.zip
gdb-f3bcedc1a926796552d8932ab92ccd6632cd2dcf.tar.gz
gdb-f3bcedc1a926796552d8932ab92ccd6632cd2dcf.tar.bz2
* gdb.base/recurse.exp: When checking leaving the watchpoint
scope, recognize when gdb is in function's epilogue and pass.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.base/recurse.exp25
2 files changed, 28 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 48ba2f0..679fdf2 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2001-09-19 Corinna Vinschen <vinschen@redhat.com>
+
+ * gdb.base/recurse.exp: When checking leaving the watchpoint
+ scope, recognize when gdb is in function's epilogue and pass.
+
2001-09-18 Keith Seitz <keiths@redhat.com>
* lib/insight-support.exp (_gdbtk_export_target_info): Add
diff --git a/gdb/testsuite/gdb.base/recurse.exp b/gdb/testsuite/gdb.base/recurse.exp
index 957f949..bd1ecee 100644
--- a/gdb/testsuite/gdb.base/recurse.exp
+++ b/gdb/testsuite/gdb.base/recurse.exp
@@ -123,9 +123,30 @@ proc recurse_tests {} {
gdb_suppress_tests
}
- # Continue again. We should have a watchpoint go out of scope now
+ # Continue again. We should have a watchpoint go out of scope now.
+ #
+ # The former version expected the test to return to main().
+ # Now it expects the test to return to main or to stop in the
+ # function's epilogue.
+ #
+ # The problem is that gdb needs to (but doesn't) understand
+ # function epilogues in the same way as for prologues.
+ #
+ # If there is no hardware watchpoint (such as a x86 debug register),
+ # then watchpoints are done "the hard way" by single-stepping the
+ # target until the value of the watched variable changes. If you
+ # are single-stepping, you will eventually step into an epilogue.
+ # When you do that, the "top" stack frame may become partially
+ # deconstructed (as when you pop the frame pointer, for instance),
+ # and from that point on, GDB can no longer make sense of the stack.
+ #
+ # A test which stops in the epilogue is trying to determine when GDB
+ # leaves the stack frame in which the watchpoint was created. It does
+ # this basically by watching for the frame pointer to change. When
+ # the frame pointer changes, the test expects to be back in main, but
+ # instead it is still in the epilogue of the callee.
if [gdb_test "continue" \
- "Continuing.*\[Ww\]atchpoint.*deleted.*main \\(\\) .*" \
+ "Continuing.*\[Ww\]atchpoint.*deleted.*\(main \\(\\) \|21.*\}\).*" \
"first instance watchpoint deleted when leaving scope"] then {
gdb_suppress_tests;
}