From: Jonah Graham <jonah@kichwacoders.com>
To: GDB Development <gdb@sourceware.org>
Subject: MI to access value of $ prefixed variable name
Date: Tue, 25 May 2021 00:35:09 -0400 [thread overview]
Message-ID: <CAPmGMvihqU-f3s2PL09cFFZFfYGA6GLOv3HDLM4fm+0QawOPGg@mail.gmail.com> (raw)
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
next reply other threads:[~2021-05-25 4:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-25 4:35 Jonah Graham [this message]
2021-05-25 14:03 ` Simon Marchi
2021-05-25 17:11 ` Jonah Graham
2021-06-01 18:57 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPmGMvihqU-f3s2PL09cFFZFfYGA6GLOv3HDLM4fm+0QawOPGg@mail.gmail.com \
--to=jonah@kichwacoders.com \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).