From c12260ac385cffb6c60330b62a789a4fad9f52a1 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 6 Nov 2001 11:02:12 +0000 Subject: * 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. --- gdb/breakpoint.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gdb/breakpoint.c') diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 310d2d6f4f7..848a07fe0ae 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 -- cgit v1.2.1