[Dwarf-discuss] Alternative to 250130.1 (index valued DW_AT_object_pointer): LEB128 relative DIE offsets
Paul Robinson
pogo.work@gmail.com
Mon Feb 3 16:00:59 GMT 2025
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.
(Greg Clayton [LLDB] in particular has expressed a strong preference for
fixed-size values for this reason.)
--paulr
On Mon, Feb 3, 2025 at 1:09 AM Cary Coutant <ccoutant@gmail.com> wrote:
> 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:
>>
>> 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?
>>
>> This would allow for other shortenings of DIEs that are commonly nearby.
>>
>> 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)
>>
>
> 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.
>
> -cary
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dwarfstd.org/pipermail/dwarf-discuss/attachments/20250203/580d7821/attachment.htm>
More information about the Dwarf-discuss
mailing list