From: Tom Tromey Date: Mon, 2 Jan 2023 17:24:26 +0000 (-0700) Subject: Add type to expression dump of symbol X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d66641b604182246b648f662d3c32200ac921365;p=binutils-gdb.git 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 --- 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