From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11323 invoked by alias); 15 Feb 2008 14:29:05 -0000 Received: (qmail 11310 invoked by uid 22791); 15 Feb 2008 14:29:04 -0000 X-Spam-Check-By: sourceware.org Received: from imr1.ericy.com (HELO imr1.ericy.com) (198.24.6.9) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 15 Feb 2008 14:28:43 +0000 Received: from eusrcmw750.eamcs.ericsson.se (eusrcmw750.exu.ericsson.se [138.85.77.50]) by imr1.ericy.com (8.13.1/8.13.1) with ESMTP id m1FESaxE005516; Fri, 15 Feb 2008 08:28:36 -0600 Received: from ecamlmw720.eamcs.ericsson.se ([142.133.1.72]) by eusrcmw750.eamcs.ericsson.se with Microsoft SMTPSVC(6.0.3790.1830); Fri, 15 Feb 2008 08:28:36 -0600 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [RFC] Variable objects for STL containers Date: Fri, 15 Feb 2008 14:29:00 -0000 Message-ID: <6D19CA8D71C89C43A057926FE0D4ADAA04290EED@ecamlmw720.eamcs.ericsson.se> In-Reply-To: <18354.25849.317151.537741@kahikatea.snap.net.nz> From: "Marc Khouzam" To: "Nick Roberts" , 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/msg00254.txt.bz2 Hi, > Here's a sample transaction. Currently the variable object must be creat= ed > after initialisation, e.g., >=20 > -var-create - * v > ^done,name=3D"var1",numchild=3D"1",value=3D"{...}",type=3D"std::vector >" > (gdb)=20 > -var-list-children --all-values var1 > ^done,numchild=3D"4",children=3D[child=3D{name=3D"var1.0",exp=3D"0",numch= ild=3D"0",value=3D"3",type=3D"long"},child=3D{name=3D"var1.1",exp=3D"1",num= child=3D"0",value=3D"0",type=3D"int"},child=3D{name=3D"var1.2",exp=3D"2",nu= mchild=3D"0",value=3D"0",type=3D"int"},child=3D{name=3D"var1.3",exp=3D"3",n= umchild=3D"0",value=3D"0",type=3D"int"}] >=20 > 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 missin= g 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? Also I wanted to point out that with Eclipse, it may prove tricky to create a variable object after initialization. In eclipse, when starting a debugg= ed program, the user (most) often selects the "Stop at main" option; that means that th= e program will start showing variables right at main(). Since the command -stack-list-locals shows all locals, even if they have not been declared ye= t, we don't know if that variable is initialized yet, and we'll do the var-create= and var-list-children right away. Is there a way to know that a variable has not been declared yet? Or maybe we can add some support in GDB for this? Marc