From patchwork Thu Dec 1 16:26:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 61323 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0BE9B3858423 for ; Thu, 1 Dec 2022 16:27:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0BE9B3858423 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669912032; bh=9p+McJW6PPizjP9GclHP7bwF8yNeZzTdyAYkctC+Kmw=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=HH4TJ4fMnwMugHM5D+N2S7NS02WmilhM/IttnWRFEDLHUx2fLn5/Kqts7odYJ3Y/f mESpJ5W+pEvbEIq7TsfK7jeLjZZuWfUv/DjWAbgAyPMMCCcHCAR2nqQUBRKlXvSVqn ScZXxL3c2gKmtWFdF7lbuDa56qsCEaPkq6ghCrMA= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 5FECF3858D35 for ; Thu, 1 Dec 2022 16:26:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5FECF3858D35 X-ASG-Debug-ID: 1669912003-0c856e6c0571a40001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id Cnx9UgJOAzElsZCx (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO); Thu, 01 Dec 2022 11:26:43 -0500 (EST) X-Barracuda-Envelope-From: simon.marchi@efficios.com X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from smarchi-efficios.internal.efficios.com (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) by smtp.ebox.ca (Postfix) with ESMTP id 59F48441B21; Thu, 1 Dec 2022 11:26:43 -0500 (EST) X-Barracuda-RBL-IP: 192.222.180.24 X-Barracuda-Effective-Source-IP: 192-222-180-24.qc.cable.ebox.net[192.222.180.24] X-Barracuda-Apparent-Source-IP: 192.222.180.24 To: gdb-patches@sourceware.org Cc: Simon Marchi , Pedro Alves Subject: [pushed] gdb: remove prune_threads in thread_db_target::update_thread_list Date: Thu, 1 Dec 2022 11:26:41 -0500 X-ASG-Orig-Subj: [pushed] gdb: remove prune_threads in thread_db_target::update_thread_list Message-Id: <20221201162641.1048249-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1669912003 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 1742 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=5.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.102531 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: No, score=-3498.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, 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 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-Patchwork-Original-From: Simon Marchi via Gdb-patches From: Simon Marchi Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Pedro mentioned that this prune_threads call in thread_db_target::update_thread_list was not needed, and it was probably an oversight to leave it there in the work following commit e8032dde10b ("Push pruning old threads down to the target"). That commit changed the "find new threads" target operation to "update thread list", making the target responsible of adding new threads and removing exited threads, rather than just adding new threads. Commit e8032dde10b moved the prune_threads calls previously done in common code into each target's update_thread_list method, in order to keep the existing behavior, which is why this prune_threads call ended up there. In the mean time, the linux-nat target was taught to update_thread_list, and thread_db_target::update_thread_list defers to that for any live inferior, so the prune_threads call is not needed there. Otherwise, the thread_db_target::update_thread_list implementation based on td_ta_thr_iter_p only knows how to add new threads, not how to delete exited threads, but that is only used for non-live inferiors, where threads can't exit anyway. So the prune_threads call is not needed for that case either. Change-Id: I127fd4f84c25086f97853dadf34c5cec6816840d Approved-By: Pedro Alves --- gdb/linux-thread-db.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index 839271c01c55..91a8fb8b0960 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -1618,8 +1618,6 @@ thread_db_target::update_thread_list () { struct thread_db_info *info; - prune_threads (); - for (inferior *inf : all_inferiors ()) { if (inf->pid == 0)