[LLDB] - Parse the DW_LLE_startx_length correctly for DWARF v5 case.
authorGeorge Rimar <grimar@accesssoftek.com>
Thu, 25 Oct 2018 09:22:26 +0000 (09:22 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Thu, 25 Oct 2018 09:22:26 +0000 (09:22 +0000)
commitd87196488715e363d2689a0f3950546ba6df1791
tree4496a0e9b34edae6dba83e19769483fec46d63d4
parent1f6ca0ba1568acbb293a3cf5b3723af92013585d
[LLDB] - Parse the DW_LLE_startx_length correctly for DWARF v5 case.

Currently, we always parse the length field of DW_LLE_startx_length entry as U32.
That is correct for 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. ")

But DWARF v5 says: "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."

Fortunately, we can easily handle the difference. No test case because it seems impossible to test
until we will be ready to use DWARF v5 in tests that need to run the executables.

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

llvm-svn: 345249
lldb/include/lldb/Expression/DWARFExpression.h
lldb/source/Expression/DWARFExpression.cpp