From f3bcedc1a926796552d8932ab92ccd6632cd2dcf Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 19 Sep 2001 08:21:17 +0000 Subject: [PATCH] * gdb.base/recurse.exp: When checking leaving the watchpoint scope, recognize when gdb is in function's epilogue and pass. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.base/recurse.exp | 25 +++++++++++++++++++++++-- 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 + + * 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 * 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; } -- 2.7.4