This is the mail archive of the gdb@sources.redhat.com 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 command for evaluating arrays/structures?


With variable objects, it apears that the value of array elements and structure
members must be accessed individually. 

For example if I have an array ival[100], I can create a variable object, var1,
with:

-var-create - * ival

Then typing:
-var-evaluate-expression var1

gives:
^done,value="[100]"

I can then list all the elements (but not access their values) with:
-var-list-children var1

Values must be accessed individually with commands like:
-var-evaluate-expression var2.1

If I expand the display of array or structure with the mode that I've written
for Emacs (in the speedbar but in the same style as watch expressions in
Insight) the problem that I find is that it takes to long to process the a
separate MI command for each element/member.

Would it be possible to adapt -var-evaluate-expression so that it works
like -stack-list-locals? That is:

With an argument of 0 prints only the names (numchild, type etc) of the
variables, with argument of 1 prints also their values.

What do you think?

Nick


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