qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] fix gdbstub support for multiple threads in use


From: Daniel Jacobowitz
Subject: Re: [Qemu-devel] [PATCH] fix gdbstub support for multiple threads in usermode, v2
Date: Tue, 2 Jun 2009 16:46:09 -0400
User-agent: Mutt/1.5.17 (2008-05-11)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]