diff options
author | Pedro Alves <palves@redhat.com> | 2008-09-08 21:48:52 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2008-09-08 21:48:52 +0000 |
commit | 32400bebb23653900ef060aae37668a2a1961155 (patch) | |
tree | 9b74d3a143584431a3999f0f54833aeb8cdea0b7 /gdb/infrun.c | |
parent | 347bddb745acda8fb591511a547e66bbe00d768b (diff) | |
download | gdb-32400bebb23653900ef060aae37668a2a1961155.zip gdb-32400bebb23653900ef060aae37668a2a1961155.tar.gz gdb-32400bebb23653900ef060aae37668a2a1961155.tar.bz2 |
* gdbthread.h (struct thread_info): Add comments around
proceed_to_finish.
(save_infrun_state, load_infrun_state): Remove proceed_to_finish
argument.
* thread.c (load_infrun_state, save_infrun_state): Delete
proceed_to_finish argument and references to it.
* infcall.c (call_function_by_hand): Adjust.
* infcmd.c (finish_command): Adjust.
* infrun.c (proceed_to_finish): Delete.
(clear_proceed_status): Adjust.
(context_switch): Don't context-switch proceed_to_finish.
(normal_stop, save_inferior_status, restore_inferior_status):
Adjust.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r-- | gdb/infrun.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c index 560722f..4e28c22 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -237,11 +237,6 @@ int stop_after_trap; enum stop_kind stop_soon; -/* Nonzero if proceed is being used for a "finish" command or a similar - situation when stop_registers should be saved. */ - -int proceed_to_finish; - /* Save register contents here when about to pop a stack dummy frame, if-and-only-if proceed_to_finish is set. Thus this contains the return value from the called function (assuming @@ -1105,6 +1100,9 @@ clear_proceed_status (void) tp->step_range_end = 0; tp->step_frame_id = null_frame_id; tp->step_over_calls = STEP_OVER_UNDEBUGGABLE; + + tp->proceed_to_finish = 0; + /* Discard any remaining commands or status from previous stop. */ bpstat_clear (&tp->stop_bpstat); @@ -1112,7 +1110,6 @@ clear_proceed_status (void) stop_after_trap = 0; stop_soon = NO_STOP_QUIETLY; - proceed_to_finish = 0; breakpoint_proceeded = 1; /* We're about to proceed... */ if (stop_registers) @@ -1714,7 +1711,6 @@ context_switch (ptid_t ptid) /* Save infrun state for the old thread. */ save_infrun_state (inferior_ptid, cmd_continuation, intermediate_continuation, - proceed_to_finish, stop_step, step_multi, stop_signal); @@ -1722,7 +1718,6 @@ context_switch (ptid_t ptid) /* Load infrun state for the new thread. */ load_infrun_state (ptid, &cmd_continuation, &intermediate_continuation, - &proceed_to_finish, &stop_step, &step_multi, &stop_signal); @@ -3807,6 +3802,10 @@ Further execution is probably impossible.\n")); goto done; } + if (last.kind == TARGET_WAITKIND_SIGNALLED + || last.kind == TARGET_WAITKIND_EXITED) + goto done; + /* Select innermost stack frame - i.e., current frame is frame 0, and current location is based on that. Don't do this on return from a stack dummy routine, @@ -3904,7 +3903,7 @@ Further execution is probably impossible.\n")); /* Save the function value return registers, if we care. We might be about to restore their previous contents. */ - if (proceed_to_finish) + if (inferior_thread ()->proceed_to_finish) { /* This should not be necessary. */ if (stop_registers) @@ -4387,7 +4386,7 @@ save_inferior_status (int restore_stack_info) tp->stop_bpstat = bpstat_copy (tp->stop_bpstat); inf_status->breakpoint_proceeded = breakpoint_proceeded; inf_status->restore_stack_info = restore_stack_info; - inf_status->proceed_to_finish = proceed_to_finish; + inf_status->proceed_to_finish = tp->proceed_to_finish; inf_status->registers = regcache_dup (get_current_regcache ()); @@ -4436,7 +4435,7 @@ restore_inferior_status (struct inferior_status *inf_status) bpstat_clear (&tp->stop_bpstat); tp->stop_bpstat = inf_status->stop_bpstat; breakpoint_proceeded = inf_status->breakpoint_proceeded; - proceed_to_finish = inf_status->proceed_to_finish; + tp->proceed_to_finish = inf_status->proceed_to_finish; /* The inferior can be gone if the user types "print exit(0)" (and perhaps other times). */ |