DebugInfo: Use low_pc relative debug_ranges under fission when the CU has a low_pc

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
This commit is contained in:
David Blaikie 2015-05-02 02:31:49 +00:00
parent e243e06cbb
commit e97eefc9c6
2 changed files with 8 additions and 3 deletions

View 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());
}
}

View 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
@ -65,10 +67,13 @@
; 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: