summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-06-21 07:56:50 +0000
committerPavel Labath <pavel@labath.sk>2019-06-21 07:56:50 +0000
commit3b9269882e26fe5852297313853946d912bec382 (patch)
tree0650e348560aff30a815d762bce81cedf6826deb
parentb9b1aaf07dff947fab46b3ac6348778a8f0e2d98 (diff)
downloadbcm5719-llvm-3b9269882e26fe5852297313853946d912bec382.tar.gz
bcm5719-llvm-3b9269882e26fe5852297313853946d912bec382.zip
DWARF: Add "dwo_num" field to the DIERef class
Summary: When dwo support was introduced, it used a trick where debug info entries were referenced by the offset of the compile unit in the main file, but the die offset was relative to the dwo file. Although there was some elegance to it, this representation was starting to reach its breaking point: - the fact that the skeleton compile unit owned the DWO file meant that it was impossible (or at least hard and unintuitive) to support DWO files containing more than one compile unit. These kinds of files are produced by LTO for example. - it made it impossible to reference any DIEs in the skeleton compile unit (although the skeleton units are generally empty, clang still puts some info into them with -fsplit-dwarf-inlining). - (current motivation) it made it very hard to support type units placed in DWO files, as type units don't have any skeleton units which could be referenced in the main file This patch addresses this problem by introducing an new "dwo_num" field to the DIERef class, whose purpose is to identify the dwo file. It's kind of similar to the dwo_id field in DWARF5 unit headers, but while this is a 64bit hash whose main purpose is to catch file mismatches, this is just a smaller integer used to indentify a loaded dwo file. Currently, this is based on the index of the skeleton compile unit which owns the dwo file, but it is intended to be eventually independent of that (to support the LTO use case). Simultaneously the cu_offset is dropped to conserve space, as it is no longer necessary. This means we can remove the "BaseObjectOffset" field from the DWARFUnit class. It also means we can remove some of the workarounds put in place to support the skeleton-unit+dwo-die combo. More work is needed to remove all of them, which is out of scope of this patch. Reviewers: JDevlieghere, clayborg, aprantl Subscribers: mehdi_amini, dexonsmith, arphaman, lldb-commits Differential Revision: https://reviews.llvm.org/D63428 llvm-svn: 364009
-rw-r--r--lldb/lit/SymbolFile/DWARF/find-variable-file.cpp10
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp5
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp4
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DIERef.h39
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp6
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp6
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp21
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp9
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.h5
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp13
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h8
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp14
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp27
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h12
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp15
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.h6
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp49
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h8
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp7
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h2
24 files changed, 136 insertions, 138 deletions
diff --git a/lldb/lit/SymbolFile/DWARF/find-variable-file.cpp b/lldb/lit/SymbolFile/DWARF/find-variable-file.cpp
index 5a95c5338f8..550896cc707 100644
--- a/lldb/lit/SymbolFile/DWARF/find-variable-file.cpp
+++ b/lldb/lit/SymbolFile/DWARF/find-variable-file.cpp
@@ -8,6 +8,16 @@
// RUN: lldb-test symbols --file=find-variable-file-2.cpp --find=variable %t | \
// RUN: FileCheck --check-prefix=TWO %s
+// Run the same test with split-dwarf. This is interesting because the two
+// split compile units will have the same offset (0).
+// RUN: %clang -g -c -o %t-1.o --target=x86_64-pc-linux -gsplit-dwarf %s
+// RUN: %clang -g -c -o %t-2.o --target=x86_64-pc-linux -gsplit-dwarf %S/Inputs/find-variable-file-2.cpp
+// RUN: ld.lld %t-1.o %t-2.o -o %t
+// RUN: lldb-test symbols --file=find-variable-file.cpp --find=variable %t | \
+// RUN: FileCheck --check-prefix=ONE %s
+// RUN: lldb-test symbols --file=find-variable-file-2.cpp --find=variable %t | \
+// RUN: FileCheck --check-prefix=TWO %s
+
// RUN: %clang -g -c -o %t-1.o --target=x86_64-pc-linux -mllvm -accel-tables=Dwarf %s
// RUN: %clang -g -c -o %t-2.o --target=x86_64-pc-linux -mllvm -accel-tables=Dwarf %S/Inputs/find-variable-file-2.cpp
// RUN: ld.lld %t-1.o %t-2.o -o %t
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp b/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
index bc435bc54ae..9ae047da132 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
@@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
#include "Plugins/SymbolFile/DWARF/AppleDWARFIndex.h"
-#include "Plugins/SymbolFile/DWARF/DWARFDebugInfo.h"
#include "Plugins/SymbolFile/DWARF/DWARFDeclContext.h"
#include "Plugins/SymbolFile/DWARF/DWARFUnit.h"
#include "Plugins/SymbolFile/DWARF/LogChannelDWARF.h"
@@ -133,14 +132,14 @@ void AppleDWARFIndex::GetNamespaces(ConstString name, DIEArray &offsets) {
m_apple_namespaces_up->FindByName(name.GetStringRef(), offsets);
}
-void AppleDWARFIndex::GetFunctions(ConstString name, DWARFDebugInfo &info,
+void AppleDWARFIndex::GetFunctions(ConstString name, SymbolFileDWARF &dwarf,
const CompilerDeclContext &parent_decl_ctx,
uint32_t name_type_mask,
std::vector<DWARFDIE> &dies) {
DIEArray offsets;
m_apple_names_up->FindByName(name.GetStringRef(), offsets);
for (const DIERef &die_ref : offsets) {
- ProcessFunctionDIE(name.GetStringRef(), die_ref, info, parent_decl_ctx,
+ ProcessFunctionDIE(name.GetStringRef(), die_ref, dwarf, parent_decl_ctx,
name_type_mask, dies);
}
}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h b/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h
index e9dfed8fc1c..d15d61e270b 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h
@@ -42,7 +42,7 @@ public:
void GetTypes(ConstString name, DIEArray &offsets) override;
void GetTypes(const DWARFDeclContext &context, DIEArray &offsets) override;
void GetNamespaces(ConstString name, DIEArray &offsets) override;
- void GetFunctions(ConstString name, DWARFDebugInfo &info,
+ void GetFunctions(ConstString name, SymbolFileDWARF &dwarf,
const CompilerDeclContext &parent_decl_ctx,
uint32_t name_type_mask,
std::vector<DWARFDIE> &dies) override;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp
index 11dbe3c0a1f..f7f2a5bf006 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp
@@ -11,8 +11,8 @@
void llvm::format_provider<DIERef>::format(const DIERef &ref, raw_ostream &OS,
StringRef Style) {
+ if (ref.dwo_num())
+ OS << format_hex_no_prefix(*ref.dwo_num(), 8) << "/";
OS << (ref.section() == DIERef::DebugInfo ? "INFO" : "TYPE");
- if (ref.unit_offset())
- OS << "/" << format_hex_no_prefix(*ref.unit_offset(), 8);
OS << "/" << format_hex_no_prefix(ref.die_offset(), 8);
}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h
index 476539bf840..5546bb7e8b8 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h
@@ -12,42 +12,45 @@
#include "lldb/Core/dwarf.h"
#include "llvm/ADT/Optional.h"
#include "llvm/Support/FormatProviders.h"
+#include <cassert>
#include <vector>
/// Identifies a DWARF debug info entry within a given Module. It contains three
/// "coordinates":
-/// - section: identifies the section of the debug info entry: debug_info or
-/// debug_types
-/// - unit_offset: the offset of the unit containing the debug info entry. For
-/// regular (unsplit) units, this field is optional, as the die_offset is
-/// enough to uniquely identify the containing unit. For split units, this
-/// field must contain the offset of the skeleton unit in the main object
-/// file.
-/// - die_offset: The offset of te debug info entry as an absolute offset from
+/// - dwo_num: identifies the dwo file in the Module. If this field is not set,
+/// the DIERef references the main file.
+/// - section: identifies the section of the debug info entry in the given file:
+/// debug_info or debug_types.
+/// - die_offset: The offset of the debug info entry as an absolute offset from
/// the beginning of the section specified in the section field.
class DIERef {
public:
enum Section : uint8_t { DebugInfo, DebugTypes };
- DIERef(Section s, llvm::Optional<dw_offset_t> u, dw_offset_t d)
- : m_section(s), m_unit_offset(u.getValueOr(DW_INVALID_OFFSET)),
- m_die_offset(d) {}
-
- Section section() const { return static_cast<Section>(m_section); }
+ DIERef(llvm::Optional<uint32_t> dwo_num, Section section,
+ dw_offset_t die_offset)
+ : m_dwo_num(dwo_num.getValueOr(0)), m_dwo_num_valid(bool(dwo_num)),
+ m_section(section), m_die_offset(die_offset) {
+ assert(this->dwo_num() == dwo_num && "Dwo number out of range?");
+ }
- llvm::Optional<dw_offset_t> unit_offset() const {
- if (m_unit_offset != DW_INVALID_OFFSET)
- return m_unit_offset;
+ llvm::Optional<uint32_t> dwo_num() const {
+ if (m_dwo_num_valid)
+ return m_dwo_num;
return llvm::None;
}
+ Section section() const { return static_cast<Section>(m_section); }
+
dw_offset_t die_offset() const { return m_die_offset; }
private:
- unsigned m_section : 1;
- dw_offset_t m_unit_offset;
+ uint32_t m_dwo_num : 30;
+ uint32_t m_dwo_num_valid : 1;
+ uint32_t m_section : 1;
dw_offset_t m_die_offset;
};
+static_assert(sizeof(DIERef) == 8, "");
typedef std::vector<DIERef> DIEArray;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
index b9449f5776f..96adb72c953 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
@@ -21,10 +21,8 @@ llvm::Optional<DIERef> DWARFBaseDIE::GetDIERef() const {
if (!IsValid())
return llvm::None;
- dw_offset_t cu_offset = m_cu->GetOffset();
- if (m_cu->GetBaseObjOffset() != DW_INVALID_OFFSET)
- cu_offset = m_cu->GetBaseObjOffset();
- return DIERef(m_cu->GetDebugSection(), cu_offset, m_die->GetOffset());
+ return DIERef(m_cu->GetSymbolFileDWARF().GetDwoNum(), m_cu->GetDebugSection(),
+ m_die->GetOffset());
}
dw_tag_t DWARFBaseDIE::Tag() const {
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
index 4335b5c0d61..9d97ca15a25 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
@@ -151,9 +151,9 @@ DWARFDIE::LookupDeepestBlock(lldb::addr_t file_addr) const {
if (cu->ContainsDIEOffset(block_die->GetOffset()))
return DWARFDIE(cu, block_die);
else
- return DWARFDIE(dwarf->DebugInfo()->GetUnit(
- DIERef(cu->GetDebugSection(), cu->GetOffset(),
- block_die->GetOffset())),
+ return DWARFDIE(dwarf->DebugInfo()->GetUnit(DIERef(
+ cu->GetSymbolFileDWARF().GetDwoNum(),
+ cu->GetDebugSection(), block_die->GetOffset())),
block_die);
}
}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
index cd2dfbc39f0..100f35f8c6b 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
@@ -149,8 +149,6 @@ DWARFUnit *DWARFDebugInfo::GetUnitAtOffset(DIERef::Section section,
}
DWARFUnit *DWARFDebugInfo::GetUnit(const DIERef &die_ref) {
- if (die_ref.unit_offset())
- return GetUnitAtOffset(die_ref.section(), *die_ref.unit_offset());
return GetUnitContainingDIEOffset(die_ref.section(), die_ref.die_offset());
}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
index 2c13c15bb8c..06e9bed3190 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
@@ -226,12 +226,6 @@ bool DWARFDebugInfoEntry::GetDIENamesAndRanges(
DWARFRangeList &ranges, int &decl_file, int &decl_line, int &decl_column,
int &call_file, int &call_line, int &call_column,
DWARFExpression *frame_base) const {
- SymbolFileDWARFDwo *dwo_symbol_file = cu->GetDwoSymbolFile();
- if (dwo_symbol_file)
- return GetDIENamesAndRanges(
- dwo_symbol_file->GetCompileUnit(), name, mangled, ranges, decl_file,
- decl_line, decl_column, call_file, call_line, call_column, frame_base);
-
dw_addr_t lo_pc = LLDB_INVALID_ADDRESS;
dw_addr_t hi_pc = LLDB_INVALID_ADDRESS;
std::vector<DWARFDIE> dies;
@@ -611,16 +605,7 @@ dw_offset_t DWARFDebugInfoEntry::GetAttributeValue(
const DWARFUnit *cu, const dw_attr_t attr, DWARFFormValue &form_value,
dw_offset_t *end_attr_offset_ptr,
bool check_specification_or_abstract_origin) const {
- SymbolFileDWARFDwo *dwo_symbol_file = cu->GetDwoSymbolFile();
- if (dwo_symbol_file && m_tag != DW_TAG_compile_unit &&
- m_tag != DW_TAG_partial_unit)
- return GetAttributeValue(dwo_symbol_file->GetCompileUnit(), attr,
- form_value, end_attr_offset_ptr,
- check_specification_or_abstract_origin);
-
- auto abbrevDecl = GetAbbreviationDeclarationPtr(cu);
-
- if (abbrevDecl) {
+ if (auto *abbrevDecl = GetAbbreviationDeclarationPtr(cu)) {
uint32_t attr_idx = abbrevDecl->FindAttributeIndex(attr);
if (attr_idx != DW_INVALID_INDEX) {
@@ -665,6 +650,10 @@ dw_offset_t DWARFDebugInfoEntry::GetAttributeValue(
}
}
+ // If we're a unit DIE, also check the attributes of the dwo unit (if any).
+ if (GetParent())
+ return 0;
+ SymbolFileDWARFDwo *dwo_symbol_file = cu->GetDwoSymbolFile();
if (!dwo_symbol_file)
return 0;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp
index 90ed48b9027..c122f756e81 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp
@@ -7,10 +7,9 @@
//===----------------------------------------------------------------------===//
#include "Plugins/SymbolFile/DWARF/DWARFIndex.h"
-#include "Plugins/SymbolFile/DWARF/DWARFDIE.h"
-#include "Plugins/SymbolFile/DWARF/DWARFDebugInfo.h"
-
#include "Plugins/Language/ObjC/ObjCLanguage.h"
+#include "Plugins/SymbolFile/DWARF/DWARFDIE.h"
+#include "Plugins/SymbolFile/DWARF/SymbolFileDWARF.h"
using namespace lldb_private;
using namespace lldb;
@@ -18,11 +17,11 @@ using namespace lldb;
DWARFIndex::~DWARFIndex() = default;
void DWARFIndex::ProcessFunctionDIE(llvm::StringRef name, DIERef ref,
- DWARFDebugInfo &info,
+ SymbolFileDWARF &dwarf,
const CompilerDeclContext &parent_decl_ctx,
uint32_t name_type_mask,
std::vector<DWARFDIE> &dies) {
- DWARFDIE die = info.GetDIE(ref);
+ DWARFDIE die = dwarf.GetDIE(ref);
if (!die) {
ReportInvalidDIERef(ref, name);
return;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.h
index 3bccc4ad452..e3c7c5e63ac 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.h
@@ -13,7 +13,6 @@
#include "Plugins/SymbolFile/DWARF/DWARFDIE.h"
#include "Plugins/SymbolFile/DWARF/DWARFFormValue.h"
-class DWARFDebugInfo;
class DWARFDeclContext;
class DWARFDIE;
@@ -40,7 +39,7 @@ public:
virtual void GetTypes(ConstString name, DIEArray &offsets) = 0;
virtual void GetTypes(const DWARFDeclContext &context, DIEArray &offsets) = 0;
virtual void GetNamespaces(ConstString name, DIEArray &offsets) = 0;
- virtual void GetFunctions(ConstString name, DWARFDebugInfo &info,
+ virtual void GetFunctions(ConstString name, SymbolFileDWARF &dwarf,
const CompilerDeclContext &parent_decl_ctx,
uint32_t name_type_mask,
std::vector<DWARFDIE> &dies) = 0;
@@ -58,7 +57,7 @@ protected:
/// "parent_decl_ctx" and "name_type_mask", it is inserted into the "dies"
/// vector.
void ProcessFunctionDIE(llvm::StringRef name, DIERef ref,
- DWARFDebugInfo &info,
+ SymbolFileDWARF &dwarf,
const CompilerDeclContext &parent_decl_ctx,
uint32_t name_type_mask, std::vector<DWARFDIE> &dies);
};
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
index a1a2bca83fd..7eea51fbfd3 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
@@ -363,7 +363,6 @@ void DWARFUnit::AddUnitDIE(const DWARFDebugInfoEntry &cu_die) {
else if (gnu_ranges_base)
dwo_cu->SetRangesBase(*gnu_ranges_base);
- dwo_cu->SetBaseObjOffset(GetOffset());
SetDwoStrOffsetsBase(dwo_cu);
}
@@ -419,10 +418,6 @@ void DWARFUnit::SetRangesBase(dw_addr_t ranges_base) {
m_ranges_base = ranges_base;
}
-void DWARFUnit::SetBaseObjOffset(dw_offset_t base_obj_offset) {
- m_base_obj_offset = base_obj_offset;
-}
-
void DWARFUnit::SetStrOffsetsBase(dw_offset_t str_offsets_base) {
m_str_offsets_base = str_offsets_base;
}
@@ -480,6 +475,12 @@ DWARFUnit::GetDIE(dw_offset_t die_offset) {
return DWARFDIE(); // Not found
}
+DWARFUnit &DWARFUnit::GetNonSkeletonUnit() {
+ if (SymbolFileDWARFDwo *dwo = GetDwoSymbolFile())
+ return *dwo->GetCompileUnit();
+ return *this;
+}
+
uint8_t DWARFUnit::GetAddressByteSize(const DWARFUnit *cu) {
if (cu)
return cu->GetAddressByteSize();
@@ -719,8 +720,6 @@ SymbolFileDWARFDwo *DWARFUnit::GetDwoSymbolFile() const {
return m_dwo_symbol_file.get();
}
-dw_offset_t DWARFUnit::GetBaseObjOffset() const { return m_base_obj_offset; }
-
const DWARFDebugAranges &DWARFUnit::GetFunctionAranges() {
if (m_func_aranges_up == nullptr) {
m_func_aranges_up.reset(new DWARFDebugAranges());
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
index a219877236f..8aa1e449f3e 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
@@ -148,7 +148,6 @@ public:
dw_addr_t GetStrOffsetsBase() const { return m_str_offsets_base; }
void SetAddrBase(dw_addr_t addr_base);
void SetRangesBase(dw_addr_t ranges_base);
- void SetBaseObjOffset(dw_offset_t base_obj_offset);
void SetStrOffsetsBase(dw_offset_t str_offsets_base);
virtual void BuildAddressRangeTable(DWARFDebugAranges *debug_aranges) = 0;
@@ -166,6 +165,8 @@ public:
DWARFDIE GetDIE(dw_offset_t die_offset);
+ DWARFUnit &GetNonSkeletonUnit();
+
static uint8_t GetAddressByteSize(const DWARFUnit *cu);
static uint8_t GetDefaultAddressSize();
@@ -203,8 +204,6 @@ public:
SymbolFileDWARFDwo *GetDwoSymbolFile() const;
- dw_offset_t GetBaseObjOffset() const;
-
die_iterator_range dies() {
ExtractDIEsIfNeeded();
return die_iterator_range(m_die_array.begin(), m_die_array.end());
@@ -284,9 +283,6 @@ protected:
llvm::Optional<lldb_private::FileSpec> m_file_spec;
dw_addr_t m_addr_base = 0; // Value of DW_AT_addr_base
dw_addr_t m_ranges_base = 0; // Value of DW_AT_ranges_base
- // If this is a dwo compile unit this is the offset of the base compile unit
- // in the main object file
- dw_offset_t m_base_obj_offset = DW_INVALID_OFFSET;
/// Value of DW_AT_stmt_list.
dw_offset_t m_line_table_offset = DW_INVALID_OFFSET;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
index b7bbe41a7a8..01cac49a7aa 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
@@ -64,10 +64,11 @@ DebugNamesDWARFIndex::ToDIERef(const DebugNames::Entry &entry) {
// GetDwoSymbolFile to call this automatically because of mutual recursion
// between this and DWARFDebugInfoEntry::GetAttributeValue.
cu->ExtractUnitDIEIfNeeded();
- uint64_t die_bias = cu->GetDwoSymbolFile() ? 0 : *cu_offset;
+ cu = &cu->GetNonSkeletonUnit();
if (llvm::Optional<uint64_t> die_offset = entry.getDIEUnitOffset())
- return DIERef(DIERef::Section::DebugInfo, *cu_offset, die_bias + *die_offset);
+ return DIERef(cu->GetSymbolFileDWARF().GetDwoNum(),
+ DIERef::Section::DebugInfo, cu->GetOffset() + *die_offset);
return llvm::None;
}
@@ -165,8 +166,7 @@ void DebugNamesDWARFIndex::GetCompleteObjCClass(ConstString class_name,
if (!ref)
continue;
- DWARFUnit *cu = m_debug_info.GetUnitAtOffset(DIERef::Section::DebugInfo,
- *ref->unit_offset());
+ DWARFUnit *cu = m_debug_info.GetUnit(*ref);
if (!cu || !cu->Supports_DW_AT_APPLE_objc_complete_type()) {
incomplete_types.push_back(*ref);
continue;
@@ -222,12 +222,12 @@ void DebugNamesDWARFIndex::GetNamespaces(ConstString name, DIEArray &offsets) {
}
void DebugNamesDWARFIndex::GetFunctions(
- ConstString name, DWARFDebugInfo &info,
+ ConstString name, SymbolFileDWARF &dwarf,
const CompilerDeclContext &parent_decl_ctx, uint32_t name_type_mask,
std::vector<DWARFDIE> &dies) {
std::vector<DWARFDIE> v;
- m_fallback.GetFunctions(name, info, parent_decl_ctx, name_type_mask, v);
+ m_fallback.GetFunctions(name, dwarf, parent_decl_ctx, name_type_mask, v);
for (const DebugNames::Entry &entry :
m_debug_names_up->equal_range(name.GetStringRef())) {
@@ -236,7 +236,7 @@ void DebugNamesDWARFIndex::GetFunctions(
continue;
if (llvm::Optional<DIERef> ref = ToDIERef(entry))
- ProcessFunctionDIE(name.GetStringRef(), *ref, info, parent_decl_ctx,
+ ProcessFunctionDIE(name.GetStringRef(), *ref, dwarf, parent_decl_ctx,
name_type_mask, v);
}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h
index 6f9a28e3afb..dca25496373 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h
@@ -34,7 +34,7 @@ public:
void GetTypes(ConstString name, DIEArray &offsets) override;
void GetTypes(const DWARFDeclContext &context, DIEArray &offsets) override;
void GetNamespaces(ConstString name, DIEArray &offsets) override;
- void GetFunctions(ConstString name, DWARFDebugInfo &info,
+ void GetFunctions(ConstString name, SymbolFileDWARF &dwarf,
const CompilerDeclContext &parent_decl_ctx,
uint32_t name_type_mask,
std::vector<DWARFDIE> &dies) override;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h b/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
index ddb01de02a4..a01612b5952 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
@@ -61,7 +61,7 @@ public:
DIEInfo(dw_offset_t o, dw_tag_t t, uint32_t f, uint32_t h);
explicit operator DIERef() const {
- return DIERef(DIERef::Section::DebugInfo, llvm::None, die_offset);
+ return DIERef(llvm::None, DIERef::Section::DebugInfo, die_offset);
}
};
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
index 2daa8ef657d..00f2dbfa037 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
@@ -102,18 +102,17 @@ void ManualDWARFIndex::IndexUnit(DWARFUnit &unit, IndexSet &set) {
const LanguageType cu_language = unit.GetLanguageType();
- IndexUnitImpl(unit, cu_language, unit.GetOffset(), set);
+ IndexUnitImpl(unit, cu_language, set);
SymbolFileDWARFDwo *dwo_symbol_file = unit.GetDwoSymbolFile();
if (dwo_symbol_file && dwo_symbol_file->GetCompileUnit()) {
- IndexUnitImpl(*dwo_symbol_file->GetCompileUnit(), cu_language,
- unit.GetOffset(), set);
+ IndexUnitImpl(*dwo_symbol_file->GetCompileUnit(), cu_language, set);
}
}
-void ManualDWARFIndex::IndexUnitImpl(
- DWARFUnit &unit, const LanguageType cu_language,
- const dw_offset_t cu_offset, IndexSet &set) {
+void ManualDWARFIndex::IndexUnitImpl(DWARFUnit &unit,
+ const LanguageType cu_language,
+ IndexSet &set) {
for (const DWARFDebugInfoEntry &die : unit.dies()) {
const dw_tag_t tag = die.Tag();
@@ -243,7 +242,7 @@ void ManualDWARFIndex::IndexUnitImpl(
}
}
- DIERef ref(unit.GetDebugSection(), cu_offset, die.GetOffset());
+ DIERef ref = *DWARFDIE(&unit, &die).GetDIERef();
switch (tag) {
case DW_TAG_inlined_subroutine:
case DW_TAG_subprogram:
@@ -358,10 +357,10 @@ void ManualDWARFIndex::GetGlobalVariables(const RegularExpression &regex,
m_set.globals.Find(regex, offsets);
}
-void ManualDWARFIndex::GetGlobalVariables(const DWARFUnit &cu,
+void ManualDWARFIndex::GetGlobalVariables(const DWARFUnit &unit,
DIEArray &offsets) {
Index();
- m_set.globals.FindAllEntriesForCompileUnit(cu.GetOffset(), offsets);
+ m_set.globals.FindAllEntriesForUnit(unit, offsets);
}
void ManualDWARFIndex::GetObjCMethods(ConstString class_name,
@@ -393,7 +392,7 @@ void ManualDWARFIndex::GetNamespaces(ConstString name, DIEArray &offsets) {
m_set.namespaces.Find(name, offsets);
}
-void ManualDWARFIndex::GetFunctions(ConstString name, DWARFDebugInfo &info,
+void ManualDWARFIndex::GetFunctions(ConstString name, SymbolFileDWARF &dwarf,
const CompilerDeclContext &parent_decl_ctx,
uint32_t name_type_mask,
std::vector<DWARFDIE> &dies) {
@@ -405,7 +404,7 @@ void ManualDWARFIndex::GetFunctions(ConstString name, DWARFDebugInfo &info,
m_set.function_methods.Find(name, offsets);
m_set.function_fullnames.Find(name, offsets);
for (const DIERef &die_ref: offsets) {
- DWARFDIE die = info.GetDIE(die_ref);
+ DWARFDIE die = dwarf.GetDIE(die_ref);
if (!die)
continue;
if (SymbolFileDWARF::DIEInDeclContext(&parent_decl_ctx, die))
@@ -416,7 +415,7 @@ void ManualDWARFIndex::GetFunctions(ConstString name, DWARFDebugInfo &info,
DIEArray offsets;
m_set.function_basenames.Find(name, offsets);
for (const DIERef &die_ref: offsets) {
- DWARFDIE die = info.GetDIE(die_ref);
+ DWARFDIE die = dwarf.GetDIE(die_ref);
if (!die)
continue;
if (SymbolFileDWARF::DIEInDeclContext(&parent_decl_ctx, die))
@@ -429,7 +428,7 @@ void ManualDWARFIndex::GetFunctions(ConstString name, DWARFDebugInfo &info,
DIEArray offsets;
m_set.function_methods.Find(name, offsets);
for (const DIERef &die_ref: offsets) {
- if (DWARFDIE die = info.GetDIE(die_ref))
+ if (DWARFDIE die = dwarf.GetDIE(die_ref))
dies.push_back(die);
}
}
@@ -439,7 +438,7 @@ void ManualDWARFIndex::GetFunctions(ConstString name, DWARFDebugInfo &info,
DIEArray offsets;
m_set.function_selectors.Find(name, offsets);
for (const DIERef &die_ref: offsets) {
- if (DWARFDIE die = info.GetDIE(die_ref))
+ if (DWARFDIE die = dwarf.GetDIE(die_ref))
dies.push_back(die);
}
}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h
index 61a985975b3..dd03b103c93 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h
@@ -13,6 +13,8 @@
#include "Plugins/SymbolFile/DWARF/NameToDIE.h"
#include "llvm/ADT/DenseSet.h"
+class DWARFDebugInfo;
+
namespace lldb_private {
class ManualDWARFIndex : public DWARFIndex {
public:
@@ -26,14 +28,14 @@ public:
void GetGlobalVariables(ConstString basename, DIEArray &offsets) override;
void GetGlobalVariables(const RegularExpression &regex,
DIEArray &offsets) override;
- void GetGlobalVariables(const DWARFUnit &cu, DIEArray &offsets) override;
+ void GetGlobalVariables(const DWARFUnit &unit, DIEArray &offsets) override;
void GetObjCMethods(ConstString class_name, DIEArray &offsets) override;
void GetCompleteObjCClass(ConstString class_name, bool must_be_implementation,
DIEArray &offsets) override;
void GetTypes(ConstString name, DIEArray &offsets) override;
void GetTypes(const DWARFDeclContext &context, DIEArray &offsets) override;
void GetNamespaces(ConstString name, DIEArray &offsets) override;
- void GetFunctions(ConstString name, DWARFDebugInfo &info,
+ void GetFunctions(ConstString name, SymbolFileDWARF &dwarf,
const CompilerDeclContext &parent_decl_ctx,
uint32_t name_type_mask,
std::vector<DWARFDIE> &dies) override;
@@ -56,9 +58,9 @@ private:
void Index();
void IndexUnit(DWARFUnit &unit, IndexSet &set);
- static void
- IndexUnitImpl(DWARFUnit &unit, const lldb::LanguageType cu_language,
- const dw_offset_t cu_offset, IndexSet &set);
+ static void IndexUnitImpl(DWARFUnit &unit,
+ const lldb::LanguageType cu_language,
+ IndexSet &set);
/// Non-null value means we haven't built the index yet.
DWARFDebugInfo *m_debug_info;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp b/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
index 26b6dde781e..7d81afb1b22 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
@@ -7,16 +7,13 @@
//===----------------------------------------------------------------------===//
#include "NameToDIE.h"
+#include "DWARFUnit.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/RegularExpression.h"
#include "lldb/Utility/Stream.h"
#include "lldb/Utility/StreamString.h"
-#include "DWARFDebugInfo.h"
-#include "DWARFDebugInfoEntry.h"
-#include "SymbolFileDWARF.h"
-
using namespace lldb;
using namespace lldb_private;
@@ -26,7 +23,6 @@ void NameToDIE::Finalize() {
}
void NameToDIE::Insert(ConstString name, const DIERef &die_ref) {
- assert(die_ref.unit_offset().hasValue());
m_map.Append(name, die_ref);
}
@@ -39,13 +35,16 @@ size_t NameToDIE::Find(const RegularExpression &regex,
return m_map.GetValues(regex, info_array);
}
-size_t NameToDIE::FindAllEntriesForCompileUnit(dw_offset_t cu_offset,
- DIEArray &info_array) const {
+size_t NameToDIE::FindAllEntriesForUnit(const DWARFUnit &unit,
+ DIEArray &info_array) const {
const size_t initial_size = info_array.size();
const uint32_t size = m_map.GetSize();
for (uint32_t i = 0; i < size; ++i) {
const DIERef &die_ref = m_map.GetValueAtIndexUnchecked(i);
- if (cu_offset == *die_ref.unit_offset())
+ if (unit.GetSymbolFileDWARF().GetDwoNum() == die_ref.dwo_num() &&
+ unit.GetDebugSection() == die_ref.section() &&
+ unit.GetOffset() <= die_ref.die_offset() &&
+ die_ref.die_offset() < unit.GetNextUnitOffset())
info_array.push_back(die_ref);
}
return info_array.size() - initial_size;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.h b/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.h
index 2d7b4605247..b504f45e81b 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.h
@@ -16,7 +16,7 @@
#include "lldb/Core/dwarf.h"
#include "lldb/lldb-defines.h"
-class SymbolFileDWARF;
+class DWARFUnit;
class NameToDIE {
public:
@@ -38,8 +38,8 @@ public:
size_t Find(const lldb_private::RegularExpression &regex,
DIEArray &info_array) const;
- size_t FindAllEntriesForCompileUnit(dw_offset_t cu_offset,
- DIEArray &info_array) const;
+ size_t FindAllEntriesForUnit(const DWARFUnit &unit,
+ DIEArray &info_array) const;
void
ForEach(std::function<bool(lldb_private::ConstString name,
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index cb8ab15ea14..e2ddcfc5d64 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -1199,6 +1199,15 @@ void SymbolFileDWARF::ParseDeclsForContext(CompilerDeclContext decl_ctx) {
ast_parser->GetDeclForUIDFromDWARF(decl);
}
+user_id_t SymbolFileDWARF::GetUID(DIERef ref) {
+ if (GetDebugMapSymfile())
+ return GetID() | ref.die_offset();
+
+ return user_id_t(GetDwoNum().getValueOr(0x7fffffff)) << 32 |
+ ref.die_offset() |
+ (lldb::user_id_t(ref.section() == DIERef::Section::DebugTypes) << 63);
+}
+
llvm::Optional<SymbolFileDWARF::DecodedUID>
SymbolFileDWARF::DecodeUID(lldb::user_id_t uid) {
// This method can be called without going through the symbol vendor so we
@@ -1215,25 +1224,20 @@ SymbolFileDWARF::DecodeUID(lldb::user_id_t uid) {
SymbolFileDWARF *dwarf = debug_map->GetSymbolFileByOSOIndex(
debug_map->GetOSOIndexFromUserID(uid));
return DecodedUID{
- *dwarf,
- {DIERef::Section::DebugInfo, DW_INVALID_OFFSET, dw_offset_t(uid)}};
+ *dwarf, {llvm::None, DIERef::Section::DebugInfo, dw_offset_t(uid)}};
}
- DIERef::Section section =
- uid >> 63 ? DIERef::Section::DebugTypes : DIERef::Section::DebugInfo;
- uint32_t dwarf_id = uid >> 32 & 0x7fffffff;
dw_offset_t die_offset = uid;
-
if (die_offset == DW_INVALID_OFFSET)
return llvm::None;
- SymbolFileDWARF *dwarf = this;
- if (DebugInfo()) {
- if (DWARFUnit *unit = DebugInfo()->GetUnitAtIndex(dwarf_id)) {
- if (unit->GetDwoSymbolFile())
- dwarf = unit->GetDwoSymbolFile();
- }
- }
- return DecodedUID{*dwarf, {section, DW_INVALID_OFFSET, die_offset}};
+ DIERef::Section section =
+ uid >> 63 ? DIERef::Section::DebugTypes : DIERef::Section::DebugInfo;
+
+ llvm::Optional<uint32_t> dwo_num = uid >> 32 & 0x7fffffff;
+ if (*dwo_num == 0x7fffffff)
+ dwo_num = llvm::None;
+
+ return DecodedUID{*this, {dwo_num, section, die_offset}};
}
DWARFDIE
@@ -1493,6 +1497,14 @@ lldb::ModuleSP SymbolFileDWARF::GetDWOModule(ConstString name) {
DWARFDIE
SymbolFileDWARF::GetDIE(const DIERef &die_ref) {
+ if (die_ref.dwo_num()) {
+ return DebugInfo()
+ ->GetUnitAtIndex(*die_ref.dwo_num())
+ ->GetDwoSymbolFile()
+ ->GetDIE(die_ref);
+ }
+
+
DWARFDebugInfo *debug_info = DebugInfo();
if (debug_info)
return debug_info->GetDIE(die_ref);
@@ -2235,10 +2247,6 @@ uint32_t SymbolFileDWARF::FindFunctions(
const uint32_t original_size = sc_list.GetSize();
- DWARFDebugInfo *info = DebugInfo();
- if (info == nullptr)
- return 0;
-
llvm::DenseSet<const DWARFDebugInfoEntry *> resolved_dies;
DIEArray offsets;
CompilerDeclContext empty_decl_ctx;
@@ -2246,7 +2254,7 @@ uint32_t SymbolFileDWARF::FindFunctions(
parent_decl_ctx = &empty_decl_ctx;
std::vector<DWARFDIE> dies;
- m_index->GetFunctions(name, *info, *parent_decl_ctx, name_type_mask, dies);
+ m_index->GetFunctions(name, *this, *parent_decl_ctx, name_type_mask, dies);
for (const DWARFDIE &die: dies) {
if (resolved_dies.insert(die.GetDIE()).second)
ResolveFunction(die, include_inlines, sc_list);
@@ -3081,7 +3089,8 @@ size_t SymbolFileDWARF::ParseVariablesForContext(const SymbolContext &sc) {
sc.comp_unit->SetVariableList(variables);
DIEArray die_offsets;
- m_index->GetGlobalVariables(*dwarf_cu, die_offsets);
+ m_index->GetGlobalVariables(dwarf_cu->GetNonSkeletonUnit(),
+ die_offsets);
const size_t num_matches = die_offsets.size();
if (num_matches) {
for (size_t i = 0; i < num_matches; ++i) {
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
index a4929df6fe5..018af47305f 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -275,11 +275,7 @@ public:
return ref ? GetUID(*ref) : LLDB_INVALID_UID;
}
- lldb::user_id_t GetUID(const DIERef &ref) {
- return GetID() | ref.die_offset() |
- (lldb::user_id_t(ref.section() == DIERef::Section::DebugTypes)
- << 63);
- }
+ lldb::user_id_t GetUID(DIERef ref);
virtual std::unique_ptr<SymbolFileDWARFDwo>
GetDwoSymbolFileForCompileUnit(DWARFUnit &dwarf_cu,
@@ -290,6 +286,8 @@ public:
// the method returns a pointer to the base compile unit.
virtual DWARFCompileUnit *GetBaseCompileUnit() { return nullptr; }
+ virtual llvm::Optional<uint32_t> GetDwoNum() { return llvm::None; }
+
static bool
DIEInDeclContext(const lldb_private::CompilerDeclContext *parent_decl_ctx,
const DWARFDIE &die);
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
index 5ddbbd0c606..c6911449c73 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
@@ -124,8 +124,7 @@ SymbolFileDWARFDwo::GetTypeSystemForLanguage(LanguageType language) {
DWARFDIE
SymbolFileDWARFDwo::GetDIE(const DIERef &die_ref) {
- lldbassert(!die_ref.unit_offset() ||
- *die_ref.unit_offset() == m_base_dwarf_cu.GetOffset());
- return DebugInfo()->GetDIEForDIEOffset(die_ref.section(),
- die_ref.die_offset());
+ if (*die_ref.dwo_num() == GetDwoNum())
+ return DebugInfo()->GetDIE(die_ref);
+ return GetBaseSymbolFile().GetDIE(die_ref);
}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
index 47fa36c6c86..663f2d40054 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
@@ -44,6 +44,8 @@ public:
DWARFCompileUnit *GetBaseCompileUnit() override { return &m_base_dwarf_cu; }
+ llvm::Optional<uint32_t> GetDwoNum() override { return GetID() >> 32; }
+
protected:
void LoadSectionData(lldb::SectionType sect_type,
lldb_private::DWARFDataExtractor &data) override;
OpenPOWER on IntegriCloud