From: Pedro Alves <palves@redhat.com>
To: Hui Zhu <hui_zhu@mentor.com>
Cc: gdb-patches@sourceware.org, "Gustavo, Luis" <luis_gustavo@mentor.com>
Subject: Re: [PATCH] remote doesn't add the main thread if we didn't do so already
Date: Tue, 26 Feb 2013 12:08:00 -0000 [thread overview]
Message-ID: <512CA5B8.2000706@redhat.com> (raw)
In-Reply-To: <512B447F.8040309@mentor.com>
Hi Hui, Luis,
Thanks for the patch.
On 02/25/2013 11:01 AM, Hui Zhu wrote:
> Hi,
>
> This is the patch to change function add_current_inferior_and_thread that doesn't add the main thread if we didn't do so already.
>
I have the mild impression I've seen this change before, but heck
if I recall any details, and I may be wrong. Can you or Luis
expand on the background/rationale for this change?
Thanks.
> Thanks,
> Hui
>
> 2013-02-25 Luis Machado <lgustavo@codesourcery.com>
>
> * remote.c (add_current_inferior_and_thread): Only add the main
> thread if we didn't do so already.
>
> --- a/gdb/remote.c
> +++ b/gdb/remote.c
> @@ -3316,10 +3316,16 @@ add_current_inferior_and_thread (char *w
> fake_pid_p = 1;
> }
>
> - remote_add_inferior (fake_pid_p, ptid_get_pid (inferior_ptid), -1);
> + /* Only add the main thread if we didn't do so already. Some
> + targets don't support listing threads, so we need to handle
> + inclusion of the main thread here. */
> + if (!in_thread_list (inferior_ptid))
> + {
> + remote_add_inferior (fake_pid_p, ptid_get_pid (inferior_ptid), -1);
>
> - /* Add the main thread. */
> - add_thread_silent (inferior_ptid);
> + /* Add the main thread. */
> + add_thread_silent (inferior_ptid);
> + }
> }
>
> static void
next prev parent reply other threads:[~2013-02-26 12:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-25 11:01 Hui Zhu
2013-02-26 12:08 ` Pedro Alves [this message]
2013-02-26 14:40 ` Hui Zhu
2013-02-26 14:49 ` Pedro Alves
2013-02-27 2:00 ` Hui Zhu
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=512CA5B8.2000706@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=hui_zhu@mentor.com \
--cc=luis_gustavo@mentor.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