From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by sourceware.org (Postfix) with ESMTPS id 4F54F3847596 for ; Mon, 12 Dec 2022 20:31:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4F54F3847596 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f43.google.com with SMTP id h12so13430144wrv.10 for ; Mon, 12 Dec 2022 12:31:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bdKD9kAoafsVFCnt+oV1szYcu6wJDXFQf5IFrS+6cFA=; b=BPIeE4JUJoQSBBjcY2Vi2fBqxv/qBFD0uMQLv5D2Xv+zSnDKvMl7vsQUJMenypKcPG slTeuhomzBhtOnYQzbPrudLNh3ipYu0HDcgYsC+XXYrMdsXzqSDXmt2YwBRCAimQsYrr uHwFBMwE8UMGdPqfz8PHQIP0SJGs5661KoaI6K5ROvJyQ5sXkJKb8FJtq57Af9mv2Cex uuv1ITGBP9kQzycholfQ5Ts8wceMHsLGYmfUraWkOExe9aRRP/2G138GRTpUa287+MbE 6VAZAV9JPJDsJde8FAGaqWzF6HpBwlqI0J8DYPIYcCS4FwVxeBPgAH+9igTd2YIl97vR j5Cg== X-Gm-Message-State: ANoB5pn4+bsl9MaHF9ZV8uXWJrYnC6z1+eF1sBHJHJpyv+T9Alsu+Nx3 Slvjh5rUCVWhvJMpSF7YzVcpe7onkFIyaw== X-Google-Smtp-Source: AA0mqf5XVzWhQ1m6GkP5ju+JSvmWa7vJkpTyhJXe7YOGgoJJSBii9Dx4+DBsCdreAgnQ08xS/0datQ== X-Received: by 2002:adf:fd0e:0:b0:242:1926:783d with SMTP id e14-20020adffd0e000000b002421926783dmr14469763wrr.7.1670877098176; Mon, 12 Dec 2022 12:31:38 -0800 (PST) Received: from localhost ([2001:8a0:f912:6700:afd9:8b6d:223f:6170]) by smtp.gmail.com with ESMTPSA id b14-20020adff24e000000b002421db5f279sm10025287wrp.78.2022.12.12.12.31.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Dec 2022 12:31:37 -0800 (PST) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 29/31] inferior::clear_thread_list always silent Date: Mon, 12 Dec 2022 20:30:59 +0000 Message-Id: <20221212203101.1034916-30-pedro@palves.net> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20221212203101.1034916-1-pedro@palves.net> References: <20221212203101.1034916-1-pedro@palves.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 23cbfd63bde..eacb65ec1d7 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 69525a2e053..07d9527a802 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -425,9 +425,8 @@ class inferior : public refcounted_object, 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 2c45d528bba..2ca3a867d8c 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 -- 2.36.0