serenity icon indicating copy to clipboard operation
serenity copied to clipboard

LibDebug: DWARF 5 .debug_loclists is not supported

Open ADKaster opened this issue 3 years ago • 0 comments

https://dwarfstd.org/doc/DWARF5.pdf

Section 2.6.2 Location Lists describes a new-to-DWARF-5 facility for reducing the number of relocations created by compilers for source location information.

It uses a new class, DW_AT_loclists_base, and a set of AttributeDataForms in the dwarf info, DW_FORM_loclistx

Per section 7.5.5, the loclist is used in the dwarf debug stream with the following forms:

• loclist

This is represented as either:

– An index into the .debug_loclists section (DW_FORM_loclistx). The
unsigned ULEB operand identifies an offset location relative to the
base of that section (the location of the first offset in the section, not the
first byte of the section). The contents of that location is then added to
the base to determine the location of the target list of entries.

– An offset into the .debug_loclists section (DW_FORM_sec_offset).
The operand consists of a byte offset from the beginning of the
.debug_loclists section. It is relocatable in a relocatable object file,
and relocated in an executable or shared object file. In the 32-bit
DWARF format, this offset is a 4-byte unsigned value; in the 64-bit
DWARF format, it is an 8-byte unsigned value (see Section 7.4 on
page 196).

By default, the Clang toolchain creates these forms for OpenJDK in fastdebug mode.

Similar to Range Lists from section 7.25 which were implemented in https://github.com/SerenityOS/serenity/pull/10242, Location Lists have their own set of entries described in section 7.7.3 Location Lists

ADKaster avatar Jun 24 '22 04:06 ADKaster