This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
.gdb_index version 7
- From: Tom Tromey <tromey at redhat dot com>
- To: Binutils Development <binutils at sourceware dot org>
- Date: Fri, 29 Jun 2012 12:58:32 -0600
- Subject: .gdb_index version 7
.gdb_index recently got a new version:
2012-06-23 Doug Evans <dje@google.com>
PR 14125
* NEWS: Document additions to .gdb_index.
[...]
This patch updates readelf to dump the new information properly.
Ok?
Tom
2012-06-29 Tom Tromey <tromey@redhat.com>
* dwarf.c: Include gdb-index.h.
(display_gdb_index): Handle version 7.
Index: dwarf.c
===================================================================
RCS file: /cvs/src/src/binutils/dwarf.c,v
retrieving revision 1.116
diff -u -r1.116 dwarf.c
--- dwarf.c 8 Jun 2012 19:07:33 -0000 1.116
+++ dwarf.c 29 Jun 2012 18:57:11 -0000
@@ -28,6 +28,7 @@
#include "elf/common.h"
#include "dwarf2.h"
#include "dwarf.h"
+#include "gdb/gdb-index.h"
static const char *regname (unsigned int regno, int row);
@@ -5688,6 +5689,9 @@
warn (_("Version 5 does not include inlined functions.\n"));
break;
case 6:
+ warn (_("Version 6 does not include symbol attributes.\n"));
+ break;
+ case 7:
break;
default:
warn (_("Unsupported version %lu.\n"), (unsigned long) version);
@@ -5772,16 +5776,48 @@
printf ("[%3u] %s:", i, constant_pool + name_offset);
num_cus = byte_get_little_endian (constant_pool + cu_vector_offset, 4);
+ if (num_cus > 1)
+ printf ("\n");
for (j = 0; j < num_cus; ++j)
{
+ gdb_index_symbol_kind kind;
+
cu = byte_get_little_endian (constant_pool + cu_vector_offset + 4 + j * 4, 4);
+ kind = GDB_INDEX_SYMBOL_KIND_VALUE (cu);
+ cu = GDB_INDEX_CU_VALUE (cu);
/* Convert to TU number if it's for a type unit. */
if (cu >= cu_list_elements / 2)
- printf (" T%lu", (unsigned long) (cu - cu_list_elements / 2));
+ printf ("%cT%lu", num_cus > 1 ? '\t' : ' ',
+ (unsigned long) (cu - cu_list_elements / 2));
else
- printf (" %lu", (unsigned long) cu);
+ printf ("%c%lu", num_cus > 1 ? '\t' : ' ', (unsigned long) cu);
+
+ switch (kind)
+ {
+ case GDB_INDEX_SYMBOL_KIND_NONE:
+ printf (_(" [no symbol information]"));
+ break;
+ case GDB_INDEX_SYMBOL_KIND_TYPE:
+ printf (_(" [type]"));
+ break;
+ case GDB_INDEX_SYMBOL_KIND_VARIABLE:
+ printf (_(" [variable]"));
+ break;
+ case GDB_INDEX_SYMBOL_KIND_FUNCTION:
+ printf (_(" [function]"));
+ break;
+ case GDB_INDEX_SYMBOL_KIND_OTHER:
+ printf (_(" [other]"));
+ break;
+ default:
+ printf (_(" [unknown: %d]"), kind);
+ break;
+ }
+ if (num_cus > 1)
+ printf ("\n");
}
- printf ("\n");
+ if (num_cus <= 1)
+ printf ("\n");
}
}