[PATCH] D53564: [llvm-dwarfdump] - Fix incorrect parsing of the DW_LLE_startx_length

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 23 10:20:05 PDT 2018


dblaikie added a comment.

In https://reviews.llvm.org/D53564#1272488, @grimar wrote:

> It turns out LLVM emits the U32 now:
>  https://github.com/llvm-mirror/llvm/blob/master/lib/CodeGen/AsmPrinter/DwarfDebug.cpp#L1972
>
> I'll prepare the patch for it too. Seems we will want to land these at the same time then?
>
> Or should we handle DW_LLE_startx_length for .debug_loc (DWARF 4 dwo case) and .debug_loclists (DWARF5) differently for compatibility (I guess no as it does not match the specification)?


Yep, looks like this changed between the pre-standard definition ( https://gcc.gnu.org/wiki/DebugFission - "A start/length entry contains one unsigned LEB128 number and a 4-byte unsigned value (as would be represented by the form code DW_FORM_const4u). The first number is an index into the .debug_addr section that selects the beginning offset, and the second number is the length of the range. ") and the standard one (http://dwarfstd.org/doc/DWARF5.pdf - "This is a form of bounded location description that has two unsigned ULEB operands. The first value is an address index (into the .debug_addr section) that indicates the beginning of the address range over which the location is valid. The second value is the length of the range.")

So it should change based on DWARF version, unfortunately.


https://reviews.llvm.org/D53564





More information about the llvm-commits mailing list