From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8258 invoked by alias); 29 Jun 2009 09:33:04 -0000 Received: (qmail 8240 invoked by uid 22791); 29 Jun 2009 09:33:03 -0000 X-SWARE-Spam-Status: No, hits=-0.7 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-qy0-f191.google.com (HELO mail-qy0-f191.google.com) (209.85.221.191) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 29 Jun 2009 09:32:54 +0000 Received: by qyk29 with SMTP id 29so4664914qyk.12 for ; Mon, 29 Jun 2009 02:32:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.85.198 with SMTP id p6mr1369646vcl.48.1246267971837; Mon, 29 Jun 2009 02:32:51 -0700 (PDT) In-Reply-To: <200906291038.07907.andre.poenitz@nokia.com> References: <629542d40906281203o3601025at573704e36ee80565@mail.gmail.com> <200906290943.17323.andre.poenitz@nokia.com> <19016.30632.619762.345807@totara.tehura.co.nz> <200906291038.07907.andre.poenitz@nokia.com> Date: Mon, 29 Jun 2009 09:33:00 -0000 Message-ID: <629542d40906290232p3ebcbb75k4bec2e570821facd@mail.gmail.com> Subject: Re: -stack-list-locals and children From: Niko Sams To: gdb Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-06/txt/msg00288.txt.bz2 On Mon, Jun 29, 2009 at 10:38, Andr=E9 P=F6nitz wr= ote: > On Monday 29 June 2009 10:13:28 Nick Roberts wrote: >> =A0> > -stack-list-locals doesn't return an numchild element. How can th= e IDE >> =A0> > know if a local >> =A0> > is has children? >> =A0> > >> =A0> > If there are children, they are listed in value: >> =A0> > ^done,locals=3D[{name=3D"list",value=3D"QList =3D {[0] =3D \"hell= o\"}"}] >> =A0> > >> =A0> > Is it a good idea to parse the value with an regular expression to >> =A0> > find out if there are children? >> =A0> >> =A0> It would be really nice if 'type' and 'numchild' information was di= rectly >> =A0> included in that "primary" output. The information is available on >> =A0> the gdb side, so parsing it from the 'value' field does not really = look >> =A0> like a good solution in the long run. >> >> What would you do with this information? > > Use it in a GUI frontend to determine whether the item should be > expandable or not. > >> Note that -stack-list-locals --simple-values _does_ give type informatio= n and, >> if this is presented to the user, he can usually infer the number of chi= ldren. >> In the manual: >> >> =A0 =A0 =A0-stack-list-locals --simple-values >> =A0 =A0 =A0^done,locals=3D[{name=3D"A",type=3D"int",value=3D"1"}, >> =A0 =A0 =A0 =A0{name=3D"B",type=3D"int",value=3D"2"},{name=3D"C",type=3D= "int [3]"}] >> =A0 =A0 =A0(gdb) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ^^^^^^^ >> >> C has three children. > > Sure I can filter out whatever information is implicitly provided in the = output, > and ask for more if needed. But as roundtrips through gdb are expensive > time-wise It would be nicer though if all information necessary to build = the > top level of the typical "variable view" could be extracted from gdb in o= ne go. That would be very nice. Additionally the arguments could show up in locals too - so -stack-list-arguments can be skipped. Niko