Index: lldb/include/lldb/Symbol/ObjectFile.h =================================================================== --- lldb/include/lldb/Symbol/ObjectFile.h +++ lldb/include/lldb/Symbol/ObjectFile.h @@ -682,6 +682,8 @@ return symbol_name; } + virtual bool CanTrustAddressRanges() { return false; } + static lldb::SymbolType GetSymbolTypeFromName( llvm::StringRef name, lldb::SymbolType symbol_type_hint = lldb::eSymbolTypeUndefined); Index: lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h =================================================================== --- lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h +++ lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h @@ -143,6 +143,8 @@ bool GetIsDynamicLinkEditor() override; + bool CanTrustAddressRanges() override; + static bool ParseHeader(lldb_private::DataExtractor &data, lldb::offset_t *data_offset_ptr, llvm::MachO::mach_header &header); Index: lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp =================================================================== --- lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -6094,6 +6094,10 @@ return m_header.filetype == llvm::MachO::MH_DYLINKER; } +bool ObjectFileMachO::CanTrustAddressRanges() { + return m_header.filetype == llvm::MachO::MH_DSYM; +} + bool ObjectFileMachO::AllowAssemblyEmulationUnwindPlans() { return m_allow_assembly_emulation_unwind_plans; } Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp @@ -55,10 +55,8 @@ // Manually build arange data for everything that wasn't in .debug_aranges. // 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) { + ObjectFile *OF = m_dwarf.GetObjectFile(); + if (!!OF || !OF->CanTrustAddressRanges()) { const size_t num_units = GetNumUnits(); for (size_t idx = 0; idx < num_units; ++idx) { DWARFUnit *cu = GetUnitAtIndex(idx);