[lldb/DWARF] Fix mixed v4+v5 location lists
authorPavel Labath <pavel@labath.sk>
Fri, 20 Dec 2019 08:42:37 +0000 (09:42 +0100)
committerPavel Labath <pavel@labath.sk>
Thu, 9 Jan 2020 12:19:29 +0000 (13:19 +0100)
commitcd5da94d80b2b0f2bdb2d0157e24705a4cbd2a4e
tree717338ec0e0d74e95b3a50a4f27ddb87f61a62d2
parent9bb01efa49ca7f069bc7acba7e4c9bf64d972e79
[lldb/DWARF] Fix mixed v4+v5 location lists

Summary:
Our code was expecting that a single (symbol) file contains only one
kind of location lists. This is not correct (on non-apple platforms, at
least) as a file can compile units with different dwarf versions.

This patch moves the deteremination of location list flavour down to the
compile unit level, fixing this problem. I have also tried to rougly
align the code with the llvm DWARFUnit. Fully matching the API is not
possible because of how lldb's DWARFExpression lives separately from the
rest of the DWARF code, but this is at least a step in the right
direction.

Reviewers: JDevlieghere, aprantl, clayborg

Subscribers: dblaikie, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D71751
lldb/include/lldb/Expression/DWARFExpression.h
lldb/source/Expression/DWARFExpression.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
lldb/test/Shell/SymbolFile/DWARF/debug_loc_and_loclists.s [new file with mode: 0644]