public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@efficios.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>, Pedro Alves <pedro@palves.net>
Subject: [pushed] gdb: remove prune_threads in thread_db_target::update_thread_list
Date: Thu,  1 Dec 2022 11:26:41 -0500	[thread overview]
Message-ID: <20221201162641.1048249-1-simon.marchi@efficios.com> (raw)

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 <pedro@palves.net>
---
 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)
-- 
2.38.1


                 reply	other threads:[~2022-12-01 16:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221201162641.1048249-1-simon.marchi@efficios.com \
    --to=simon.marchi@efficios.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@palves.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).