public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* MI: variable objects: children naming
@ 2006-03-17 14:56 Vladimir Prus
  2006-03-17 17:23 ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Vladimir Prus @ 2006-03-17 14:56 UTC (permalink / raw)
  To: gdb


Hello!

I've trying to figure out if I should use variable objects in KDevelop, and
run into some issue.

Assume that 'm' is a variable of type array of something. Here's a sample
session:

    (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]:

  - that name is not present anywhere in the output
  - I can't do it myself, because I don't know that 'm' is an
    array, at least without manually parsing the 'type' field.
  - 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]".

Would it be good to port it? Any other suggestiions?

- Volodya














^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-03-20  6:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-17 14:56 MI: variable objects: children naming Vladimir Prus
2006-03-17 17:23 ` Daniel Jacobowitz
2006-03-17 19:42   ` Jim Ingham
2006-03-20 23:11   ` Vladimir Prus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).