+ /* 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;
+
+ /* Whether the command that started the thread was a stepping
+ command. This is used to decide whether "set scheduler-locking
+ step" behaves like "on" or "off". */
+ int stepping_command;
+};
+
+/* Inferior thread specific part of `struct infcall_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;
+
+ /* The reason the thread last stopped, if we need to track it
+ (breakpoint, watchpoint, etc.) */
+ enum target_stop_reason stop_reason;
+
+ /* The waitstatus for this thread's last event. */
+ struct target_waitstatus waitstatus;
+ /* If true WAITSTATUS hasn't been handled yet. */
+ int waitstatus_pending_p;
+
+ /* Record the pc of the thread the last time it stopped. (This is
+ not the current thread's PC as that may have changed since the
+ last stop, e.g., "return" command, or "p $pc = 0xf000"). This is
+ used in coordination with stop_reason and waitstatus_pending_p:
+ if the thread's PC is changed since it last stopped, a pending
+ breakpoint waitstatus is discarded. */
+ CORE_ADDR stop_pc;
+};
+
+typedef struct value *value_ptr;
+DEF_VEC_P (value_ptr);
+typedef VEC (value_ptr) value_vec;
+
+struct thread_info
+{
+ struct thread_info *next;
+ ptid_t ptid; /* "Actual process id";
+ In fact, this may be overloaded with
+ kernel thread id, etc. */
+ int num; /* Convenient handle (GDB thread id) */
+
+ /* The name of the thread, as specified by the user. This is NULL
+ if the thread does not have a user-given name. */
+ char *name;
+
+ /* Non-zero means the thread is executing. Note: this is different
+ from saying that there is an active target and we are stopped at
+ a breakpoint, for instance. This is a real indicator whether the
+ thread is off and running. */
+ int executing;
+
+ /* Non-zero if this thread is resumed from infrun's perspective.
+ Note that a thread can be marked both as not-executing and
+ resumed at the same time. This happens if we try to resume a
+ thread that has a wait status pending. We shouldn't let the
+ thread really run until that wait status has been processed, but
+ we should not process that wait status if we didn't try to let
+ the thread run. */
+ int resumed;
+
+ /* Frontend view of the thread state. Note that the THREAD_RUNNING/
+ THREAD_STOPPED states are different from EXECUTING. When the
+ thread is stopped internally while handling an internal event,
+ like a software single-step breakpoint, EXECUTING will be false,
+ but STATE will still be THREAD_RUNNING. */
+ enum thread_state state;
+
+ /* If this is > 0, then it means there's code out there that relies
+ on this thread being listed. Don't delete it from the lists even
+ if we detect it exiting. */
+ int refcount;
+
+ /* State of GDB control of inferior thread execution.
+ See `struct thread_control_state'. */
+ struct thread_control_state control;
+
+ /* State of inferior thread to restore after GDB is done with an inferior
+ call. See `struct thread_suspend_state'. */
+ struct thread_suspend_state suspend;
+
+ int current_line;
+ struct symtab *current_symtab;
+
+ /* Internal stepping state. */
+
+ /* Record the pc of the thread the last time it was resumed. (It
+ can't be done on stop as the PC may change since the last stop,
+ e.g., "return" command, or "p $pc = 0xf000"). This is maintained
+ by proceed and keep_going, and among other things, it's used in
+ adjust_pc_after_break to distinguish a hardware single-step
+ SIGTRAP from a breakpoint SIGTRAP. */
+ CORE_ADDR prev_pc;
+
+ /* Did we set the thread stepping a breakpoint instruction? This is
+ used in conjunction with PREV_PC to decide whether to adjust the
+ PC. */
+ int stepped_breakpoint;
+
+ /* Should we step over breakpoint next time keep_going is called? */
+ int stepping_over_breakpoint;
+
+ /* Should we step over a watchpoint next time keep_going is called?
+ This is needed on targets with non-continuable, non-steppable
+ watchpoints. */
+ int stepping_over_watchpoint;
+
+ /* Set to TRUE if we should finish single-stepping over a breakpoint
+ after hitting the current step-resume breakpoint. The context here
+ is that GDB is to do `next' or `step' while signal arrives.
+ When stepping over a breakpoint and signal arrives, GDB will attempt
+ to skip signal handler, so it inserts a step_resume_breakpoint at the
+ signal return address, and resume inferior.
+ step_after_step_resume_breakpoint is set to TRUE at this moment in
+ order to keep GDB in mind that there is still a breakpoint to step over
+ when GDB gets back SIGTRAP from step_resume_breakpoint. */
+ int step_after_step_resume_breakpoint;
+
+ /* Pointer to the state machine manager object that handles what is
+ left to do for the thread's execution command after the target
+ stops. Several execution commands use it. */
+ struct thread_fsm *thread_fsm;