[llvm-dwarfdump] - Fix incorrect parsing of the DW_LLE_startx_length
authorGeorge Rimar <grimar@accesssoftek.com>
Thu, 25 Oct 2018 10:56:44 +0000 (10:56 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Thu, 25 Oct 2018 10:56:44 +0000 (10:56 +0000)
commit581fc63dc05041e9c17445a1e55b59e6dfb431ee
tree286be52d342883ecc9fde77611a13b18d8dc85da
parent071e82218f505396535b2d4abcf008117feb5685
[llvm-dwarfdump] - Fix incorrect parsing of the DW_LLE_startx_length

As was already mentioned in comments for D53364, DWARF 5
spec says about DW_LLE_startx_length:

"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. ")

Currently, the length is always parsed as U32.
Patch change the behavior to parse DW_LLE_startx_length as ULEB128 for DWARF 5
and keeps it as U32 for DWARF4+(pre-DWARF5) for compatibility.

Differential revision: https://reviews.llvm.org/D53564

llvm-svn: 345254
llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
llvm/include/llvm/DebugInfo/DWARF/DWARFListTable.h
llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
llvm/test/tools/llvm-dwarfdump/X86/debug_loclists_startx_length.s [new file with mode: 0644]