Author: labath Date: Thu Mar 31 08:30:04 2016 New Revision: 265011 URL: http://llvm.org/viewvc/llvm-project?rev=265011&view=rev Log: Fix DWO breakage in r264909
Summary: In case of Dwo, DIERef stores a compile unit offset in the main object file, and not in the dwo. The implementation of SymbolFileDWARFDwo::GetDIE inherited from SymbolFileDWARF tried to lookup the compilation unit in the DWO based on the main object file offset (and failed). I change the implementation to verify the DIERef indeed references compile unit belonging to this dwo and then lookup the die based on the die offset alone. Includes a couple of fixes for mismatched struct/class tags. Reviewers: tberghammer, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D18646 Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h?rev=265011&r1=265010&r2=265011&view=diff ============================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h Thu Mar 31 08:30:04 2016 @@ -68,7 +68,7 @@ public: friend class SymbolFileDWARFDebugMap; friend class SymbolFileDWARFDwo; friend class DebugMapModule; - friend class DIERef; + friend struct DIERef; friend class DWARFCompileUnit; friend class DWARFDIE; friend class DWARFASTParserClang; @@ -326,7 +326,7 @@ public: lldb::ModuleSP GetDWOModule (lldb_private::ConstString name); - DWARFDIE + virtual DWARFDIE GetDIE(const DIERef &die_ref); virtual std::unique_ptr<SymbolFileDWARFDwo> Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h?rev=265011&r1=265010&r2=265011&view=diff ============================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h Thu Mar 31 08:30:04 2016 @@ -108,7 +108,7 @@ protected: }; friend class DebugMapModule; - friend class DIERef; + friend struct DIERef; friend class DWARFASTParserClang; friend class DWARFCompileUnit; friend class SymbolFileDWARF; Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp?rev=265011&r1=265010&r2=265011&view=diff ============================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp Thu Mar 31 08:30:04 2016 @@ -129,3 +129,10 @@ SymbolFileDWARFDwo::GetTypeSystemForLang { return GetBaseSymbolFile()->GetTypeSystemForLanguage(language); } + +DWARFDIE +SymbolFileDWARFDwo::GetDIE(const DIERef &die_ref) +{ + assert(m_base_dwarf_cu->GetOffset() == die_ref.cu_offset); + return DebugInfo()->GetDIEForDIEOffset(die_ref.die_offset); +} Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h?rev=265011&r1=265010&r2=265011&view=diff ============================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h Thu Mar 31 08:30:04 2016 @@ -38,6 +38,9 @@ public: lldb_private::TypeSystem* GetTypeSystemForLanguage(lldb::LanguageType language) override; + DWARFDIE + GetDIE(const DIERef &die_ref) override; + std::unique_ptr<SymbolFileDWARFDwo> GetDwoSymbolFileForCompileUnit(DWARFCompileUnit &dwarf_cu, const DWARFDebugInfoEntry &cu_die) override { _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits