From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id 776DD3858431; Thu, 1 Dec 2022 16:26:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 776DD3858431 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669911960; bh=tzFQ1NdYxI3kUQ3vt9w/P1VXuNqOAy+WNgMrNpPl/qM=; h=From:To:Subject:Date:From; b=q5IlgPCmWZSumvSSabNwU1oIgA4fmpUA+FvhsZCw8WLX6OR9bU73KaP+ggVuNk+1x UbUeNpjKroJCwXkMRtLJrAo2bIwEb81AC20MjbNOGoGM+IvdoBnwYpsy4bTTBzAkkE 4RUVJ0q7uKpuogqrjd+miG7/LoWR6/mCZumv9Gmw= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Simon Marchi To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb: remove prune_threads in thread_db_target::update_thread_list X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: b7e7acf7860f6af55995842fb9148904101fd812 X-Git-Newrev: 616d7b31c8f468043bf6b858cbcb42fee6a86a9a Message-Id: <20221201162600.776DD3858431@sourceware.org> Date: Thu, 1 Dec 2022 16:26:00 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D616d7b31c8f4= 68043bf6b858cbcb42fee6a86a9a commit 616d7b31c8f468043bf6b858cbcb42fee6a86a9a Author: Simon Marchi Date: Tue Nov 29 11:28:58 2022 -0500 gdb: remove prune_threads in thread_db_target::update_thread_list =20 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. =20 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. =20 Change-Id: I127fd4f84c25086f97853dadf34c5cec6816840d Approved-By: Pedro Alves Diff: --- 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 839271c01c5..91a8fb8b096 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; =20 - prune_threads (); - for (inferior *inf : all_inferiors ()) { if (inf->pid =3D=3D 0)