[Dwarf-Discuss] Split Dwarf vs. CU DW_AT_ranges / DW_AT_low_pc placement

David Blaikie dblaikie@gmail.com
Wed Mar 10 21:26:56 GMT 2021


On Wed, Mar 10, 2021 at 1:16 PM Cary Coutant <ccoutant at gmail.com> wrote:

> > But what about the DW_AT_ranges on the skeleton CU when using split
> DWARF?
> >
> > Are you suggesting that both LLVM and GCC's emission is incorrect - and
> that it's not possible to use rnglistx in the skeleton CU (instead you must
> use sec_offset for DW_AT_ranges on the skeleton CU)? (& that there's no way
> to refer to range lists in the .o (debug_rnglists) from the .dwo - all
> ranges in the split full unit must be in debug_rnglists.dwo?)
>
> If you've moved range lists over to the dwo, having DW_AT_ranges in
> the skeleton CU would be pointless ? the consumer would still have to
> go find the dwo to get the ranges.
>
> For the case you suggested where it would be useful to keep the range
> list for the CU in the .o file, I think .debug_aranges is what you're
> looking for.
>

aranges has been off by default in LLVM for a while - it adds a lot of
overhead (doesn't have all the nice rnglist encodings for instance - nor
can it use debug_addr, and if it did it'd still be duplicate with the CU
ranges wherever they were).

DWARFv5 says:

"A skeleton compilation unit may have additional attributes, which are the
same as for conventional compilation unit entries except as noted, from
among the following:
  2. Either a DW_AT_low_pc and DW_AT_high_pc pair of attributes or a
DW_AT_ranges attribute."

and

"The following attributes are not part of a split full compilation unit
entry but instead are inherited (if present) from the corresponding
skeleton compilation unit: DW_AT_low_pc, DW_AT_high_pc, DW_AT_ranges, ..."

Even before the rnglist move, this still disallowed using DW_AT_low/high_pc
with addrx encodings from the split full unit, instead requiring them to be
in the skeleton unit. I think this is the right call (& guess it was
motivated by this use case) to make for cheap unit lookup.

- Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dwarfstd.org/pipermail/dwarf-discuss-dwarfstd.org/attachments/20210310/29705ba8/attachment.html>



More information about the Dwarf-discuss mailing list