From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31436 invoked by alias); 16 Feb 2006 16:06:50 -0000 Received: (qmail 31420 invoked by uid 22791); 16 Feb 2006 16:06:46 -0000 X-Spam-Check-By: sourceware.org Received: from zigzag.lvk.cs.msu.su (HELO zigzag.lvk.cs.msu.su) (158.250.17.23) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 16 Feb 2006 16:06:42 +0000 Received: from Debian-exim by zigzag.lvk.cs.msu.su with spam-scanned (Exim 4.50) id 1F9leH-0007cr-TX for gdb@sources.redhat.com; Thu, 16 Feb 2006 19:06:38 +0300 Received: from zigzag.lvk.cs.msu.su ([158.250.17.23]) by zigzag.lvk.cs.msu.su with esmtp (Exim 4.50) id 1F9leH-0007co-PG for gdb@sources.redhat.com; Thu, 16 Feb 2006 19:06:29 +0300 From: Vladimir Prus To: gdb@sources.redhat.com Subject: Re: MI -thread-list-ids output issue Date: Thu, 16 Feb 2006 16:06:00 -0000 User-Agent: KMail/1.7.2 References: <20060216155606.GA11681@brasko.net> In-Reply-To: <20060216155606.GA11681@brasko.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200602161906.28549.ghost@cs.msu.su> Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-02/txt/msg00162.txt.bz2 On Thursday 16 February 2006 18:56, Bob Rossi wrote: > On Thu, Feb 16, 2006 at 06:48:01PM +0300, Vladimir Prus wrote: > > Hello! > > > > At the moment, the response to -thread-list-ids looks like this: > > > > ^done,thread-ids={thread-id="3",thread-id="2",thread-id="1"}, > > > > > > The grammar says that {} is a tuple, but not that all fields in the tuple > > have the same name, so it can be only indexed by integer. While this is > > allowed by the grammar, it's pretty inconvenient. > > > > Essentially this will require me to add, in MI parser I use, special > > operation "treat this as list, even though it looks like a tuple", which > > is pretty nasty. > > > > Maybe, it's still possible to change this output to be: > > > > ^done,thread-ids=["3","2","1"] > > > > Or, if changing the existing output is deemed impossible even in this > > case, what about: > > > > ^done,threads=["3", "2", "1"], > > thread-ids={thread-id="3",thread-id="2",thread-id="1"}, > > Do you have a small C example I can use to generate this output with > GDB? I would like to use the parser i have written to see if I have the > same problem you have. Sure: http://websvn.kde.org/branches/work/kdevelop-debugger-mi/tests/threads/ The .cpp extension does not matter -- it's C subset. The session is: -break-insert thread ^done,bkpt={number="1",type="breakpoint",disp="keep", enabled="y",addr="0x080484ea",func="thread(void*)", file="threads.cpp",line="6",times="0"} (gdb) -exec-run ^running (gdb) ~"[Thread debugging using libthread_db enabled]\n" ~"[New Thread -1211476288 (LWP 8708)]\n" ~"[New Thread -1211479120 (LWP 8726)]\n" ~"[New Thread -1219871824 (LWP 8727)]\n" ~"[Switching to Thread -1211479120 (LWP 8726)]\n" *stopped,reason="breakpoint-hit",bkptno="1",thread-id="2", frame={addr="0x080484ea",func="thread",args=[],file="threads.cpp", fullname="........../threads.cpp", line="6"} (gdb) -thread-list-ids ^done,thread-ids={thread-id="3",thread-id="2",thread-id="1"}, number-of-threads="3" (gdb) > Also, you wouldn't be able to change the output of MI in a non-backwards > compatible way unless a new major version of MI is released. Also, even > then, it's probably a bad idea. It might be good idea to start drafting all changes for a new MI version. Not that I understand why to change MI if I have to workaround all issues in current gdb/MI anyway :-/ - Volodya