[RFA] dwarf.c (display_gdb_index): Include static/global information
dje@google.com
dje@google.com
Mon Sep 10 17:26:00 GMT 2012
Hi.
The .gdb_index pretty-printer currently doesn't print the static/global bit.
This is useful in debugging gcc output.
Ok to check in?
[I don't know how you want to handle i18n here.
I didn't want to spend too much time guessing, so I picked
something that works. Let me know if you want changes.]
2012-09-10 Doug Evans <dje@google.com>
* dwarf.c (display_gdb_index): Include static/global information
of each symbol.
Index: dwarf.c
===================================================================
RCS file: /cvs/src/src/binutils/dwarf.c,v
retrieving revision 1.119
diff -u -p -r1.119 dwarf.c
--- dwarf.c 7 Sep 2012 01:22:21 -0000 1.119
+++ dwarf.c 10 Sep 2012 17:23:21 -0000
@@ -5793,9 +5793,11 @@ display_gdb_index (struct dwarf_section
printf ("\n");
for (j = 0; j < num_cus; ++j)
{
+ int is_static;
gdb_index_symbol_kind kind;
cu = byte_get_little_endian (constant_pool + cu_vector_offset + 4 + j * 4, 4);
+ is_static = GDB_INDEX_SYMBOL_STATIC_VALUE (cu);
kind = GDB_INDEX_SYMBOL_KIND_VALUE (cu);
cu = GDB_INDEX_CU_VALUE (cu);
/* Convert to TU number if it's for a type unit. */
@@ -5811,19 +5813,30 @@ display_gdb_index (struct dwarf_section
printf (_(" [no symbol information]"));
break;
case GDB_INDEX_SYMBOL_KIND_TYPE:
- printf (_(" [type]"));
+ printf (is_static
+ ? _(" [static type]")
+ : _(" [global type]"));
break;
case GDB_INDEX_SYMBOL_KIND_VARIABLE:
- printf (_(" [variable]"));
+ printf (is_static
+ ? _(" [static variable]")
+ : _(" [global variable]"));
break;
case GDB_INDEX_SYMBOL_KIND_FUNCTION:
- printf (_(" [function]"));
+ printf (is_static
+ ? _(" [static function]")
+ : _(" [global function]"));
break;
case GDB_INDEX_SYMBOL_KIND_OTHER:
- printf (_(" [other]"));
+ printf (is_static
+ ? _(" [static other]")
+ : _(" [global other]"));
break;
default:
- printf (_(" [unknown: %d]"), kind);
+ printf (is_static
+ ? _(" [static unknown: %d]")
+ : _(" [global unknown: %d]"),
+ kind);
break;
}
if (num_cus > 1)
More information about the Binutils
mailing list