aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbthread.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdbthread.h')
-rw-r--r--gdb/gdbthread.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index 49fc80f..9a0de00 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -179,6 +179,12 @@ typedef struct value *value_ptr;
DEF_VEC_P (value_ptr);
typedef VEC (value_ptr) value_vec;
+/* Base class for target-specific thread data. */
+struct private_thread_info
+{
+ virtual ~private_thread_info () = 0;
+};
+
/* Threads are intrusively refcounted objects. Being the
user-selected thread is normally considered an implicit strong
reference and is thus not accounted in the refcount, unlike
@@ -345,11 +351,7 @@ public:
struct frame_id initiating_frame = null_frame_id;
/* Private data used by the target vector implementation. */
- struct private_thread_info *priv = NULL;
-
- /* Function that is called to free PRIVATE. If this is NULL, then
- xfree will be called on PRIVATE. */
- void (*private_dtor) (struct private_thread_info *) = NULL;
+ std::unique_ptr<private_thread_info> priv;
/* Branch trace information for this thread. */
struct btrace_thread_info btrace {};
@@ -604,7 +606,9 @@ public:
DISABLE_COPY_AND_ASSIGN (scoped_restore_current_thread);
private:
- thread_info *m_thread;
+ /* Use the "class" keyword here, because of a clash with a "thread_info"
+ function in the Darwin API. */
+ class thread_info *m_thread;
inferior *m_inf;
frame_id m_selected_frame_id;
int m_selected_frame_level;
@@ -683,7 +687,7 @@ extern void print_selected_thread_frame (struct ui_out *uiout,
Selects thread THR. TIDSTR is the original string the thread ID
was parsed from. This is used in the error message if THR is not
alive anymore. */
-extern void thread_select (const char *tidstr, thread_info *thr);
+extern void thread_select (const char *tidstr, class thread_info *thr);
extern struct thread_info *thread_list;