+#include "frame.h"
+#include "ui-out.h"
+#include "inferior.h"
+#include "btrace.h"
+
+/* Frontend view of the thread state. Possible extensions: stepping,
+ finishing, until(ling),... */
+enum thread_state
+{
+ THREAD_STOPPED,
+ THREAD_RUNNING,
+ THREAD_EXITED,
+};
+
+/* Inferior thread specific part of `struct infcall_control_state'.
+
+ Inferior process counterpart is `struct inferior_control_state'. */
+
+struct thread_control_state
+{
+ /* User/external stepping state. */
+
+ /* Step-resume or longjmp-resume breakpoint. */
+ struct breakpoint *step_resume_breakpoint;
+
+ /* Exception-resume breakpoint. */
+ struct breakpoint *exception_resume_breakpoint;
+
+ /* Range to single step within.
+
+ If this is nonzero, respond to a single-step signal by continuing
+ to step if the pc is in this range.
+
+ If step_range_start and step_range_end are both 1, it means to
+ step for a single instruction (FIXME: it might clean up
+ wait_for_inferior in a minor way if this were changed to the
+ address of the instruction and that address plus one. But maybe
+ not). */
+ CORE_ADDR step_range_start; /* Inclusive */
+ CORE_ADDR step_range_end; /* Exclusive */
+
+ /* If GDB issues a target step request, and this is nonzero, the
+ target should single-step this thread once, and then continue
+ single-stepping it without GDB core involvement as long as the
+ thread stops in the step range above. If this is zero, the
+ target should ignore the step range, and only issue one single
+ step. */
+ int may_range_step;
+
+ /* Stack frame address as of when stepping command was issued.
+ This is how we know when we step into a subroutine call, and how
+ to set the frame for the breakpoint used to step out. */
+ struct frame_id step_frame_id;
+
+ /* Similarly, the frame ID of the underlying stack frame (skipping
+ any inlined frames). */
+ struct frame_id step_stack_frame_id;
+
+ /* Nonzero if we are presently stepping over a breakpoint.
+
+ If we hit a breakpoint or watchpoint, and then continue, we need
+ to single step the current thread with breakpoints disabled, to
+ avoid hitting the same breakpoint or watchpoint again. And we
+ should step just a single thread and keep other threads stopped,
+ so that other threads don't miss breakpoints while they are
+ removed.
+
+ So, this variable simultaneously means that we need to single
+ step the current thread, keep other threads stopped, and that
+ breakpoints should be removed while we step.
+
+ This variable is set either:
+ - in proceed, when we resume inferior on user's explicit request
+ - in keep_going, if handle_inferior_event decides we need to
+ step over breakpoint.
+
+ The variable is cleared in normal_stop. The proceed calls
+ wait_for_inferior, which calls handle_inferior_event in a loop,
+ and until wait_for_inferior exits, this variable is changed only
+ by keep_going. */
+ int trap_expected;
+
+ /* Nonzero if the thread is being proceeded for a "finish" command
+ or a similar situation when stop_registers should be saved. */
+ int proceed_to_finish;
+
+ /* Nonzero if the thread is being proceeded for an inferior function
+ call. */
+ int in_infcall;
+
+ enum step_over_calls_kind step_over_calls;
+
+ /* Nonzero if stopped due to a step command. */
+ int stop_step;
+
+ /* Chain containing status of breakpoint(s) the thread stopped
+ at. */
+ bpstat stop_bpstat;
+
+ /* The interpreter that issued the execution command. NULL if the
+ thread was resumed as a result of a command applied to some other
+ thread (e.g., "next" with scheduler-locking off). */
+ struct interp *command_interp;
+};
+
+/* Inferior thread specific part of `struct infcall_suspend_state'.
+
+ Inferior process counterpart is `struct inferior_suspend_state'. */
+
+struct thread_suspend_state
+{
+ /* Last signal that the inferior received (why it stopped). When
+ the thread is resumed, this signal is delivered. Note: the
+ target should not check whether the signal is in pass state,
+ because the signal may have been explicitly passed with the
+ "signal" command, which overrides "handle nopass". If the signal
+ should be suppressed, the core will take care of clearing this
+ before the target is resumed. */
+ enum gdb_signal stop_signal;
+};