Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp @@ -53,13 +53,20 @@ } // Manually build arange data for everything that wasn't in .debug_aranges. - const size_t num_units = GetNumUnits(); - for (size_t idx = 0; idx < num_units; ++idx) { - DWARFUnit *cu = GetUnitAtIndex(idx); - - dw_offset_t offset = cu->GetOffset(); - if (cus_with_data.find(offset) == cus_with_data.end()) - cu->BuildAddressRangeTable(m_cu_aranges_up.get()); + // Skip this step for dSYMs as we can trust dsymutil to have emitted complete + // aranges. + const bool is_dsym = + m_dwarf.GetObjectFile() && + m_dwarf.GetObjectFile()->GetType() == ObjectFile::eTypeDebugInfo; + if (!is_dsym) { + const size_t num_units = GetNumUnits(); + for (size_t idx = 0; idx < num_units; ++idx) { + DWARFUnit *cu = GetUnitAtIndex(idx); + + dw_offset_t offset = cu->GetOffset(); + if (cus_with_data.find(offset) == cus_with_data.end()) + cu->BuildAddressRangeTable(m_cu_aranges_up.get()); + } } const bool minimize = true;