Hi Roland,
I'm dubious about this. The .gdb_index format is not standardized even in the GNU sense.
How does GNU standardization work BTW? Is there some GNU tools list?
It's entirely gdb's private business. Unless and until it becomes a standard thing that an elfutils tool could generate itself by well-specified rules not involving language-specific knowledge, I think this belongs in its own gdb-specific tool.
I don't think it involves any language-specific knowledge. And although the documentation is somewhat hidden (see the comment in the patch where to find it). I could write this just by going from the documentation.
On the one hand I agree, it is a somewhat odd section. And I was actually going to suggest that it gets generated as something separate. Currently it takes up about ~10% of the .debug files.
On the other hand, it is kind of standard now, and is part of the standard elf sections even we already recognize in ebl. Which means tools like eu-strip for example already handle it specially. And since it does take up so much space in the standard separate debuginfo files it makes sense to want to inspect it. It is also properly versioned, so we can recognize whether or not we can parse it. And seeing it is so big, we really should look into either making it work with other tools, or look at what it provides gdb, so we can improve the standard indexes to make other tools also benefit.
What about a compromise? We don't print is by default with -w/--dump-debug, but only when explicitly requested?
diff --git a/src/readelf.c b/src/readelf.c index 7250bb3..f4b427e 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -189,11 +189,12 @@ static enum section_e section_macinfo = 256, /* .debug_macinfo */ section_ranges = 512, /* .debug_ranges */ section_exception = 1024, /* .eh_frame & al. */ - section_gdb_index = 2048, /* .gdb_index */ + section_gdb_index = 2048, /* .gdb_index, like a .debug section, + but not printed by default. */ section_all = (section_abbrev | section_aranges | section_frame | section_info | section_line | section_loc | section_pubnames | section_str | section_macinfo - | section_ranges | section_exception | section_gdb_index) + | section_ranges | section_exception) } print_debug_sections, implicit_debug_sections;
/* Select hex dumping of sections. */
Thanks,
Mark