public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Add type to expression dump of symbol
@ 2023-01-05 15:31 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2023-01-05 15:31 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d66641b604182246b648f662d3c32200ac921365

commit d66641b604182246b648f662d3c32200ac921365
Author: Tom Tromey <tromey@adacore.com>
Date:   Mon Jan 2 10:24:26 2023 -0700

    Add type to expression dump of symbol
    
    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 patch adds this information.
    
    Reviewed-By: Bruno Larsen <blarsen@redhat.com>

Diff:
---
 gdb/expprint.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gdb/expprint.c b/gdb/expprint.c
index 49d840be9c6..b70645fac92 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-05 15:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-05 15:31 [binutils-gdb] Add type to expression dump of symbol 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).