gdb/
[deliverable/binutils-gdb.git] / gdb / gdbthread.h
index cd24eaf2fb08e57aae782c55caa635b3cfb0e95b..8fe82c3056f1d3abdf6b3ba38f367bcbf0db8f6f 100644 (file)
@@ -29,43 +29,14 @@ struct symtab;
 #include "ui-out.h"
 #include "inferior.h"
 
-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) */
+/* Inferior thread specific part of `struct infcall_control_state'.
 
-  /* 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.  */
-  /* This field is internal to thread.c.  Never access it directly,
-     use is_executing instead.  */
-  int executing_;
-
-  /* Frontend view of the thread state.  Note that the RUNNING/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 running will
-     still be true.  As a possible future extension, this could turn
-     into enum { stopped, exited, stepping, finishing, until(ling),
-     running ... }  */
-  /* This field is internal to thread.c.  Never access it directly,
-     use is_running instead.  */
-  int 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;
+   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;
-
   /* Range to single step within.
 
      If this is nonzero, respond to a single-step signal by continuing
@@ -88,17 +59,6 @@ struct thread_info
      any inlined frames).  */
   struct frame_id step_stack_frame_id;
 
-  int current_line;
-  struct symtab *current_symtab;
-
-  /* Internal stepping state.  */
-
-  /* Record the pc of the thread the last time it stopped.  This is
-     maintained by proceed and keep_going, and used in
-     adjust_pc_after_break to distinguish a hardware single-step
-     SIGTRAP from a breakpoint SIGTRAP.  */
-  CORE_ADDR prev_pc;
-
   /* Nonzero if we are presently stepping over a breakpoint.
 
      If we hit a breakpoint or watchpoint, and then continue, we need
@@ -123,6 +83,90 @@ struct thread_info
      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;
+};
+
+/* 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).  */
+  enum target_signal stop_signal;
+};
+
+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) */
+
+  /* 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.  */
+  /* This field is internal to thread.c.  Never access it directly,
+     use is_executing instead.  */
+  int executing_;
+
+  /* Frontend view of the thread state.  Note that the RUNNING/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 running will
+     still be true.  As a possible future extension, this could turn
+     into enum { stopped, exited, stepping, finishing, until(ling),
+     running ... }  */
+  /* This field is internal to thread.c.  Never access it directly,
+     use is_running instead.  */
+  int 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;
+
+  /* User/external stepping state.  */
+
+  /* Step-resume or longjmp-resume breakpoint.  */
+  struct breakpoint *step_resume_breakpoint;
+
+  int current_line;
+  struct symtab *current_symtab;
+
+  /* Internal stepping state.  */
+
+  /* Record the pc of the thread the last time it stopped.  This is
+     maintained by proceed and keep_going, and used in
+     adjust_pc_after_break to distinguish a hardware single-step
+     SIGTRAP from a breakpoint SIGTRAP.  */
+  CORE_ADDR prev_pc;
+
   /* Should we step over breakpoint next time keep_going is called?  */
   int stepping_over_breakpoint;
 
@@ -153,19 +197,6 @@ struct thread_info
      command.  */
   struct continuation *intermediate_continuations;
 
-  /* 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;
-
   /* 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;
@@ -175,13 +206,6 @@ struct thread_info
      resume of the thread, and not immediately.  */
   struct target_waitstatus pending_follow;
 
-  /* Last signal that the inferior received (why it stopped).  */
-  enum target_signal stop_signal;
-
-  /* Chain containing status of breakpoint(s) the thread stopped
-     at.  */
-  bpstat stop_bpstat;
-
   /* True if this thread has been explicitly requested to stop.  */
   int stop_requested;
 
This page took 0.026764 seconds and 4 git commands to generate.