aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2012-06-18 17:28:38 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2012-06-18 17:28:38 +0000
commite2e4d78b2216962789c8a982d3e889ba6933321a (patch)
treecd9aa71e52f6bb308e2b82e5b23ec1949d043518 /gdb/infrun.c
parent09d5912c6f5be8d8935ff45941bf957209bd42a6 (diff)
downloadgdb-e2e4d78b2216962789c8a982d3e889ba6933321a.zip
gdb-e2e4d78b2216962789c8a982d3e889ba6933321a.tar.gz
gdb-e2e4d78b2216962789c8a982d3e889ba6933321a.tar.bz2
gdb/
Remove stale dummy frames. * breakpoint.c: Include dummy-frame.h. (longjmp_breakpoint_ops): New variable. (update_breakpoints_after_exec, breakpoint_init_inferior): Delete also bp_longjmp_call_dummy. (bpstat_what, bptype_string, print_one_breakpoint_location) (init_bp_location): Support bp_longjmp_call_dummy. (set_longjmp_breakpoint): Use longjmp_breakpoint_ops. Comment why. (set_longjmp_breakpoint_for_call_dummy) (check_longjmp_breakpoint_for_call_dummy, longjmp_bkpt_dtor): New functions. (initialize_breakpoint_ops): Initialize longjmp_breakpoint_ops. * breakpoint.h (enum bptype): New item bp_longjmp_call_dummy. Delete FIXME comment and extend the other comment for bp_call_dummy. (set_longjmp_breakpoint_for_call_dummy) (check_longjmp_breakpoint_for_call_dummy): New declarations. * dummy-frame.c: Include gdbthread.h. (pop_dummy_frame_bpt): New function. (pop_dummy_frame): Call pop_dummy_frame_bpt. (dummy_frame_discard): New function. (cleanup_dummy_frames): Update the comment about longjmps. * dummy-frame.h (dummy_frame_discard): New declaration. * gdbthread.h (struct thread_info): Extend initiating_frame comment. * infcall.c (call_function_by_hand): New variable longjmp_b. Call set_longjmp_breakpoint_for_call_dummy. Chain its breakpoints with BPT. * infrun.c (handle_inferior_event) <BPSTAT_WHAT_CLEAR_LONGJMP_RESUME>: Add case 4 comment. Call check_longjmp_breakpoint_for_call_dummy and keep_going if IS_LONGJMP and there is no other reason to stop. gdb/testsuite/ Remove stale dummy frames. * gdb.base/call-signal-resume.exp (maintenance print dummy-frames) (maintenance info breakpoints): New tests. * gdb.base/stale-infcall.c: New file. * gdb.base/stale-infcall.exp: New file.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 95a3ae9..53db335 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -4445,18 +4445,34 @@ process_event_stop_test:
3. The initiating frame exists and is different from the
current frame. This means the exception or longjmp has
been caught beneath the initiating frame, so keep
- going. */
+ going.
+
+ 4. longjmp breakpoint has been placed just to protect
+ against stale dummy frames and user is not interested in
+ stopping around longjmps. */
if (debug_infrun)
fprintf_unfiltered (gdb_stdlog,
"infrun: BPSTAT_WHAT_CLEAR_LONGJMP_RESUME\n");
- init_frame = frame_find_by_id (ecs->event_thread->initiating_frame);
-
gdb_assert (ecs->event_thread->control.exception_resume_breakpoint
!= NULL);
delete_exception_resume_breakpoint (ecs->event_thread);
+ if (what.is_longjmp)
+ {
+ check_longjmp_breakpoint_for_call_dummy (ecs->event_thread->num);
+
+ if (!frame_id_p (ecs->event_thread->initiating_frame))
+ {
+ /* Case 4. */
+ keep_going (ecs);
+ return;
+ }
+ }
+
+ init_frame = frame_find_by_id (ecs->event_thread->initiating_frame);
+
if (init_frame)
{
struct frame_id current_id