DWARFDebugLoclists: stricter base address handling
authorPavel Labath <pavel@labath.sk>
Tue, 12 Nov 2019 10:36:19 +0000 (11:36 +0100)
committerPavel Labath <pavel@labath.sk>
Thu, 14 Nov 2019 09:01:48 +0000 (10:01 +0100)
commiteafe0cf5fa8255257bac3923237e62382610e6d6
treef200e3e8a0c4ffe854f4e89f2d2f7845454f0ab6
parentea2ba51b0b2f5bc0bea650bf64e5cbd63476563f
DWARFDebugLoclists: stricter base address handling

Summary:
This removes the use of zero as a base address in section-based dumping.
Although this will often be true for (unlinked) object files with a
single compile unit, it is not true in general. This means that
section-based dumping will not be able to resolve entries referencing
the base address (DW_LLE_offset_pair) -- it wasn't able to do that
correctly before either, but now it will be more explicit about it. One
exception to that is if the location list contains an explicit
DW_LLE_base_address entry -- in this case the dumper will pick it up,
and resolve subsequent entries normally.

The patch also removes the fallback to zero in the "inline" dumping in
case the compile unit does not contain a base address.

Reviewers: dblaikie, probinson, JDevlieghere, aprantl, SouraVX

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70115
llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
llvm/test/DebugInfo/X86/dwarfdump-debug-loclists.test
llvm/test/tools/llvm-dwarfdump/X86/debug_loclists.s
llvm/test/tools/llvm-dwarfdump/X86/debug_loclists_multiple.s