Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -1259,7 +1259,20 @@ debug_map->GetOSOIndexFromUserID(uid)); return {dwarf, {DW_INVALID_OFFSET, dw_offset_t(uid)}}; } - return {this, {dw_offset_t(uid >> 32), dw_offset_t(uid)}}; + uint32_t dwarf_id = uid >> 32; + dw_offset_t die_offset = uid; + + if (die_offset == DW_INVALID_OFFSET) + return {nullptr, DIERef()}; + + SymbolFileDWARF *dwarf = this; + if (DebugInfo()) { + if (DWARFUnit *unit = DebugInfo()->GetCompileUnitAtIndex(dwarf_id)) { + if (unit->GetDwoSymbolFile()) + dwarf = unit->GetDwoSymbolFile(); + } + } + return {dwarf, {DW_INVALID_OFFSET, die_offset}}; } DWARFDIE Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp @@ -23,7 +23,7 @@ DWARFUnit *dwarf_cu) : SymbolFileDWARF(objfile.get()), m_obj_file_sp(objfile), m_base_dwarf_cu(dwarf_cu) { - SetID(((lldb::user_id_t)dwarf_cu->GetOffset()) << 32); + SetID(((lldb::user_id_t)dwarf_cu->GetID()) << 32); } void SymbolFileDWARFDwo::LoadSectionData(lldb::SectionType sect_type, @@ -158,6 +158,7 @@ DWARFDIE SymbolFileDWARFDwo::GetDIE(const DIERef &die_ref) { - lldbassert(m_base_dwarf_cu->GetOffset() == die_ref.cu_offset); + lldbassert(die_ref.cu_offset == m_base_dwarf_cu->GetOffset() || + die_ref.cu_offset == DW_INVALID_OFFSET); return DebugInfo()->GetDIEForDIEOffset(die_ref.die_offset); }