DWARF: Implement DW_AT_signature lookup for type unit support
authorPavel Labath <pavel@labath.sk>
Fri, 24 May 2019 08:11:12 +0000 (08:11 +0000)
committerPavel Labath <pavel@labath.sk>
Fri, 24 May 2019 08:11:12 +0000 (08:11 +0000)
commitf750842c8b35c56b58402c1842869a885bfcff56
tree29fa54e798c5f45c1b4cb364f5e766407c52c52e
parent8ac0bc9832a251837681b3a1cd53085ed8d594dc
DWARF: Implement DW_AT_signature lookup for type unit support

Summary:
This patch implements the main feature of type units. When completing a
type, if we encounter a DW_AT_signature attribute, we use it's value to
lookup the complete definition of the type in the relevant type unit.

To enable this lookup, we build up a map of all type units in a symbol
file when parsing the units. Then we consult this map when resolving the
DW_AT_signature attribute.

I include add a couple of tests which exercise the type lookup feature,
including one that ensure we do something reasonable in case we fail to
lookup the type.

A lot of the ideas in this patch have been taken from D32167 and D61505.

Reviewers: clayborg, JDevlieghere, aprantl, alexshap

Subscribers: mgrang, lldb-commits

Differential Revision: https://reviews.llvm.org/D62246

llvm-svn: 361603
14 files changed:
lldb/lit/SymbolFile/DWARF/Inputs/debug-types-basic.cpp
lldb/lit/SymbolFile/DWARF/Inputs/debug-types-expressions.cpp
lldb/lit/SymbolFile/DWARF/debug-types-basic.test
lldb/lit/SymbolFile/DWARF/debug-types-expressions.test
lldb/lit/SymbolFile/DWARF/debug-types-missing-signature.test [new file with mode: 0644]
lldb/lit/SymbolFile/DWARF/debug-types-signature-loop.s [new file with mode: 0644]
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFTypeUnit.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFTypeUnit.h
lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h