From 657a94e242485e6457215763e5c1055502ca6a79 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 30 Jun 2022 13:04:07 +0100 Subject: inferior::clear_thread_list always silent Now that the MI mi_thread_exit observer ignores "silent", there's no difference between inferior::clean_thread_list with silent true or false. And for the CLI, clean_thread_list() never printed anything either. So we can eliminate the 'silent' parameter. Change-Id: I90ff9f07537d22ea70986fbcfe8819cac7e06613 --- gdb/inferior.c | 12 ++++++------ gdb/inferior.h | 5 ++--- gdb/thread.c | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/gdb/inferior.c b/gdb/inferior.c index 23cbfd6..eacb65e 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -168,13 +168,13 @@ add_inferior (int pid) /* See inferior.h. */ void -inferior::clear_thread_list (bool silent) +inferior::clear_thread_list () { thread_list.clear_and_dispose ([=] (thread_info *thr) { - threads_debug_printf ("deleting thread %s, silent = %d", - thr->ptid.to_string ().c_str (), silent); - set_thread_exited (thr, silent); + threads_debug_printf ("deleting thread %s", + thr->ptid.to_string ().c_str ()); + set_thread_exited (thr, true); if (thr->deletable ()) delete thr; }); @@ -184,7 +184,7 @@ inferior::clear_thread_list (bool silent) void delete_inferior (struct inferior *inf) { - inf->clear_thread_list (true); + inf->clear_thread_list (); auto it = inferior_list.iterator_to (*inf); inferior_list.erase (it); @@ -204,7 +204,7 @@ delete_inferior (struct inferior *inf) static void exit_inferior_1 (struct inferior *inf, int silent) { - inf->clear_thread_list (silent); + inf->clear_thread_list (); gdb::observers::inferior_exit.notify (inf); diff --git a/gdb/inferior.h b/gdb/inferior.h index 69525a2..07d9527 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -425,9 +425,8 @@ public: inline safe_inf_threads_range threads_safe () { return safe_inf_threads_range (this->thread_list.begin ()); } - /* Delete all threads in the thread list. If SILENT, exit threads - silently. */ - void clear_thread_list (bool silent); + /* Delete all threads in the thread list, silently. */ + void clear_thread_list (); /* Continuations-related methods. A continuation is an std::function to be called to finish the execution of a command when running diff --git a/gdb/thread.c b/gdb/thread.c index 2c45d52..2ca3a86 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -235,7 +235,7 @@ init_thread_list (void) highest_thread_num = 0; for (inferior *inf : all_inferiors ()) - inf->clear_thread_list (true); + inf->clear_thread_list (); } /* Allocate a new thread of inferior INF with target id PTID and add -- cgit v1.1