+ /* The thread's global GDB thread number. This is exposed to MI,
+ Python/Scheme, visible with "info threads -gid", and is also what
+ the $_gthread convenience variable is bound to. */
+ int global_num;
+
+ /* The per-inferior thread number. This is unique in the inferior
+ the thread belongs to, but not unique between inferiors. This is
+ what the $_thread convenience variable is bound to. */
+ int per_inf_num;
+
+ /* The inferior this thread belongs to. */
+ struct inferior *inf;
+
+ /* 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 = NULL;
+
+ /* 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 = 0;
+
+ /* 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 = 0;
+
+ /* 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 = THREAD_STOPPED;
+
+ /* State of GDB control of inferior thread execution.
+ See `struct thread_control_state'. */
+ thread_control_state control;
+
+ /* State of inferior thread to restore after GDB is done with an inferior
+ call. See `struct thread_suspend_state'. */
+ thread_suspend_state suspend;
+
+ int current_line = 0;
+ struct symtab *current_symtab = NULL;
+
+ /* 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 = 0;
+
+ /* 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 = 0;
+
+ /* Should we step over breakpoint next time keep_going is called? */
+ int stepping_over_breakpoint = 0;
+
+ /* 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 = 0;
+
+ /* 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 = 0;
+
+ /* 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 = NULL;