variable objects (was: [rfc] Annotation level THREE)
Nick Roberts
nick@nick.uklinux.net
Sun Mar 30 14:59:00 GMT 2003
Andrew Cagney writes:
> > -var-create - * i
> > ^done,name="var1",numchild="0",type="int"
> > (gdb)
> > -var-create - * r
> > ^done,name="var2",numchild="10",type="double [10]"
> > (gdb)
> > set var i=3
>
> Do -var-assign or -var-evaluate-expression work? Regardless, this looks
> like a bug.
>
> > &"set var i=3\n"
> > ^done
> > (gdb)
> > -var-update *
> > ^done,changelist=[{name="var1",in_scope="true",type_changed="false"}]
> > (gdb)
> > set var r[3]=6
> > &"set var r[3]=6\n"
> > ^done
> > (gdb)
> > -var-update *
> > ^done,changelist=[]
> > (gdb)
>
If -var-assign is used (or, indeed, if the array element is changed within
execution) then the changelist reflects this e.g
-var-assign var2.3 6
^done,value="6"
(gdb)
-var-update *
^done,changelist=[{name="var2.3",in_scope="true",type_changed="false"}]
(gdb)
-var-evaluate-expression gives the following:
-var-evaluate-expression var2
^done,value="[10]"
(gdb)
which possibly explains why nothing appears in the changelist when the CLI
command (set var r[3]=6) is used as the array size is not editable:
-var-show-attributes var2
^done,attr="noneditable"
(gdb)
This is only a problem when trying to control GDB using both CLI and MI
commands which is what we would like to do in Emacs. Do Apple (Project
Builder?) or Eclipse have a console where CLI commands can be entered?
Nick
More information about the Gdb
mailing list