[Dwarf-Discuss] Interaction between aranges and unit proposals

Mark Wielaard mjw at redhat.com
Tue Apr 8 01:01:42 PDT 2014

On Thu, 2014-04-03 at 11:32 +0200, Mark Wielaard wrote:
> Yes, all true. So you have to either generate (empty) arange headers for
> all the TUs and PUs or move the no-ranges units somewhere else for the
> consumer to be able to check the aranges table is complete.
> Personally I think it makes sense to just mandate that producers make
> sure the aranges headers are complete. Then you don't need to guess
> whether there are some units not covered. Which means you don't need
> producers to generate empty arange headers and you don't need the add
> the debug info length to allow consumers to check whether all units are
> covered. (Which is actually what we do in elfutils, we just
> complain/file bugs against producers that don't generate aranges. GDB is
> just a nicer consumer that tries to get things correct, but that does
> mean a big memory/speed penalty at the moment unless both 100430.1 and
> 100430.2 are adopted.)

I forgot to say why I am pushing a bit to get these proposals adopted
for DWARFv5 or at least make sure aranges are complete enough, even with
merged units, so they aren't needed. As is GDB cannot use aranges
reliably (without the memory/speed penalty of scanning all CUs). And
they invented a similar table format that they can use reliably because
it does provide the guarantees needed to not having to scan all CUs if
at all possible to make the address index table complete. [*]

This situation is slightly unfortunate since it means mostly duplication
of the aranges information. This wastes space and various tools (the GNU
linker, dwz, etc.) now have to process both tables when doing
transformations on the DWARF/GDB debug information.

Since the table format GDB came up with does seem usable as is one
option would be for us to adopt it instead of using .debug_aranges in
our tools and just turn off .debug_aranges information in the DWARF
producers. But I would prefer a situation where GDB was able to use
standard DWARF indexes and tools don't have to support both or pick one
or the other.

So if we can make some changes to the .debug_aranges format so that GDB
can start using it as is with DWARFv5 that would be great. I think that
is easiest done through adopting the aranges enhancement proposals and
making sure the merged unit proposal doesn't conflict with the goal of
having complete coverage of the aranges index. But any other solution
that would make it so that tools don't have to invent their own index
tables would be fine of course.



[*] It is the address area part of the .gdb_index section format:

More information about the Dwarf-Discuss mailing list