From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11899 invoked by alias); 29 Jun 2009 09:36:40 -0000 Received: (qmail 11891 invoked by uid 22791); 29 Jun 2009 09:36:39 -0000 X-SWARE-Spam-Status: No, hits=-0.4 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from qw-out-1920.google.com (HELO qw-out-1920.google.com) (74.125.92.147) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 29 Jun 2009 09:36:34 +0000 Received: by qw-out-1920.google.com with SMTP id 5so1898300qwf.24 for ; Mon, 29 Jun 2009 02:36:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.96.213 with SMTP id i21mr3752895vcn.104.1246268192015; Mon, 29 Jun 2009 02:36:32 -0700 (PDT) In-Reply-To: References: <629542d40906281203o3601025at573704e36ee80565@mail.gmail.com> <200906290943.17323.andre.poenitz@nokia.com> Date: Mon, 29 Jun 2009 09:36:00 -0000 Message-ID: <629542d40906290236t2b879f1w7c6f4a4a558cd0ac@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/msg00289.txt.bz2 On Mon, Jun 29, 2009 at 10:59, Vladimir Prus wro= te: > Andr=E9 P=F6nitz wrote: > >> On Sunday 28 June 2009 21:03:01 Niko Sams wrote: >>> Hi, >>> >>> -stack-list-locals doesn't return an numchild element. How can the IDE >>> know if a local >>> is has children? >>> >>> If there are children, they are listed in value: >>> ^done,locals=3D[{name=3D"list",value=3D"QList =3D {[0] =3D \"hello\"}"}] >>> >>> Is it a good idea to parse the value with an regular expression to >>> find out if there are children? >> >> It would be really nice if 'type' and 'numchild' information was directly >> included in that "primary" output. The information is available on >> the gdb side, so parsing it from the 'value' field does not really look >> like a good solution in the long run. > > As I mention in other email, getting the number of children is in general > impossible. Maybe, "has_children" flag would be more appropriate -- this > is somewhat more likely to be computable. pretty printers could have an additional method to get numchild directly without iterating over them. But for a Tree-View has_children would be enough of course. > I am not sure it was you, but there was an IRC discussion about making > -stack-list-locals also print type of things -- can you describe exactly > how you gonna use that information, so that I have a chance to implement > that properly? We don't show a type column in KDevelop, but for example QtCreator does. Niko