Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] infrun: don't resume the inferior when we notice a new thread (new_thread_event).
Date: Mon, 28 May 2012 21:27:00 -0000	[thread overview]
Message-ID: <4FC3EDCF.2070200@redhat.com> (raw)
In-Reply-To: <20120528211937.GA14224@host2.jankratochvil.net>

On 05/28/2012 10:19 PM, Jan Kratochvil wrote:

> On Mon, 28 May 2012 22:46:23 +0200, Pedro Alves wrote:
>> If anyone as any idea why things are done in the current way, please
>> speak up.
> 
> Not much, just that linux-nat.c linux_handle_extended_wait has this code by
> you:
>           if (non_stop)
>             {
>               /* Add the new thread to GDB's lists as soon as possible
>                  so that:
>               if (!thread_db_attach_lwp (new_lp->ptid))
>                 {
>                   /* We're not using thread_db.  Add it to GDB's
>                      list.  */
>                   target_post_attach (GET_LWP (new_lp->ptid));
>                   add_thread (new_lp->ptid);
>                 }
> 


Yeah, I've mentioned before that I have second thoughts on that bit.
If the inferior spawns short-lived threads rapidly, doing this for all threads,
as opposed to refreshing the list on demand or when presenting a stop to user,
for example, slows down the debug, and generates a bunch of frontend refreshing
that is likely useless.

> And for !non_stop mode add_thread gets delayed till handle_inferior_event;
> which should not hurt.  If this add would be done unconditionally in
> linux-nat.c then this handle_inferior_event would never be reached.


Yeah, on GNU/Linux.  But it could in principle still be reached on
other targets.  I haven't audited all.

> But I do not see why to make that change, handle_inferior_event works.

-- 
Pedro Alves


  reply	other threads:[~2012-05-28 21:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-28 20:46 Pedro Alves
2012-05-28 21:19 ` Jan Kratochvil
2012-05-28 21:27   ` Pedro Alves [this message]
2012-06-06 18:12 ` Pedro Alves

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=4FC3EDCF.2070200@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.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