Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [non-stop] 08/10 linux native support
Date: Thu, 10 Jul 2008 17:15:00 -0000	[thread overview]
Message-ID: <20080710171518.GA19554@caradoc.them.org> (raw)
In-Reply-To: <200807101627.50156.pedro@codesourcery.com>

On Thu, Jul 10, 2008 at 04:27:49PM +0100, Pedro Alves wrote:
> > This (the thread_db_attach_lwp version) looks reasonable to me.  Ugly,
> > but reasonable.  Why do we need the parent's data?
> 
> Due to this:
> 
>  (gdb) r&
>  Starting program: /home/pedro/gdb/tests/threads32
>  (gdb) [Thread debugging using libthread_db enabled]
>  [New Thread 0xf7df0b90 (LWP 24154)]
>  [New Thread 0xf75efb90 (LWP 24155)]
>  info threads
>    3 Thread 0xf75efb90 (LWP 24155)  (running)
>    2 Thread 0xf7df0b90 (LWP 24154)  (running)
>  * 1 LWP 24151  (running)

Why didn't this thread get identified at the shared library event,
when libthread_db was loaded?  It already existed by then, being the
main thread.

> The issue here is that have_threads returns true here:
> 
> linux-thread-db.c:thread_db_wait
> ...
>   /* If we do not know about the main thread yet, this would be a good time to
>      find it.  */
>   if (ourstatus->kind == TARGET_WAITKIND_STOPPED && !have_threads ())
>     thread_db_find_new_threads ();
> 
> ... because there are already threads that thread_db learned about,
> so we'd not look for info regarding the main thread.

Which ought to fix this too; if we identify threads as soon as
libthread_db is activated then we won't reach this situation.  If
there's other places where we add a newly created thread without
walking all threads, then they can get a call similar to the above
(that's for the static application case where we won't get a handy
shared library event for libpthread.so).

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2008-07-10 17:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-15 21:10 Pedro Alves
2008-06-25 21:17 ` Daniel Jacobowitz
2008-06-25 22:03   ` Pedro Alves
2008-06-25 22:12     ` Pedro Alves
2008-06-25 22:52       ` Daniel Jacobowitz
2008-06-25 23:08     ` Daniel Jacobowitz
2008-07-02  3:35       ` Pedro Alves
2008-07-07 18:20         ` Daniel Jacobowitz
2008-07-09  3:25           ` Michael Snyder
2008-07-09  3:47             ` Daniel Jacobowitz
2008-07-09  3:55               ` Michael Snyder
2008-07-09  7:55                 ` Mark Kettenis
2008-07-09  7:56             ` Mark Kettenis
2008-07-10 15:28           ` Pedro Alves
2008-07-10 17:15             ` Daniel Jacobowitz [this message]
2008-07-10 18:01               ` Pedro Alves
2008-07-10 19:59                 ` Daniel Jacobowitz
2008-07-10 21:51                   ` Pedro Alves
2008-07-10 22:15                     ` Daniel Jacobowitz
2008-07-10 23:01                       ` 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=20080710171518.GA19554@caradoc.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.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