Index: source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp +++ source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp @@ -306,9 +306,11 @@ } // m_die_array_mutex must be already held as read/write. -void DWARFUnit::AddUnitDIE(const DWARFDebugInfoEntry &cu_die) { - SetAddrBase( - cu_die.GetAttributeValueAsUnsigned(m_dwarf, this, DW_AT_addr_base, 0)); +void DWARFUnit::AddUnitDIE(const DWARFDebugInfoEntry &cu_die) { + dw_addr_t addr_base = + cu_die.GetAttributeValueAsUnsigned(m_dwarf, this, DW_AT_addr_base, 0); + SetAddrBase(addr_base); + SetRangesBase(cu_die.GetAttributeValueAsUnsigned(m_dwarf, this, DW_AT_rnglists_base, 0)); @@ -342,8 +344,12 @@ m_dwo_symbol_file = std::move(dwo_symbol_file); - dw_addr_t addr_base = - cu_die.GetAttributeValueAsUnsigned(m_dwarf, this, DW_AT_GNU_addr_base, 0); + // Here we make DWO CU use address base set in the skeleton unit. + // DWO files in pre-DWARF v5 could use DW_AT_GNU_addr_base. + // Starting from DWARF v5, the DW_AT_addr_base is used instead. + if (!addr_base) + addr_base = + cu_die.GetAttributeValueAsUnsigned(m_dwarf, this, DW_AT_GNU_addr_base, 0); dwo_cu->SetAddrBase(addr_base); dw_addr_t ranges_base = cu_die.GetAttributeValueAsUnsigned(