From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20547 invoked by alias); 17 Mar 2006 17:07:11 -0000 Received: (qmail 20488 invoked by uid 22791); 17 Mar 2006 17:07:08 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Fri, 17 Mar 2006 17:07:06 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FKIPl-000447-CF; Fri, 17 Mar 2006 12:07:01 -0500 Date: Fri, 17 Mar 2006 17:23:00 -0000 From: Daniel Jacobowitz To: Vladimir Prus Cc: gdb@sources.redhat.com Subject: Re: MI: variable objects: children naming Message-ID: <20060317170701.GA15128@nevyn.them.org> Mail-Followup-To: Vladimir Prus , gdb@sources.redhat.com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-03/txt/msg00128.txt.bz2 On Fri, Mar 17, 2006 at 04:20:07PM +0300, Vladimir Prus wrote: > (gdb) > -var-create TMP * m > ^done,name="TMP",numchild="3",type="int [3]" > (gdb) > -var-list-children TMP > ^done,numchild="3",children=[ > child={name="TMP.0",exp="0",numchild="0",type="int"}, > child={name="TMP.1",exp="1",numchild="0",type="int"}, > child={name="TMP.2",exp="2",numchild="0",type="int"}] > > > Suppose I display this to the user as a tree. If user selects first child of > "m" and wants to set watchpoint on it, I need to know the full name of > first child of "m". In C++, that would be m[0]. > > However, the information gdb prints does not allow me to compute m[0]: Is this the only thing you need the name for, or is it useful for other purposes in the user interface too? (Honest question - I have no idea.) If watchpoints are the only reason, then you could have a variant of a watchpoint command which took a varobj. > - Calling '-var-info-expression TMP.0' returns: > ^done,lang="C++",exp="0" > > It seems like Apple version has new command -var-info-path-expression, which > is not present in FSF version, and which supposedly will produce "m[0]". We'd have to ask Jim for the history, but why should we do this instead of fixing -var-info-expression? That behavior looks pretty wrong! -- Daniel Jacobowitz CodeSourcery