Attempt to recover gdb bot after r174445.
authorManman Ren <mren@apple.com>
Wed, 6 Feb 2013 00:59:41 +0000 (00:59 +0000)
committerManman Ren <mren@apple.com>
Wed, 6 Feb 2013 00:59:41 +0000 (00:59 +0000)
Failure: undefined symbol 'Lline_table_start0'.
Root-cause: we use a symbol subtraction to calculate at_stmt_list, but
the line table entries are not dumped in the assembly.
Fix: use zero instead of a symbol subtraction for Compile Unit 0.

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

lib/CodeGen/AsmPrinter/DwarfDebug.cpp
test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll
test/CodeGen/ARM/2011-08-02-MergedGlobalDbg.ll
test/CodeGen/X86/2011-01-24-DbgValue-Before-Use.ll
test/CodeGen/X86/dbg-value-location.ll
test/DebugInfo/X86/stringpool.ll

index dcaab316b5f113961fd939992533958e3d1e974a..340949007fa1c3fa34de05ca25f0a253074145dd 100644 (file)
@@ -674,6 +674,8 @@ CompileUnit *DwarfDebug::constructCompileUnit(const MDNode *N) {
   if (Asm->MAI->doesDwarfUseRelocationsAcrossSections())
     NewCU->addLabel(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4,
                     LineTableStartSym);
+  else if (NewCU->getUniqueID() == 0)
+    NewCU->addUInt(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4, 0);
   else
     NewCU->addDelta(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4,
                     LineTableStartSym, Asm->GetTempSymbol("section_line"));
index dba2af0883238ed1c22e97f717d79a2092d77e27..ca88eedcea601e1ee5bd31472d9505728b31e4d7 100644 (file)
@@ -17,7 +17,7 @@ target triple = "thumbv7-apple-darwin10"
 ; DW_OP_constu
 ; offset
 
-;CHECK: .long Lset7
+;CHECK: .long Lset6
 ;CHECK-NEXT:        @ DW_AT_type
 ;CHECK-NEXT:        @ DW_AT_decl_file
 ;CHECK-NEXT:        @ DW_AT_decl_line
index 52b57e83e33063ba523638db82df4d3baf58197b..f2b0c5d7d090c1c34c8511f8fc50ad0da88acbac 100644 (file)
@@ -8,7 +8,7 @@
 ; DW_OP_constu
 ; offset
 
-;CHECK: .long Lset34
+;CHECK: .long Lset33
 ;CHECK-NEXT:        @ DW_AT_type
 ;CHECK-NEXT:        @ DW_AT_decl_file
 ;CHECK-NEXT:        @ DW_AT_decl_line
index ef37919f4a744814d695449aa481c2e84a4d0452..166dcf259989863b0050c04efd40b624ff145a6b 100644 (file)
@@ -4,7 +4,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
 target triple = "x86_64-apple-darwin10.0.0"
 
 ; Check debug info for variable z_s
-;CHECK: .long Lset14
+;CHECK: .long Lset13
 ;CHECK-NEXT:  ## DW_AT_decl_file
 ;CHECK-NEXT:  ## DW_AT_decl_line
 ;CHECK-NEXT:  ## DW_AT_type
index 198cd20150e4188a8e6a4becfae9d2da7936d2d6..05e29ecff03f46ddcf3576760ad78f1da5a4aac1 100644 (file)
@@ -4,7 +4,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
 target triple = "x86_64-apple-darwin10.0.0"
 ;Radar 8950491
 
-;CHECK: .long Lset6
+;CHECK: .long Lset5
 ;CHECK-NEXT:        ## DW_AT_decl_file
 ;CHECK-NEXT:        ## DW_AT_decl_line
 ;CHECK-NEXT:        ## DW_AT_type
index 4e2a2a2b0341b3f1ad2ef1a0efeeef7a382851ef..1e08d546e210bd01606b9aeb4a8e3c9a43ab34e1 100644 (file)
@@ -23,8 +23,8 @@
 ; LINUX-NEXT: .quad   yyyy
 
 ; Verify that we refer to 'yyyy' without a relocation.
-; DARWIN: Lset6 = Linfo_string3-Linfo_string          ## DW_AT_name
-; DARWIN-NEXT:        .long   Lset6
+; DARWIN: Lset5 = Linfo_string3-Linfo_string          ## DW_AT_name
+; DARWIN-NEXT:        .long   Lset5
 ; DARWIN-NEXT:        .long   39                      ## DW_AT_type
 ; DARWIN-NEXT:        .byte   1                       ## DW_AT_external
 ; DARWIN-NEXT:        .byte   1                       ## DW_AT_decl_file