+2008-09-08 Pedro Alves <pedro@codesourcery.com>
+
+ Remove the global stop_step in favour of a per-thread
+ stop_step.
+
+ * inferior.h (stop_step): Delete.
+
+ * gdbthread.h (struct thread_info): Add comments to stop_step.
+ (save_infrun_state, load_infrun_state): Remove stop_step argument.
+ * thread.c (load_infrun_state, save_infrun_state): Remove
+ stop_step argument, and references to it.
+
+ * infrun.c (clear_proceed_status): Clear stop_step.
+ (fetch_inferior_event): Adjust.
+ (context_switch): Don't context-switch stop_step.
+ (handle_inferior_event): Adjust.
+ (normal_stop): Adjust.
+ (save_inferior_status, restore_inferior_status): Adjust.
+
+ * infcmd.c (stop_step): Delete.
+ (step_1, step_1_continuation, step_once, until_next_command):
+ Adjust.
+
2008-09-08 Pedro Alves <pedro@codesourcery.com>
Remove the global step_multi in favour of a per-thread
int proceed_to_finish;
enum step_over_calls_kind step_over_calls;
+
+ /* Nonzero if stopped due to a step command. */
int stop_step;
/* If stepping, nonzero means step count is > 1 so don't print frame
/* infrun context switch: save the debugger state for the given thread. */
extern void save_infrun_state (ptid_t ptid,
struct continuation *continuations,
- struct continuation *intermediate_continuations,
- int stop_step);
+ struct continuation *intermediate_continuations);
/* 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);
+ struct continuation **intermediate_continuations);
/* Switch from one thread to another. */
extern void switch_to_thread (ptid_t ptid);
tp->step_frame_id = null_frame_id;
tp->step_over_calls = STEP_OVER_UNDEBUGGABLE;
+ tp->stop_step = 0;
+
tp->proceed_to_finish = 0;
/* Discard any remaining commands or status from previous
&& ecs->ws.kind != TARGET_WAITKIND_EXITED
&& ecs->ws.kind != TARGET_WAITKIND_SIGNALLED
&& ecs->event_thread->step_multi
- && stop_step)
+ && ecs->event_thread->stop_step)
inferior_event_handler (INF_EXEC_CONTINUE, NULL);
else
inferior_event_handler (INF_EXEC_COMPLETE, NULL);
{ /* Perform infrun state context switch: */
/* Save infrun state for the old thread. */
save_infrun_state (inferior_ptid,
- cmd_continuation, intermediate_continuation,
- stop_step);
+ cmd_continuation, intermediate_continuation);
/* Load infrun state for the new thread. */
load_infrun_state (ptid,
- &cmd_continuation, &intermediate_continuation,
- &stop_step);
+ &cmd_continuation, &intermediate_continuation);
}
switch_to_thread (ptid);
+= gdbarch_deprecated_function_start_offset (current_gdbarch);
ecs->event_thread->stepping_over_breakpoint = 0;
bpstat_clear (&ecs->event_thread->stop_bpstat);
- stop_step = 0;
+ ecs->event_thread->stop_step = 0;
stop_print_frame = 1;
ecs->random_signal = 0;
stopped_by_random_signal = 0;
gdb_assert (ecs->event_thread->step_resume_breakpoint != NULL);
delete_step_resume_breakpoint (ecs->event_thread);
- stop_step = 1;
+ ecs->event_thread->stop_step = 1;
print_stop_reason (END_STEPPING_RANGE, 0);
stop_stepping (ecs);
return;
/* Also, maybe we just did a "nexti" inside a prolog, so we
thought it was a subroutine call but it was not. Stop as
well. FENN */
- stop_step = 1;
+ ecs->event_thread->stop_step = 1;
print_stop_reason (END_STEPPING_RANGE, 0);
stop_stepping (ecs);
return;
if (ecs->event_thread->step_over_calls == STEP_OVER_UNDEBUGGABLE
&& step_stop_if_no_debug)
{
- stop_step = 1;
+ ecs->event_thread->stop_step = 1;
print_stop_reason (END_STEPPING_RANGE, 0);
stop_stepping (ecs);
return;
/* If we have no line number and the step-stop-if-no-debug
is set, we stop the step so that the user has a chance to
switch in assembly mode. */
- stop_step = 1;
+ ecs->event_thread->stop_step = 1;
print_stop_reason (END_STEPPING_RANGE, 0);
stop_stepping (ecs);
return;
one instruction. */
if (debug_infrun)
fprintf_unfiltered (gdb_stdlog, "infrun: stepi/nexti\n");
- stop_step = 1;
+ ecs->event_thread->stop_step = 1;
print_stop_reason (END_STEPPING_RANGE, 0);
stop_stepping (ecs);
return;
or can this happen as a result of a return or longjmp?). */
if (debug_infrun)
fprintf_unfiltered (gdb_stdlog, "infrun: no line number info\n");
- stop_step = 1;
+ ecs->event_thread->stop_step = 1;
print_stop_reason (END_STEPPING_RANGE, 0);
stop_stepping (ecs);
return;
better. */
if (debug_infrun)
fprintf_unfiltered (gdb_stdlog, "infrun: stepped to a different line\n");
- stop_step = 1;
+ ecs->event_thread->stop_step = 1;
print_stop_reason (END_STEPPING_RANGE, 0);
stop_stepping (ecs);
return;
if (ecs->stop_func_start == stop_pc)
{
/* We are already there: stop now. */
- stop_step = 1;
+ ecs->event_thread->stop_step = 1;
print_stop_reason (END_STEPPING_RANGE, 0);
stop_stepping (ecs);
return;
/* For now print nothing. */
/* Print a message only if not in the middle of doing a "step n"
operation for n > 1 */
- if (!inferior_thread ()->step_multi || !stop_step)
+ if (!inferior_thread ()->step_multi
+ || !inferior_thread ()->stop_step)
if (ui_out_is_mi_like_p (uiout))
ui_out_field_string
(uiout, "reason",
&& last.kind != TARGET_WAITKIND_SIGNALLED
&& last.kind != TARGET_WAITKIND_EXITED
&& inferior_thread ()->step_multi
- && stop_step)
+ && inferior_thread ()->stop_step)
goto done;
target_terminal_ours ();
/* FIXME: cagney/2002-12-01: Given that a frame ID does
(or should) carry around the function and does (or
should) use that when doing a frame comparison. */
- if (stop_step
+ if (tp->stop_step
&& frame_id_eq (tp->step_frame_id,
get_frame_id (get_current_frame ()))
&& step_start_function == find_pc_function (stop_pc))
inf_status->stop_signal = tp->stop_signal;
inf_status->stop_pc = stop_pc;
- inf_status->stop_step = stop_step;
+ inf_status->stop_step = tp->stop_step;
inf_status->stop_stack_dummy = stop_stack_dummy;
inf_status->stopped_by_random_signal = stopped_by_random_signal;
inf_status->stepping_over_breakpoint = tp->trap_expected;
tp->stop_signal = inf_status->stop_signal;
stop_pc = inf_status->stop_pc;
- stop_step = inf_status->stop_step;
+ tp->stop_step = inf_status->stop_step;
stop_stack_dummy = inf_status->stop_stack_dummy;
stopped_by_random_signal = inf_status->stopped_by_random_signal;
tp->trap_expected = inf_status->stepping_over_breakpoint;