aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-01-19 20:31:38 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-01-19 20:31:38 +0000
commita0f49112e606aaf0ce3926cfb9873265418ddaff (patch)
tree37540b916d53d1af75917a1cd6094302d0322a4d /gdb/breakpoint.c
parentceeb3d5ab68a5e0a904ab7a5812781fe2bd082ce (diff)
downloadgdb-a0f49112e606aaf0ce3926cfb9873265418ddaff.zip
gdb-a0f49112e606aaf0ce3926cfb9873265418ddaff.tar.gz
gdb-a0f49112e606aaf0ce3926cfb9873265418ddaff.tar.bz2
gdb/
* breakpoint.c (watchpoint_check): Check the call gdbarch_in_function_epilogue_p before calling frame_find_by_id. Extend the comment. * config/djgpp/fnchange.lst: Add translations for watchpoint-cond-gone.exp, watchpoint-cond-gone.c and watchpoint-cond-gone-stripped.c. gdb/testsuite/ * gdb.base/watchpoint-cond-gone.exp, gdb.base/watchpoint-cond-gone.c, gdb.base/watchpoint-cond-gone-stripped.c: New.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 61c6743..d404ee7 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -3217,6 +3217,17 @@ watchpoint_check (void *p)
struct gdbarch *frame_arch = get_frame_arch (frame);
CORE_ADDR frame_pc = get_frame_pc (frame);
+ /* 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. Don't mark
+ watchpoints as changed if the current frame is in an epilogue -
+ even if they are in some other frame, our view of the stack
+ is likely to be wrong and frame_find_by_id could error out. */
+ if (gdbarch_in_function_epilogue_p (frame_arch, frame_pc))
+ return WP_VALUE_NOT_CHANGED;
+
fr = frame_find_by_id (b->watchpoint_frame);
within_current_scope = (fr != NULL);
@@ -3233,17 +3244,6 @@ watchpoint_check (void *p)
within_current_scope = 0;
}
- /* 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. Don't mark
- watchpoints as changed if the current frame is in an epilogue -
- even if they are in some other frame, our view of the stack
- is likely to be wrong. */
- if (gdbarch_in_function_epilogue_p (frame_arch, frame_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