public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>,
	gdb-patches@sourceware.org
Subject: Re: [PATCH v5 3/5] gdb/remote: do not delete a thread if it has a pending event
Date: Thu, 16 Apr 2020 17:24:29 +0100	[thread overview]
Message-ID: <0d829b62-4926-b6d4-cd16-7071b5ccaed4@redhat.com> (raw)
In-Reply-To: <04e28369e2e3486bbf4dfa8154c140be317ab1e9.1586187408.git.tankut.baris.aktemur@intel.com>

On 4/6/20 4:45 PM, Tankut Baris Aktemur via Gdb-patches wrote:
> gdb/ChangeLog:
> 2020-04-06  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
> 
> 	* remote.c (remote_target::update_thread_list): Do not delete
> 	a thread if it has a pending event.
> ---
>  gdb/remote.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/gdb/remote.c b/gdb/remote.c
> index bfbc0bc21d3..12ac7cb9862 100644
> --- a/gdb/remote.c
> +++ b/gdb/remote.c
> @@ -3821,6 +3821,9 @@ remote_target::update_thread_list ()
>  	  if (tp->inf->process_target () != this)
>  	    continue;
>  
> +	  if (tp->suspend.waitstatus_pending_p)
> +	    continue;
> +

This patch makes me nervous.  :-/

Why doesn't prune_threads, via remote_target::thread_alive end
up removing the thread anyway?

I think it'd be better to extend the check to also check for
TARGET_WAITKIND_EXITED/TARGET_WAITKIND_SIGNALLED.  Let threads
with other kinds of events pending be deleted.

Other targets are likely to need something like this, but I'm
OK with going with remote-specific test to start with, so we
can all this in, including the testcase, and then work on
something more generic if we find a need.

In any case, please add some comments.

Thanks,
Pedro Alves


  reply	other threads:[~2020-04-16 16:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-06 15:45 [PATCH v5 0/5] Handling already-exited threads in 'stop_all_threads' Tankut Baris Aktemur
     [not found] ` <cover.1586187408.git.tankut.baris.aktemur@intel.com>
2020-04-06 15:45   ` [PATCH v5 1/5] gdb: protect some 'regcache_read_pc' calls Tankut Baris Aktemur
2020-04-16 16:11     ` Pedro Alves
2020-04-20 20:13       ` Aktemur, Tankut Baris
2020-04-06 15:45   ` [PATCH v5 2/5] gdb/infrun: move a 'regcache_read_pc' call down to first use Tankut Baris Aktemur
2020-04-16 16:12     ` Pedro Alves
2020-04-06 15:45   ` [PATCH v5 3/5] gdb/remote: do not delete a thread if it has a pending event Tankut Baris Aktemur
2020-04-16 16:24     ` Pedro Alves [this message]
2020-04-20 20:35       ` Aktemur, Tankut Baris
2020-04-21 18:54         ` Pedro Alves
2020-04-22 14:57           ` Aktemur, Tankut Baris
2020-04-06 15:45   ` [PATCH v5 4/5] gdb/infrun: extract out a code piece into 'mark_non_executing_threads' function Tankut Baris Aktemur
2020-04-16 16:24     ` Pedro Alves
2020-04-06 15:45   ` [PATCH v5 5/5] gdb/infrun: handle already-exited threads when attempting to stop Tankut Baris Aktemur
2020-04-16 17:06     ` Pedro Alves
2020-04-20 20:43       ` Aktemur, Tankut Baris

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=0d829b62-4926-b6d4-cd16-7071b5ccaed4@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tankut.baris.aktemur@intel.com \
    /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).