MI to access value of $ prefixed variable name

Jonah Graham <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAPmGMvihqU-f3s2PL09cFFZFfYGA6GLOv3HDLM4fm+0QawOPGg@mail.gmail.com>
Hello,

I have a user of Eclipse CDT who is having problems displaying a C variable
called $j (dollar sign prefixed variable) -
https://bugs.eclipse.org/bugs/show_bug.cgi?id=573703

I understand this is because $ prefixed variables are treated specially by
GDB.

47-stack-list-locals --thread 1 --frame 0 1
47^done,locals=[{name="$f",value="0"}]

52-var-create --thread 1 --frame 0 - * $f
52^done,name="var3",numchild="0",value="void",type="void",has_more="0"

Note type "void" above, $f is an int in the C code, but is indeed void (as
expected) in GDB. -stack-list-locals shows the correct value, but I can't
use the returned name back to -var-create because of the naming conflict.

There wasn't anything I saw in the help (
https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Variable-Objects.html)
on this topic.

Thanks for your help.
Jonah
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.