This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
MI command for evaluating arrays/structures?
- From: Nick Roberts <nick at nick dot uklinux dot net>
- To: gdb at sources dot redhat dot com
- Date: Sun, 19 Oct 2003 21:46:15 +0100
- Subject: 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