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.
+2008-09-08 Pedro Alves <pedro@codesourcery.com>
+
+ 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.
+
2008-09-08 Pedro Alves <pedro@codesourcery.com>
Remove the global stop_signal in favour of a per-thread
enum step_over_calls_kind step_over_calls;
int stop_step;
+
+ /* If stepping, nonzero means step count is > 1 so don't print frame
+ next time inferior stops if it stops due to stepping. */
int step_multi;
/* Last signal that the inferior received (why it stopped). */
extern void save_infrun_state (ptid_t ptid,
struct continuation *continuations,
struct continuation *intermediate_continuations,
- int stop_step,
- int step_multi);
+ int stop_step);
/* infrun context switch: load the debugger state previously saved
for the given thread. */
extern void load_infrun_state (ptid_t ptid,
struct continuation **continuations,
struct continuation **intermediate_continuations,
- int *stop_step,
- int *step_multi);
+ int *stop_step);
/* Switch from one thread to another. */
extern void switch_to_thread (ptid_t ptid);
int stopped_by_random_signal;
-/* If stepping, nonzero means step count is > 1
- so don't print frame next time inferior stops
- if it stops due to stepping. */
-
-int step_multi;
-
/* Environment to use for running inferior,
in format described in environ.h. */
if (skip_subroutines)
tp->step_over_calls = STEP_OVER_ALL;
- step_multi = (count > 1);
+ tp->step_multi = (count > 1);
proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
if (!stop_step)
{
struct step_1_continuation_args *a = args;
- if (!step_multi || !stop_step)
+ if (target_has_execution)
{
- /* If we stopped for some reason that is not stepping there are
- no further steps to make. Cleanup. */
- if (!a->single_inst || a->skip_subroutines)
- delete_longjmp_breakpoint (a->thread);
- step_multi = 0;
+ struct thread_info *tp;
+
+ tp = inferior_thread ();
+ if (tp->step_multi && stop_step)
+ {
+ /* There are more steps to make, and we did stop due to
+ ending a stepping range. Do another step. */
+ step_once (a->skip_subroutines, a->single_inst, a->count - 1, a->thread);
+ return;
+ }
+ tp->step_multi = 0;
}
- else
- step_once (a->skip_subroutines, a->single_inst, a->count - 1, a->thread);
+
+ /* We either stopped for some reason that is not stepping, or there
+ are no further steps to make. Cleanup. */
+ if (!a->single_inst || a->skip_subroutines)
+ delete_longjmp_breakpoint (a->thread);
}
/* Do just one step operation. If count >1 we will have to set up a
if (skip_subroutines)
tp->step_over_calls = STEP_OVER_ALL;
- step_multi = (count > 1);
+ inferior_thread ()->step_multi = (count > 1);
proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
args = xmalloc (sizeof (*args));
tp->step_over_calls = STEP_OVER_ALL;
tp->step_frame_id = get_frame_id (frame);
- step_multi = 0; /* Only one call to proceed */
+ tp->step_multi = 0; /* Only one call to proceed */
proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
}
STEP_OVER_UNDEBUGGABLE
};
-/* If stepping, nonzero means step count is > 1
- so don't print frame next time inferior stops
- if it stops due to stepping. */
-
-extern int step_multi;
-
/* Anything but NO_STOP_QUIETLY means we expect a trap and the caller
will handle it themselves. STOP_QUIETLY is used when running in
the shell before the child program has been exec'd and when running
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);
/* 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);
/* 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",
/* 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 ();
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);
load_infrun_state (ptid_t ptid,
struct continuation **continuations,
struct continuation **intermediate_continuations,
- int *stop_step,
- int *step_multi)
+ int *stop_step)
{
struct thread_info *tp;
*intermediate_continuations = tp->intermediate_continuations;
tp->intermediate_continuations = NULL;
*stop_step = tp->stop_step;
- *step_multi = tp->step_multi;
}
}
save_infrun_state (ptid_t ptid,
struct continuation *continuations,
struct continuation *intermediate_continuations,
- int stop_step,
- int step_multi)
+ int stop_step)
{
struct thread_info *tp;
tp->continuations = continuations;
tp->intermediate_continuations = intermediate_continuations;
tp->stop_step = stop_step;
- tp->step_multi = step_multi;
}
}