From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31606 invoked by alias); 11 Jul 2002 00:15:26 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 31597 invoked from network); 11 Jul 2002 00:15:25 -0000 Received: from unknown (HELO mta6.snfc21.pbi.net) (206.13.28.240) by sources.redhat.com with SMTP; 11 Jul 2002 00:15:25 -0000 Received: from modrick ([66.120.11.181]) by mta6.snfc21.pbi.net (iPlanet Messaging Server 5.1 (built May 7 2001)) with SMTP id <0GZ200DTC61OST@mta6.snfc21.pbi.net> for gdb@sources.redhat.com; Wed, 10 Jul 2002 17:15:25 -0700 (PDT) Date: Wed, 10 Jul 2002 17:15:00 -0000 From: Mo DeJong Subject: Problem with MI -var-evaluate-expression command To: gdb Message-id: <20020710171957.5e657753.supermo@bayarea.net> Organization: House of Mirth MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-SW-Source: 2002-07/txt/msg00112.txt.bz2 Hello gdbers. I have been looking at the GDB/MI recently and have run into a problem with the -var-evaluate-expression method that really seems like a bug. It seems one is unable to access children of a variable object unless the -var-list-children command has been run for that object. Here is a quick example to demonstrate what I mean. % cat S.c struct S { int v1; int v2; }; int main() { struct S* s = (struct S*) malloc(sizeof(struct S)); s->v1 = 0; s->v2 = 1; return 0; } (compile, then invoke with mi1) -file-exec-and-symbols S ^done (gdb) -break-insert S.c:9 ^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x080483ee",func="main",file="S.c",line="9",times="0"} (gdb) -var-create svar * "(struct S *) 0x8049560" ^done,name="svar",numchild="2",type="struct S *" (gdb) # I can access the variable -var-evaluate-expression svar ^done,value="0x8049560" (gdb) # But not the a child variable -var-evaluate-expression svar.v1 &"Variable object not found\n" ^error,msg="Variable object not found" (gdb) # I need to call -var-list-children first -var-list-children svar ^done,numchild="2",children={child={name="svar.v1",exp="v1",numchild="0",type="int"},child={name="svar.v2",exp="v2",numchild="0",type="int"}} (gdb) # Now it works -var-evaluate-expression svar.v1 ^done,value="0" (gdb) Is this a bug in the MI? It sure seems like one to me, but I thought I would ask to make sure. The docs don't mention anything about having to invoke the -var-evaluate-expression method before accessing children of a variable. cheers Mo DeJong