aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbthread.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdbthread.h')
-rw-r--r--gdb/gdbthread.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index f881712..83b2616 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -29,6 +29,7 @@ struct symtab;
#include "inferior.h"
#include "btrace.h"
#include "common/vec.h"
+#include "target/waitstatus.h"
/* Frontend view of the thread state. Possible extensions: stepping,
finishing, until(ling),... */
@@ -157,6 +158,23 @@ struct thread_suspend_state
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;
@@ -181,6 +199,15 @@ struct thread_info
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,
@@ -398,6 +425,11 @@ extern int thread_count (void);
/* Switch from one thread to another. */
extern void switch_to_thread (ptid_t ptid);
+/* Marks or clears thread(s) PTID as resumed. If PTID is
+ MINUS_ONE_PTID, applies to all threads. If ptid_is_pid(PTID) is
+ true, applies to all threads of the process pointed at by PTID. */
+extern void set_resumed (ptid_t ptid, int resumed);
+
/* Marks thread PTID is running, or stopped.
If PTID is minus_one_ptid, marks all threads. */
extern void set_running (ptid_t ptid, int running);