This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: MI: variable objects: children naming
- From: Daniel Jacobowitz <drow at false dot org>
- To: Vladimir Prus <ghost at cs dot msu dot su>
- Cc: gdb at sources dot redhat dot com
- Date: Fri, 17 Mar 2006 12:07:01 -0500
- Subject: Re: MI: variable objects: children naming
- References: <dved27$ja$1@sea.gmane.org>
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