diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp index 5196ce89a2c13..8217c85f86014 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp @@ -611,7 +611,11 @@ void DWARFDebugInfoEntry::BuildFunctionAddressRangeTable( DWARFUnit *cu, DWARFDebugAranges *debug_aranges) const { Log *log = GetLog(DWARFLog::DebugInfo); if (m_tag) { - if (m_tag == DW_TAG_subprogram) { + // Subprogram forward declarations don't have + // DW_AT_ranges/DW_AT_low_pc/DW_AT_high_pc attributes, so don't even try + // getting address range information for them. + if (m_tag == DW_TAG_subprogram && + !GetAttributeValueAsOptionalUnsigned(cu, DW_AT_declaration)) { if (llvm::Expected ranges = GetAttributeAddressRanges(cu, /*check_hi_lo_pc=*/true)) { for (const auto &r : *ranges)