public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Add type to expression dump of symbol
@ 2023-01-02 17:28 Tom Tromey
  2023-01-05  7:48 ` Bruno Larsen
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2023-01-02 17:28 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

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


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

end of thread, other threads:[~2023-01-05 15:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-02 17:28 [PATCH] Add type to expression dump of symbol Tom Tromey
2023-01-05  7:48 ` Bruno Larsen
2023-01-05 15:08   ` 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).