From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MBaHY-0006T7-G6 for qemu-devel@nongnu.org; Tue, 02 Jun 2009 16:08:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MBaHT-0006Mu-Lf for qemu-devel@nongnu.org; Tue, 02 Jun 2009 16:08:23 -0400 Received: from [199.232.76.173] (port=32875 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MBaHT-0006Mr-9u for qemu-devel@nongnu.org; Tue, 02 Jun 2009 16:08:19 -0400 Received: from mx20.gnu.org ([199.232.41.8]:63996) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MBaHS-0007ox-Em for qemu-devel@nongnu.org; Tue, 02 Jun 2009 16:08:18 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MBaHR-0003nc-Dd for qemu-devel@nongnu.org; Tue, 02 Jun 2009 16:08:17 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH] fix gdbstub support for multiple threads in usermode, v2 Date: Tue, 2 Jun 2009 21:08:14 +0100 References: <1243972429-7972-1-git-send-email-froydnj@codesourcery.com> In-Reply-To: <1243972429-7972-1-git-send-email-froydnj@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906022108.15384.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Nathan Froyd 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? Is the real bug that we're missing some sort of thread creation/destruction event reporting? Paul