<div dir="ltr"><div>I still think the commentary on the indexes isn't quite right. They're separate from this issue - you'd still need the rnglists base, or have to assume that it's sizeof(header), to go that far into the region described by the index.<br><br>The index essentially makes a DWP look like a bunch of separate DWO files - so the rules that apply to the DWO file apply equally to the DWP file.<br><br><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Sat, Jan 11, 2025 at 4:04 PM David Anderson via Dwarf-discuss <<a href="mailto:dwarf-discuss@lists.dwarfstd.org">dwarf-discuss@lists.dwarfstd.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"># `DW_AT_rnglists_base` missing<br>
<br>
## BACKGROUND<br>
<br>
If a split-full CU uses `DW_FORM_rnglistx`,<br>
is a `DW_AT_rnglists_base` required?<br></blockquote><div><br>It's also specified in figure F.1, page 395 of DWARFv5 that loclists_base and rnglists_base only appear on the full & partial units.<br>Though I'd argue it'd be fine for rnglists_base to appear on a skeleton unit - clang does this (DW_AT_rnglists_base on the skeleton unit, and DW_AT_ranges using DW_FORM_rnglistx) - and it seems harmless enough, though it would be more compact to skip rnglists_base and hawe DW_AT_ranges use DW_FORM_sec_offset<br><br>I'd guess that's where we got the impression that *list_base attributes weren't to be used & reached the conclusion you mention below, that they have an implicit value of sizeof(loclists/rnglists header)<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Apparently not, since in cases I have seen in object files<br>
with a single rnglist in `.debug_rnglists.dwo`<br>
there is no `DW_AT_rnglists_base`.<br>
<br>
The operative assumption seems to be that consumers will simply<br>
assume size-of-rnglists-header<br>
of the initial `.debug_rnglists.dwo` contribution<br>
as the (missing) `DW_AT_rnglists_base`.<br>
<br>
Similarly for .debug_loclists[.dwo] and DW_AT_loclists_base<br>
<br>
The intent of this proposal is to allow this common<br>
practice as correct dwarf.<br>
<br>
## PROPOSAL<br>
<br>
Section 7.28 Range List Table Following the last paragraph<br>
before Section 7.9:<br>
<br>
> If a Split Full Compilation Unit<br>
> refers to `.debug_rnglists.dwo`<br>
> with `DW_FORM_rnglistx`<br>
> and the correct `DW_AT_rnglists_base`<br>
> would be size-of-rnglists-header<br>
> of the initial contribution to<br>
> `.debug_rnglists.dwo`,<br>
> the `DW_AT_rnglists_base`<br>
> may be omitted.<br>
> In a dwp package file (See F.3 Package File Example)<br>
> a `.debug_cu_index` or `.debug_tu_index`<br>
> entry `DW_SECT_RNGLISTS` makes rnglists base unnecessary<br>
> by providing the offset of the contribution to<br>
>`.debug_rnglists.dwo`.<br>
<br>
<br>
Section 7.29 Location List Table Following the last paragraph<br>
before Section 7.30:<br>
> If a Split Full Compilation Unit<br>
> refers to `.debug_loclists.dwo`<br>
> with `DW_FORM_loclistx`<br>
> and the correct `DW_AT_loclists_base`<br>
> would be size-of-loclists-header<br>
> of the initial contribution to<br>
> `.debug_loclists.dwo`,<br>
> the `DW_AT_loclists_base`<br>
> may be omitted.<br>
> In a dwp package file (See F.3 Package File Example)<br>
> a `.debug_cu_index` or `.debug_tu_index`<br>
> entry `DW_SECT_LOCLISTS` makes loclists base unnecessary<br>
> by providing the offset of the contribution to<br>
>`.debug_loclists.dwo`.<br>
<br>
<br>
This is a major revision of the previous text.<br>
<br>
David Anderson<br>
<br>
-- <br>
Dwarf-discuss mailing list<br>
<a href="mailto:Dwarf-discuss@lists.dwarfstd.org" target="_blank">Dwarf-discuss@lists.dwarfstd.org</a><br>
<a href="https://lists.dwarfstd.org/mailman/listinfo/dwarf-discuss" rel="noreferrer" target="_blank">https://lists.dwarfstd.org/mailman/listinfo/dwarf-discuss</a><br>
</blockquote></div></div>