Add support for DW_AT_ranges_base attribute
It is a new attribute emitted by clang as a GNU extension and will
be part of Dwarf5. The purpose of the attribute is to specify a compile
unit level base value for all DW_AT_ranges to reduce the number of
relocations have to be done by the linker.
Fixes (at least partially): https://llvm.org/pr28826
Differential revision: https://reviews.llvm.org/D24514
llvm-svn: 281595
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index e9edee6..5c8083c 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -3810,7 +3810,8 @@
             if (form_value.Form() == DW_FORM_sec_offset) {
               DWARFRangeList dwarf_scope_ranges;
               const DWARFDebugRanges *debug_ranges = DebugRanges();
-              debug_ranges->FindRanges(form_value.Unsigned(),
+              debug_ranges->FindRanges(die.GetCU()->GetRangesBase(),
+                                       form_value.Unsigned(),
                                        dwarf_scope_ranges);
 
               // All DW_AT_start_scope are relative to the base address of the