diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -705,7 +705,13 @@ // We already parsed this compile unit, had out a shared pointer to it cu_sp = comp_unit->shared_from_this(); } else { - if (dwarf_cu.GetOffset() == 0 && GetDebugMapSymfile()) { + if (GetDebugMapSymfile()) { + if (dwarf_cu.GetOffset() != 0) { + Log *log = LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO); + LLDB_LOG(log, "DebugMap cannot address DWARF file CU offset 0x%x", + dwarf_cu.GetOffset()); + return {}; + } // Let the debug map create the compile unit cu_sp = m_debug_map_symfile->GetCompileUnit(this); dwarf_cu.SetUserData(cu_sp.get()); @@ -732,8 +738,6 @@ // If there is no DWO, there is no reason to initialize // lazily; we will do eager initialization in that case. - if (GetDebugMapSymfile()) - return false; const DWARFBaseDIE cu_die = dwarf_cu.GetUnitDIEOnly(); if (!cu_die) return false;