From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by sourceware.org (Postfix) with ESMTPS id 0A3BD392EA9C for ; Wed, 13 Jul 2022 22:25:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0A3BD392EA9C 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-f41.google.com with SMTP id r10so37606wrv.4 for ; Wed, 13 Jul 2022 15:25:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=84d5Qd5zqFIV4SY2uCXh+BBK/osFTVLFj/yHkAHp7iI=; b=ySmHstDc5qOqb56be0XZFqjLT2YIR61+Z5rdYKu1oYES1w340z/oDl4YPfJCg1WfgR BPHlO9mBdKNlw5+QRTr+VTC0N3u5oaCwjtyd1dcQCBg13AHtSvS8RKl3IKrLyAKfJXnT CeYuIFGR0SPwBYyC59TOqIzHzn6vCDLYBkjod6EnLB7mP6n3bcFJpYvkoK+mJiLisitt ThVPSTPiQ1LGmYsYhpQ2C8oUH8YQCJWY1xDc3LjsMH5tIvps6zBMh3+4Us0Wttmy4Hl8 Hj37hm82SEFUBZVEa8trDDY4FCSrF9ZkniiFOUsKZIO7fHWyxxKFNVyJwwCAx0URL12h NNIA== X-Gm-Message-State: AJIora8kEa9NqrVHV/RhUovUJ3tIf65/QxlHR/NpWVBqjLzFDF81j6cp q9nKnLiY+EbHpFZXja0ZErFz7WtE+ks= X-Google-Smtp-Source: AGRyM1vaZprzUez4ABSE4icPSl2c/eWr1HjUzuFmbeoP3BIs+09usTzCSD7z3hRIeS73KoxOWaeccw== X-Received: by 2002:a5d:6288:0:b0:21d:6c75:82 with SMTP id k8-20020a5d6288000000b0021d6c750082mr5219612wru.218.1657751136228; Wed, 13 Jul 2022 15:25:36 -0700 (PDT) Received: from localhost ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id k28-20020a5d525c000000b0020fcc655e4asm12107412wrc.5.2022.07.13.15.25.34 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 Jul 2022 15:25:35 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH v2 27/29] inferior::clear_thread_list always silent Date: Wed, 13 Jul 2022 23:24:31 +0100 Message-Id: <20220713222433.374898-28-pedro@palves.net> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220713222433.374898-1-pedro@palves.net> References: <20220713222433.374898-1-pedro@palves.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jul 2022 22:25:39 -0000 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 606b4189181..c1d2be6e3a2 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -177,13 +177,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; }); @@ -193,7 +193,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); @@ -213,7 +213,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 c376d780de0..9c1dcec0cea 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -428,9 +428,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 a83db6b07fd..9aa2189160e 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