aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbthread.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-03-10 16:56:57 -0700
committerTom Tromey <tom@tromey.com>2023-08-10 10:50:37 -0600
commitd0ffdf6482024331dc43d9c221c7afc5863a300b (patch)
tree22bc10e78fac4db876bbd5190011d5da0ee465dc /gdb/gdbthread.h
parent67bed49ec852aee39172fc867a89ec78c4903883 (diff)
downloadgdb-d0ffdf6482024331dc43d9c221c7afc5863a300b.zip
gdb-d0ffdf6482024331dc43d9c221c7afc5863a300b.tar.gz
gdb-d0ffdf6482024331dc43d9c221c7afc5863a300b.tar.bz2
Pass unique_ptr to add_thread_with_info
This changes add_thread_with_info to accept a unique_ptr, making it clear that it takes ownership of the passed-in pointer. I can't test the AIX or Darwin changes, but I think they are relatively obvious.
Diffstat (limited to 'gdb/gdbthread.h')
-rw-r--r--gdb/gdbthread.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index d294be6..baff68a 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -222,6 +222,9 @@ struct private_thread_info
virtual ~private_thread_info () = 0;
};
+/* Unique pointer wrapper for private_thread_info. */
+using private_thread_info_up = std::unique_ptr<private_thread_info>;
+
/* 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
@@ -522,7 +525,7 @@ public:
struct frame_id initiating_frame = null_frame_id;
/* Private data used by the target vector implementation. */
- std::unique_ptr<private_thread_info> priv;
+ private_thread_info_up priv;
/* Branch trace information for this thread. */
struct btrace_thread_info btrace {};
@@ -616,7 +619,7 @@ extern struct thread_info *add_thread_silent (process_stratum_target *targ,
/* Same as add_thread, and sets the private info. */
extern struct thread_info *add_thread_with_info (process_stratum_target *targ,
ptid_t ptid,
- private_thread_info *);
+ private_thread_info_up);
/* Delete thread THREAD and notify of thread exit. If the thread is
currently not deletable, don't actually delete it but still tag it