From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21320 invoked by alias); 29 Jun 2009 08:13:41 -0000 Received: (qmail 21310 invoked by uid 22791); 29 Jun 2009 08:13:39 -0000 X-SWARE-Spam-Status: No, hits=0.0 required=5.0 tests=AWL,BAYES_00,BOTNET,SPF_PASS X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.25) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 29 Jun 2009 08:13:33 +0000 Received: from totara (198.30.255.123.dynamic.snap.net.nz [123.255.30.198]) by viper.snap.net.nz (Postfix) with ESMTP id 7949A3D9EDE; Mon, 29 Jun 2009 20:13:30 +1200 (NZST) Received: by totara (Postfix, from userid 1000) id AEA5CC13F; Mon, 29 Jun 2009 20:13:28 +1200 (NZST) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19016.30632.619762.345807@totara.tehura.co.nz> Date: Mon, 29 Jun 2009 08:13:00 -0000 To: =?iso-8859-1?q?Andr=E9_P=F6nitz?= Cc: gdb@sourceware.org Subject: Re: -stack-list-locals and children In-Reply-To: <200906290943.17323.andre.poenitz@nokia.com> References: <629542d40906281203o3601025at573704e36ee80565@mail.gmail.com> <200906290943.17323.andre.poenitz@nokia.com> From: nickrob@snap.net.nz (Nick Roberts) 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/msg00282.txt.bz2 > > -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=[{name="list",value="QList = {[0] = \"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. What would you do with this information? Note that -stack-list-locals --simple-values _does_ give type information and, if this is presented to the user, he can usually infer the number of children. In the manual: -stack-list-locals --simple-values ^done,locals=[{name="A",type="int",value="1"}, {name="B",type="int",value="2"},{name="C",type="int [3]"}] (gdb) ^^^^^^^ C has three children. Remember that these aren't variable objects but in Emacs, at least, you can make variable objects from them simply by clicking mouse-2 on them in the locals buffer. It can be expensive to make variable objects from all the locals every time the frame changes but this is what Insight does, and Apple GDB has MI code to do it. So maybe Xcode does too. -- Nick http://www.inet.net.nz/~nickrob