<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Mon, Feb 3, 2025 at 8:01 AM Paul Robinson <<a href="mailto:pogo.work@gmail.com">pogo.work@gmail.com</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"><div dir="ltr">Also, fixed-size DIEs are much easier when quickly scanning for something; you can derive the size of the DIE from the abbrev without having to look at the DIE content. When you have variable-size values such as LEB128 then you need to parse the values in order to determine where the next DIE starts.<div>(Greg Clayton [LLDB] in particular has expressed a strong preference for fixed-size values for this reason.)</div><div>--paulr</div></div></blockquote><div><br>Yeah, seems like that ship's probably sailed a bit now with more LEB forms we have added in DWARFv5 (the Spilt-DWARF related forms that got back-ported to non-split DWARF too) - addrx, loclistx, exprloc, etc.<br><br>But I'll certainly gather some data on fixed size records that would be made non-fixed size if I get some data on this.<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><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 3, 2025 at 1:09 AM Cary Coutant <<a href="mailto:ccoutant@gmail.com" target="_blank">ccoutant@gmail.com</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"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">As an alternative to the indexed proposal in 250130.1, which proposes allowing a constant classed value for DW_AT_object_pointer, as an index into the formal parameters of the subprogram, I was wondering how folks would feel about something a bit different:<br><br>What about a reference classed form that is a (signed) LEB128 relative DIE offset - relative to the start of the DIE containing the attribute value?<br><br>This would allow for other shortenings of DIEs that are commonly nearby.<br><br>I don't have measurements on how much it could decrease DWARF size, but could maybe prototype such a thing (bit expensive, because it makes DWARF byte size dependent on itself in some ways - and LLVM's DWARF generation precomputes DIE offsets, etc, rather than relying on assembler relaxation)<br></div></blockquote><div> </div><div>Yes, it's worth discussing, but I suspect the downsides you've mentioned would outweigh any benefits obtained by using an offset rather than an index. If anything, I'd think the index would be more useful if you read and internalize the DIE tree. An index would also almost always be a single byte (and its size would be predictable), while an offset would be more likely to require 2 bytes.</div></div></div></blockquote></div></blockquote><div><br>More likely, mathematically, but in terms of the population in practice I think they'll be within a byte mostly.<br><br>but the major motivation for this proposal is to generalize to other cases - to be able to use smaller encodings for other DIE-to-DIE references (like for DW_AT_type, DW_AT_abstract_origin, etc).<br><br>We could address this with smaller fixed forms (like we have for, say, strx1, strx2, etc... before going to ULEB) - either still as CU-relative offsets, or as DIE-relative offsets (the DIE relative offsets would help ensure that a longer CU doesn't necessarily make DWARF later in that CU larger than DWARF earlier in the CU)<br><br>I guess I'll have to gather some data to help motivate this.<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><br></div><div>-cary</div><div><br></div></div></div>
</blockquote></div>
</blockquote></div></div>