public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* MI to access value of $ prefixed variable name
@ 2021-05-25  4:35 Jonah Graham
  2021-05-25 14:03 ` Simon Marchi
  0 siblings, 1 reply; 4+ messages in thread
From: Jonah Graham @ 2021-05-25  4:35 UTC (permalink / raw)
  To: GDB Development

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-01 18:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-25  4:35 MI to access value of $ prefixed variable name Jonah Graham
2021-05-25 14:03 ` Simon Marchi
2021-05-25 17:11   ` Jonah Graham
2021-06-01 18:57   ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).