All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Paul Brook <paul@codesourcery.com>
Cc: qemu-devel@nongnu.org, Nathan Froyd <froydnj@codesourcery.com>
Subject: Re: [Qemu-devel] [PATCH] fix gdbstub support for multiple threads in usermode, v2
Date: Tue, 2 Jun 2009 16:46:09 -0400	[thread overview]
Message-ID: <20090602204609.GA20952@caradoc.them.org> (raw)
In-Reply-To: <200906022108.15384.paul@codesourcery.com>

On Tue, Jun 02, 2009 at 09:08:14PM +0100, Paul Brook wrote:
> On Tuesday 02 June 2009, Nathan Froyd wrote:
> > When debugging multi-threaded programs, QEMU's gdb stub would report the
> > correct number of threads (the qfThreadInfo and qsThreadInfo packets).
> > However, the stub was unable to actually switch between threads (the T
> > packet), since it would report every thread except the first as being
> > dead.  Furthermore, the stub relied upon cpu_index as a reliable means
> > of assigning IDs to the threads.  This was a bad idea; if you have this
> > sequence of events:
> >
> > initial thread created
> > new thread #1
> > new thread #2
> > thread #1 exits
> > new thread #3
> >
> > thread #3 will have the same cpu_index as thread #1, which would confuse
> > GDB.
> 
> Really? Why doesn't GDB get confused on real machines when the PID wraps?

It would, if using gdbserver and no one had done 'info threads' in between.

> Is the real bug that we're missing some sort of thread creation/destruction 
> event reporting?

The remote protocol doesn't have creation/destruction events (yet;
it's a known limitation).

-- 
Daniel Jacobowitz
CodeSourcery

  reply	other threads:[~2009-06-02 20:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-02 19:53 [Qemu-devel] [PATCH] fix gdbstub support for multiple threads in usermode, v2 Nathan Froyd
2009-06-02 20:08 ` Paul Brook
2009-06-02 20:46   ` Daniel Jacobowitz [this message]
2009-06-02 20:54   ` Nathan Froyd
2009-06-02 21:14     ` Paul Brook
2009-06-02 21:48       ` Nathan Froyd
2009-06-02 21:56         ` Paul Brook
2009-06-16 19:11           ` [Qemu-devel] " Antti P Miettinen
2009-06-16 19:25             ` Paul Brook
2009-06-16 20:02               ` Antti P Miettinen
2009-06-17 16:39               ` Jan Kiszka
2009-06-02 22:44         ` Jan Kiszka

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=20090602204609.GA20952@caradoc.them.org \
    --to=drow@false.org \
    --cc=froydnj@codesourcery.com \
    --cc=paul@codesourcery.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.