aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-11-06 11:02:12 +0000
committerCorinna Vinschen <corinna@vinschen.de>2001-11-06 11:02:12 +0000
commitc12260ac385cffb6c60330b62a789a4fad9f52a1 (patch)
tree5ffbe71a86f4cb4f586708895cb14e10e224c76c /gdb/breakpoint.c
parent9e5abb068c86f04dcdd5ca82068caad4785c3a85 (diff)
downloadgdb-c12260ac385cffb6c60330b62a789a4fad9f52a1.zip
gdb-c12260ac385cffb6c60330b62a789a4fad9f52a1.tar.gz
gdb-c12260ac385cffb6c60330b62a789a4fad9f52a1.tar.bz2
* arch-utils.c (generic_in_function_epilogue_p): New function.
* arch-utils.h (generic_in_function_epilogue_p): Declare extern. * breakpoint.c (watchpoint_check): Add test whether the pc is currently in the epilogue of a function. * gdbarch.c: Autogenerated from gdbarch.sh. * gdbarch.h: Ditto. * gdbarch.sh (function_list): Add `in_function_epilogue_p' definition.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 310d2d6..848a07f 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -2308,6 +2308,14 @@ watchpoint_check (PTR p)
reinit_frame_cache ();
fr = find_frame_addr_in_frame_chain (b->watchpoint_frame);
within_current_scope = (fr != NULL);
+ /* in_function_epilogue_p() returns a non-zero value if we're still
+ in the function but the stack frame has already been invalidated.
+ Since we can't rely on the values of local variables after the
+ stack has been destroyed, we are treating the watchpoint in that
+ state as `not changed' without further checking. */
+ if (within_current_scope && fr == get_current_frame ()
+ && gdbarch_in_function_epilogue_p (current_gdbarch, read_pc ()))
+ return WP_VALUE_NOT_CHANGED;
if (within_current_scope)
/* If we end up stopping, the current frame will get selected
in normal_stop. So this call to select_frame won't affect