DebugInfo: Use low_pc relative debug_ranges under fission when the CU has a low_pc
authorDavid Blaikie <dblaikie@gmail.com>
Sat, 2 May 2015 02:31:49 +0000 (02:31 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Sat, 2 May 2015 02:31:49 +0000 (02:31 +0000)
Seems we were setting the base address on the wrong DwarfCompileUnit
object so it wasn't being used when generating the ranges.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236377 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp
test/DebugInfo/X86/fission-inline.ll

index 4f2b47f..4fe4f26 100644 (file)
@@ -585,7 +585,7 @@ void DwarfDebug::finalizeModuleInfo() {
         // 2.17.3).
         U.addUInt(U.getUnitDie(), dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr, 0);
       else
-        TheCU.setBaseAddress(TheCU.getRanges().front().getStart());
+        U.setBaseAddress(TheCU.getRanges().front().getStart());
       U.attachRangesOrLowHighPC(U.getUnitDie(), TheCU.takeRanges());
     }
   }
index 2311857..53e7827 100644 (file)
@@ -1,4 +1,6 @@
-; RUN: llc -split-dwarf=Enable -O0 < %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj | llvm-dwarfdump -debug-dump=info - | FileCheck %s
+; RUN: llc -split-dwarf=Enable -O0 < %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj > %t
+; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
+; RUN: llvm-objdump -r %t | FileCheck --check-prefix=RELOCS %s
 
 ; Test the emission of gmlt-like inlining information into the skeleton unit.
 ; This allows inline-aware symbolication/backtracing given only the linked
 ; CHECK:        DW_TAG_inlined_subroutine
 ; CHECK-NEXT:     DW_AT_abstract_origin {{.*}} "f2<int>"
 ; CHECK-NEXT:     DW_AT_ranges
-; CHECK-NEXT:     DW_AT_call_file
+; CHECK-NOT: {{DW_AT|DW_TAG|NULL}}
+; CHECK:     DW_AT_call_file
 ; CHECK-NEXT:     DW_AT_call_line {{.*}} (18)
 ; CHECK-NOT: DW_
 
+; RELOCS-NOT: RELOCATION RECORDS FOR [.rela.debug_ranges]
+
 ; Function Attrs: uwtable
 define void @_ZN3foo2f3Ez(...) #0 align 2 {
 entry: