This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

MI: variable objects: children naming


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















Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]