From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3892 invoked by alias); 15 Feb 2008 21:57:33 -0000 Received: (qmail 3880 invoked by uid 22791); 15 Feb 2008 21:57:33 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 15 Feb 2008 21:57:05 +0000 Received: from kahikatea.snap.net.nz (14.30.255.123.static.snap.net.nz [123.255.30.14]) by viper.snap.net.nz (Postfix) with ESMTP id EFF8E3DA860; Sat, 16 Feb 2008 10:57:02 +1300 (NZDT) Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id 6E1E58FC6D; Sat, 16 Feb 2008 10:56:53 +1300 (NZDT) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18358.2724.561605.528467@kahikatea.snap.net.nz> Date: Fri, 15 Feb 2008 21:57:00 -0000 To: "Marc Khouzam" Cc: Subject: RE: [RFC] Variable objects for STL containers In-Reply-To: <6D19CA8D71C89C43A057926FE0D4ADAA04290EED@ecamlmw720.eamcs.ericsson.se> References: <18354.25849.317151.537741@kahikatea.snap.net.nz> <6D19CA8D71C89C43A057926FE0D4ADAA04290EED@ecamlmw720.eamcs.ericsson.se> X-Mailer: VM 7.19 under Emacs 22.1.90.2 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-02/txt/msg00267.txt.bz2 > > Here's a sample transaction. Currently the variable object must be created > > after initialisation, e.g., > > > > -var-create - * v > > ^done,name="var1",numchild="1",value="{...}",type="std::vector >" > > (gdb) > > -var-list-children --all-values var1 > > ^done,numchild="4",children=[child={name="var1.0",exp="0",numchild="0",value="3",type="long"},child={name="var1.1",exp="1",numchild="0",value="0",type="int"},child={name="var1.2",exp="2",numchild="0",value="0",type="int"},child={name="var1.3",exp="3",numchild="0",value="0",type="int"}] > > > > so that GDB doesn't find a ridiculous (uninitialised) number of children. > > Note there are four children. > > Note that I didn't look at the details of the patch yet, so I may be missing > some info. I noticed that in the var-create response of the example above, > the number of children is only 1 instead of 4. Is that just a typo? No, it's real output :-). The patch doesn't check for STL containers until the user tries to expand the watch expression (-var-list-children is issued) although I guess, in the case of vectors, it would be quite easy to get the number of children immediately. -- Nick http://www.inet.net.nz/~nickrob