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

David Blaikie dblaikie@gmail.com
Wed Mar 10 21:34:16 GMT 2021


On Wed, Mar 10, 2021 at 1:27 PM Jakub Jelinek <jakub at redhat.com> wrote:

> On Wed, Mar 10, 2021 at 01:16:24PM -0800, Cary Coutant 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.
>
> My current patch to start using .debug_rnglists.dwo in GCC for -gdwarf-5
> -gstrict-dwarf
> will emit DW_AT_ranges in the .debug_info.dwo only (both in the CU and
> other
> DIEs there),


That seems unfortunate to me - I think having the CU ranges readily
accessible without loading dwo files is of significant value (& using
aranges to achieve this is a lot of size overhead/duplication - works
against the benefits of Split DWARF).

(if this is a first step with intended refinement/improvement later - sure,
I totally appreciate incremental development. Certainly LLVM's DWARFv5
support probably looked really weird along the way)


> but if I need a DW_AT_low_pc for the base address too, do you think
> it is ok to keep it in the DW_TAG_skeleton_unit with DW_FORM_addr?
>

I think it would be OK. I don't think there's anything about addr_base that
/requires/ all address type attributes to use addrx.

I'd still probably use addrx (even though keeping it in the skeleton unit)
though, since you'll probably benefit from having the address in the
address pool for other reasons (such as in rnglists and loclists) - so you
would have fewer relocations by having it one in debug_addr, rather than
once in the CU and then again in debug_addr for use elsewhere. (while the
exact address might not be used in rnglist/loclist - it can be a good base
address to use, which reduces the number of debug address relocations and
the size of debug_addr)


> If I had to move it to .debug_info.dwo DW_TAG_compile_unit, it would need
> to
> be DW_FORM_addrx there and in the end would require larger size.
>

Only if the address wasn't used elsewhere.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dwarfstd.org/pipermail/dwarf-discuss-dwarfstd.org/attachments/20210310/fee0bdef/attachment.html>



More information about the Dwarf-discuss mailing list