From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH] Add type to expression dump of symbol
Date: Mon, 2 Jan 2023 10:28:13 -0700 [thread overview]
Message-ID: <20230102172813.997882-1-tromey@adacore.com> (raw)
I recently had cause to dump some expressions from gdb. I got output
like this:
Operation: BINOP_GTR
Operation: OP_VAR_VALUE
Block symbol:
Symbol: small_value
Block: 0x39b4c20
Operation: OP_LONG
Operation: OP_LONG
Type: int
Constant: 0x0000000000000014
This is ok, but it would have been handy to see the type of the
symbol. This ptach adds this information.
---
gdb/expprint.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/gdb/expprint.c b/gdb/expprint.c
index a873cf8df74..11aeed4b6f7 100644
--- a/gdb/expprint.c
+++ b/gdb/expprint.c
@@ -114,6 +114,7 @@ dump_for_expression (struct ui_file *stream, int depth, symbol *sym)
{
gdb_printf (stream, _("%*sSymbol: %s\n"), depth, "",
sym->print_name ());
+ dump_for_expression (stream, depth + 1, sym->type ());
}
void
--
2.38.1
next reply other threads:[~2023-01-02 17:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-02 17:28 Tom Tromey [this message]
2023-01-05 7:48 ` Bruno Larsen
2023-01-05 15:08 ` 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=20230102172813.997882-1-tromey@adacore.com \
--to=tromey@adacore.com \
--cc=gdb-patches@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).