aboutsummaryrefslogtreecommitdiff
path: root/gdb/thread.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2022-06-24 17:20:16 +0100
committerPedro Alves <pedro@palves.net>2022-06-24 17:20:16 +0100
commit86be3050a64c7317754b5682e1a2b6a91f4e3f03 (patch)
tree83b6d04fb1cbfe4e46fee0e61f1a6f63b4fb6113 /gdb/thread.c
parent10245fe8171a292dcf50051a33ec5bae7b08cb54 (diff)
downloadfsf-binutils-gdb-86be3050a64c7317754b5682e1a2b6a91f4e3f03.zip
fsf-binutils-gdb-86be3050a64c7317754b5682e1a2b6a91f4e3f03.tar.gz
fsf-binutils-gdb-86be3050a64c7317754b5682e1a2b6a91f4e3f03.tar.bz2
Revert "Delete delete_thread_silent"
Turns out we'll be gaining a new use of this function very soon, the incoming AMDGPU port needs it. Let's add it back, as it isn't really hurting anything. This reverts commit 39b8a8090ed7e8967ceca3655aa5f3a2ae91219d.
Diffstat (limited to 'gdb/thread.c')
-rw-r--r--gdb/thread.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/gdb/thread.c b/gdb/thread.c
index f0ad82e..378c5ee 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -450,16 +450,20 @@ global_thread_step_over_chain_remove (struct thread_info *tp)
global_thread_step_over_list.erase (it);
}
-/* See gdbthread.h. */
+/* Delete the thread referenced by THR. If SILENT, don't notify
+ the observer of this exit.
+
+ THR must not be NULL or a failed assertion will be raised. */
-void
-delete_thread (thread_info *thr)
+static void
+delete_thread_1 (thread_info *thr, bool silent)
{
gdb_assert (thr != nullptr);
- threads_debug_printf ("deleting thread %s", thr->ptid.to_string ().c_str ());
+ threads_debug_printf ("deleting thread %s, silent = %d",
+ thr->ptid.to_string ().c_str (), silent);
- set_thread_exited (thr, false);
+ set_thread_exited (thr, silent);
if (!thr->deletable ())
{
@@ -473,6 +477,20 @@ delete_thread (thread_info *thr)
delete thr;
}
+/* See gdbthread.h. */
+
+void
+delete_thread (thread_info *thread)
+{
+ delete_thread_1 (thread, false /* not silent */);
+}
+
+void
+delete_thread_silent (thread_info *thread)
+{
+ delete_thread_1 (thread, true /* silent */);
+}
+
struct thread_info *
find_thread_global_id (int global_id)
{