This revision was automatically updated to reflect the committed changes.
Closed by commit rL318554: [lldb] Ensure that dwo/dwp are not double-indexed
(authored by alexshap).
Changed prior to commit:
https://reviews.llvm.org/D39825?vs=122389&id=123403#toc
Repository:
rL LLVM
https://reviews.llvm.org/D39825
Files:
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -209,6 +209,10 @@
return nullptr;
}
+DWARFCompileUnit *SymbolFileDWARF::GetBaseCompileUnit() {
+ return nullptr;
+}
+
void SymbolFileDWARF::Initialize() {
LogChannelDWARF::Initialize();
PluginManager::RegisterPlugin(GetPluginNameStatic(),
Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
===================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
@@ -620,6 +620,10 @@
NameToDIE &objc_class_selectors,
NameToDIE &globals, NameToDIE &types,
NameToDIE &namespaces) {
+ assert(!m_dwarf2Data->GetBaseCompileUnit() &&
+ "DWARFCompileUnit associated with .dwo or .dwp "
+ "should not be indexed directly");
+
Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS));
if (log) {
Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
===================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -276,8 +276,8 @@
GetCompUnitForDWARFCompUnit(DWARFCompileUnit *dwarf_cu,
uint32_t cu_idx = UINT32_MAX);
- size_t GetObjCMethodDIEOffsets(lldb_private::ConstString class_name,
- DIEArray &method_die_offsets);
+ virtual size_t GetObjCMethodDIEOffsets(lldb_private::ConstString class_name,
+ DIEArray &method_die_offsets);
bool Supports_DW_AT_APPLE_objc_complete_type(DWARFCompileUnit *cu);
@@ -299,6 +299,11 @@
GetDwoSymbolFileForCompileUnit(DWARFCompileUnit &dwarf_cu,
const DWARFDebugInfoEntry &cu_die);
+ // For regular SymbolFileDWARF instances the method returns nullptr,
+ // for the instances of the subclass SymbolFileDWARFDwo
+ // the method returns a pointer to the base compile unit.
+ virtual DWARFCompileUnit *GetBaseCompileUnit();
+
protected:
typedef llvm::DenseMap<const DWARFDebugInfoEntry *, lldb_private::Type *>
DIEToTypePtr;
@@ -392,7 +397,7 @@
virtual lldb::TypeSP
FindDefinitionTypeForDWARFDeclContext(const DWARFDeclContext &die_decl_ctx);
- lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(
+ virtual lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(
const DWARFDIE &die, const lldb_private::ConstString &type_name,
bool must_be_implementation);
Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
===================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
@@ -99,6 +99,12 @@
return GetBaseSymbolFile()->GetForwardDeclClangTypeToDie();
}
+size_t SymbolFileDWARFDwo::GetObjCMethodDIEOffsets(
+ lldb_private::ConstString class_name, DIEArray &method_die_offsets) {
+ return GetBaseSymbolFile()->GetObjCMethodDIEOffsets(
+ class_name, method_die_offsets);
+}
+
UniqueDWARFASTTypeMap &SymbolFileDWARFDwo::GetUniqueDWARFASTTypeMap() {
return GetBaseSymbolFile()->GetUniqueDWARFASTTypeMap();
}
@@ -109,6 +115,17 @@
die_decl_ctx);
}
+lldb::TypeSP SymbolFileDWARFDwo::FindCompleteObjCDefinitionTypeForDIE(
+ const DWARFDIE &die, const lldb_private::ConstString &type_name,
+ bool must_be_implementation) {
+ return GetBaseSymbolFile()->FindCompleteObjCDefinitionTypeForDIE(
+ die, type_name, must_be_implementation);
+}
+
+DWARFCompileUnit *SymbolFileDWARFDwo::GetBaseCompileUnit() {
+ return m_base_dwarf_cu;
+}
+
SymbolFileDWARF *SymbolFileDWARFDwo::GetBaseSymbolFile() {
return m_base_dwarf_cu->GetSymbolFileDWARF();
}
Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
===================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
@@ -33,6 +33,9 @@
lldb_private::DWARFExpression::LocationListFormat
GetLocationListFormat() const override;
+ size_t GetObjCMethodDIEOffsets(lldb_private::ConstString class_name,
+ DIEArray &method_die_offsets) override;
+
lldb_private::TypeSystem *
GetTypeSystemForLanguage(lldb::LanguageType language) override;
@@ -45,6 +48,8 @@
return nullptr;
}
+ DWARFCompileUnit *GetBaseCompileUnit() override;
+
protected:
void LoadSectionData(lldb::SectionType sect_type,
lldb_private::DWARFDataExtractor &data) override;
@@ -62,6 +67,10 @@
lldb::TypeSP FindDefinitionTypeForDWARFDeclContext(
const DWARFDeclContext &die_decl_ctx) override;
+ lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(
+ const DWARFDIE &die, const lldb_private::ConstString &type_name,
+ bool must_be_implementation) override;
+
SymbolFileDWARF *GetBaseSymbolFile();
lldb::ObjectFileSP m_obj_file_sp;
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits