aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2008-09-08 21:52:25 +0000
committerPedro Alves <palves@redhat.com>2008-09-08 21:52:25 +0000
commitaf679fd00340269efb8474ee49a343dccaea9700 (patch)
treeb79c4d378442486a84c56a6fee06f4a7c44c4705 /gdb/infrun.c
parent2020b7abd8daa9b0204aa39bfcda2d6f9f45a1f1 (diff)
downloadgdb-af679fd00340269efb8474ee49a343dccaea9700.zip
gdb-af679fd00340269efb8474ee49a343dccaea9700.tar.gz
gdb-af679fd00340269efb8474ee49a343dccaea9700.tar.bz2
Remove the global step_multi in favour of a per-thread
step_multi. * inferior.h (step_multi): Delete. * gdbthread.h (struct thread_info): Add comments around step_multi. (save_infrun_state, load_infrun_state): Remove step_multi parameter. * thread.c (load_infrun_state, save_infrun_state): Remove step_multi argument, and references to it. * infcmd.c (step_multi): Delete. (step_1): Adjust. (step_1_continuation, until_next_command): Adjust. * infrun.c (fetch_inferior_event): Adjust. (context_switch): Don't context-switch step_multi. (print_stop_reason, normal_stop): Adjust.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index d34fc20..e0be5be 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1655,7 +1655,11 @@ fetch_inferior_event (void *client_data)
if (stop_soon == NO_STOP_QUIETLY)
normal_stop ();
- if (step_multi && stop_step)
+ if (target_has_execution
+ && ecs->ws.kind != TARGET_WAITKIND_EXITED
+ && ecs->ws.kind != TARGET_WAITKIND_SIGNALLED
+ && ecs->event_thread->step_multi
+ && stop_step)
inferior_event_handler (INF_EXEC_CONTINUE, NULL);
else
inferior_event_handler (INF_EXEC_COMPLETE, NULL);
@@ -1738,14 +1742,12 @@ context_switch (ptid_t ptid)
/* Save infrun state for the old thread. */
save_infrun_state (inferior_ptid,
cmd_continuation, intermediate_continuation,
- stop_step,
- step_multi);
+ stop_step);
/* Load infrun state for the new thread. */
load_infrun_state (ptid,
&cmd_continuation, &intermediate_continuation,
- &stop_step,
- &step_multi);
+ &stop_step);
}
switch_to_thread (ptid);
@@ -3663,7 +3665,7 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
/* For now print nothing. */
/* Print a message only if not in the middle of doing a "step n"
operation for n > 1 */
- if (!step_multi || !stop_step)
+ if (!inferior_thread ()->step_multi || !stop_step)
if (ui_out_is_mi_like_p (uiout))
ui_out_field_string
(uiout, "reason",
@@ -3812,7 +3814,11 @@ Further execution is probably impossible.\n"));
/* Don't print a message if in the middle of doing a "step n"
operation for n > 1 */
- if (step_multi && stop_step)
+ if (target_has_execution
+ && last.kind != TARGET_WAITKIND_SIGNALLED
+ && last.kind != TARGET_WAITKIND_EXITED
+ && inferior_thread ()->step_multi
+ && stop_step)
goto done;
target_terminal_ours ();
@@ -3962,7 +3968,11 @@ Further execution is probably impossible.\n"));
done:
annotate_stopped ();
- if (!suppress_stop_observer && !step_multi)
+ if (!suppress_stop_observer
+ && !(target_has_execution
+ && last.kind != TARGET_WAITKIND_SIGNALLED
+ && last.kind != TARGET_WAITKIND_EXITED
+ && inferior_thread ()->step_multi))
{
if (!ptid_equal (inferior_ptid, null_ptid))
observer_notify_normal_stop (inferior_thread ()->stop_bpstat);