From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id alyMKaINh2Qx9QEAWB0awg (envelope-from ) for ; Mon, 12 Jun 2023 08:20:50 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=efhZx9pv; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 9DC391E0BB; Mon, 12 Jun 2023 08:20:50 -0400 (EDT) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 8B2C31E0AC for ; Mon, 12 Jun 2023 08:20:48 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C09B23858C33 for ; Mon, 12 Jun 2023 12:20:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C09B23858C33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1686572447; bh=R/woTeB49+MqYSDU1U64PUcZPbz4DCwPH/w9KHqTcSs=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=efhZx9pvL0ehBHylIC8AfoXF7os4mAjoLKBDCupjcgNpFSUnWLb81+hWn1V0DlXlN /EQuNqR7Agm2KMfEsQ92Xgjh12UHKZmbtlyBZZQWjMRHmMqftIRUgOXBX0Is5ytMUx 165seXK6yr/oAcBk47/101DcvpdBmrnMgOypxz1s= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 66D533858296 for ; Mon, 12 Jun 2023 12:20:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 66D533858296 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-357-vKUSzWC0OnG1Fow2CFlatQ-1; Mon, 12 Jun 2023 08:20:09 -0400 X-MC-Unique: vKUSzWC0OnG1Fow2CFlatQ-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-3f7ef2456dfso17420415e9.1 for ; Mon, 12 Jun 2023 05:20:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686572408; x=1689164408; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=R/woTeB49+MqYSDU1U64PUcZPbz4DCwPH/w9KHqTcSs=; b=JFVobYgxXqJGlHb1PcrRjW0STPanivoHG8imf84fNVo8/QxK9P66Mc1cXSoDOc+cFr 6y8qDxIm5zxxse64/pEMiX3RET3zzwU0SZRXngaL6MtXPz/z8YDU1Imk/WyfzC/ya6fS 7Ls2sNQd+W6Ol1cX4PAAo+j9ZIJZ8Kd+i+HOIVvOiEYTxXMHYFx+NibiSIzmfip19zAP Aq9P8E1yoIstySzfTCR28AhZziTsV4j+XV7lbxiagYjA1z/LNL4YfAow4kFUO3ilVahT cL8Yvd3xuLRQBfyHHDrZLQnyio3+MXludqJE5OLquFxZe0kThua7eyJWLqWawz+tdtYp ++jA== X-Gm-Message-State: AC+VfDyln5Y5264h17V8dXEl4vod4V+QjdjzcYCMBDHIDDXQt1S7hiUh IqiWjMr3zqSOuOvL4h9uN9ELGm8SHmsPC9LCcHaom7e59O6B1Vt2IDJQaHkMq+D+r52m+73O/xT olX8NxZKqXKP8HSPCJfB++byOgJv7qg== X-Received: by 2002:a05:600c:290b:b0:3f5:39:240c with SMTP id i11-20020a05600c290b00b003f50039240cmr6233443wmd.27.1686572408498; Mon, 12 Jun 2023 05:20:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4l5Q2PjXXAQOB4QrF4DNJCfew+1yzLwdaNuiAdBuT8TAoGcx3GuxQBxRZ/KiYm0WD14UcBYg== X-Received: by 2002:a05:600c:290b:b0:3f5:39:240c with SMTP id i11-20020a05600c290b00b003f50039240cmr6233429wmd.27.1686572408198; Mon, 12 Jun 2023 05:20:08 -0700 (PDT) Received: from localhost (2.72.115.87.dyn.plus.net. [87.115.72.2]) by smtp.gmail.com with ESMTPSA id 6-20020a05600c230600b003f41bb52834sm11341273wmo.38.2023.06.12.05.20.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 05:20:07 -0700 (PDT) To: Pedro Alves , gdb-patches@sourceware.org Subject: Re: [PATCH 29/31] inferior::clear_thread_list always silent In-Reply-To: <20221212203101.1034916-30-pedro@palves.net> References: <20221212203101.1034916-1-pedro@palves.net> <20221212203101.1034916-30-pedro@palves.net> Date: Mon, 12 Jun 2023 13:20:06 +0100 Message-ID: <877cs8yirt.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, 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: , From: Andrew Burgess via Gdb-patches Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Pedro Alves writes: > 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 (); If you wanted you could also remove SILENT from exit_inferior_1 as I don't believe it is used there now either. Which would then allow exit_inferior and exit_inferior_silent to be merged. ... or this can be done in a follow up patch. Reviewed-By: Andrew Burgess Thanks, Andrew > > 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