[llvm] r174479 - Attempt to recover gdb bot after r174445.

David Blaikie dblaikie at gmail.com
Mon Feb 3 14:09:01 PST 2014


On Fri, Feb 8, 2013 at 3:44 PM, Manman Ren <mren at apple.com> wrote:

>
> On Feb 8, 2013, at 3:39 PM, David Blaikie <dblaikie at gmail.com> wrote:
>
> > On Fri, Feb 8, 2013 at 3:35 PM, Manman Ren <mren at apple.com> wrote:
> >>
> >> On Feb 8, 2013, at 3:31 PM, David Blaikie <dblaikie at gmail.com> wrote:
> >>
> >>> On Fri, Feb 8, 2013 at 3:29 PM, Manman Ren <mren at apple.com> wrote:
> >>>>
> >>>> On Feb 8, 2013, at 3:21 PM, David Blaikie <dblaikie at gmail.com> wrote:
> >>>>
> >>>>> On Fri, Feb 8, 2013 at 3:14 PM, Manman Ren <mren at apple.com> wrote:
> >>>>>>
> >>>>>> On Feb 8, 2013, at 11:41 AM, David Blaikie <dblaikie at gmail.com>
> wrote:
> >>>>>>
> >>>>>>> On Tue, Feb 5, 2013 at 4:59 PM, Manman Ren <mren at apple.com> wrote:
> >>>>>>>> Author: mren
> >>>>>>>> Date: Tue Feb  5 18:59:41 2013
> >>>>>>>> New Revision: 174479
> >>>>>>>>
> >>>>>>>> URL: http://llvm.org/viewvc/llvm-project?rev=174479&view=rev
> >>>>>>>> Log:
> >>>>>>>> Attempt to recover gdb bot after r174445.
> >>>>>>>>
> >>>>>>>> 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.
> >>>>>>>
> >>>>>>> This seems to not have completely fixed problems of this kind. I
> >>>>>>> discovered more breakage in DragonEgg. Any attempt to build with
> debug
> >>>>>>> info in DragonEgg is currently broken due to the original change,
> even
> >>>>>>> after this fix.
> >>>>>>>
> >>>>>>> You can reproduce this without dragonegg:
> >>>>>>>
> >>>>>>> $ echo "int main() { }" | clang -x c++ -g -S - -o hello.s && clang
> hello.s
> >>>>>>
> >>>>>> This simple example worked for me with source up to r174431.
> >>>>>
> >>>>> It works for me when I revert r174479 + r174445, fails for me with
> ToT.
> >>>> Works for me without any local change:
> >>>> Maybe it is because our ld version.
> >>>> I got another email from Duncan, there the version of ld is: GNU ld
> (GNU Binutils for Debian) 2.20.1-system.20100303
> >>>
> >>> I'm not sure how it'd be an ld version issue - when I look at the
> >>> assembly produced by the above command I see a reference to the
> >>> .Lline_table_start0 symbol in the debug info & no other mention of it.
> >>> Seems pretty clearly something that would not be able to be linked...
> >>>
> >>> does your hello.s from the above command not contain any mention of
> >>> line_table_start0?
> >> No, my hello.s does not have line_table_start0.
> >
> > That bit I find a little surprising - but I'm probably still not
> > understanding something.
> >
> > Eric pointed out on IRC/offline, though, that this probably doesn't
> > reproduce on Darwin as we unconditionally emit the line table on
> > Darwin for some reason (perhaps the linker doesn't support the .loc
> > directives?).
> >
> > if you try:
> >
> > clang hello.cpp -g -S -target i386-pc-linux-gnu
> >
> > you'll see the hello.s file contains a reference to
> > .Lline_table_start0 but no definition for it - this is a/the problem
>
> I see the problem, we are seeing different behavior because of this flag
> Asm->MAI->doesDwarfUseRelocationsAcrossSections()
> I will check in a fix soon.
>
> Thanks,
> Manman


(it'd be useful to have a follow up reply to this review thread mentioning
which revision your fix was committed in (and, in the future, to have that
revision mention the revision it was intended to fix - bidirectional
association, makes it easier when trying to resurrect the history of
changes))


> >>>>>>>> Modified:
> >>>>>>>> llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
> >>>>>>>> llvm/trunk/test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll
> >>>>>>>> llvm/trunk/test/CodeGen/ARM/2011-08-02-MergedGlobalDbg.ll
> >>>>>>>> llvm/trunk/test/CodeGen/X86/2011-01-24-DbgValue-Before-Use.ll
> >>>>>>>> llvm/trunk/test/CodeGen/X86/dbg-value-location.ll
> >>>>>>>> llvm/trunk/test/DebugInfo/X86/stringpool.ll
> >>>>>>>>
> >>>>>>>> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
> >>>>>>>> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=174479&r1=174478&r2=174479&view=diff
> >>>>>>>>
> ==============================================================================
> >>>>>>>> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
> >>>>>>>> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Feb  5
> 18:59:41 2013
> >>>>>>>> @@ -674,6 +674,8 @@ CompileUnit *DwarfDebug::constructCompil
> >>>>>>>> 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);
>

And in looking at this actual code... this line seems problematic/wrong.
Using a constant will never be correct if this debug info is ever linked
with another object file (because, while it may be a zero offset now, once
linked it may become non-zero).

I'm still trying to wrap my head around why we have a special case for
textual output... but I'll see what I can manage/understand with more
staring.

- David


> >>>>>>>> else
> >>>>>>>>  NewCU->addDelta(Die, dwarf::DW_AT_stmt_list,
> dwarf::DW_FORM_data4,
> >>>>>>>>                  LineTableStartSym,
> Asm->GetTempSymbol("section_line"));
> >>>>>>>>
> >>>>>>>> Modified:
> llvm/trunk/test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll
> >>>>>>>> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll?rev=174479&r1=174478&r2=174479&view=diff
> >>>>>>>>
> ==============================================================================
> >>>>>>>> --- llvm/trunk/test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll
> (original)
> >>>>>>>> +++ llvm/trunk/test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll Tue
> Feb  5 18:59:41 2013
> >>>>>>>> @@ -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
> >>>>>>>>
> >>>>>>>> Modified:
> llvm/trunk/test/CodeGen/ARM/2011-08-02-MergedGlobalDbg.ll
> >>>>>>>> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2011-08-02-MergedGlobalDbg.ll?rev=174479&r1=174478&r2=174479&view=diff
> >>>>>>>>
> ==============================================================================
> >>>>>>>> --- llvm/trunk/test/CodeGen/ARM/2011-08-02-MergedGlobalDbg.ll
> (original)
> >>>>>>>> +++ llvm/trunk/test/CodeGen/ARM/2011-08-02-MergedGlobalDbg.ll Tue
> Feb  5 18:59:41 2013
> >>>>>>>> @@ -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
> >>>>>>>>
> >>>>>>>> Modified:
> llvm/trunk/test/CodeGen/X86/2011-01-24-DbgValue-Before-Use.ll
> >>>>>>>> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2011-01-24-DbgValue-Before-Use.ll?rev=174479&r1=174478&r2=174479&view=diff
> >>>>>>>>
> ==============================================================================
> >>>>>>>> --- llvm/trunk/test/CodeGen/X86/2011-01-24-DbgValue-Before-Use.ll
> (original)
> >>>>>>>> +++ llvm/trunk/test/CodeGen/X86/2011-01-24-DbgValue-Before-Use.ll
> Tue Feb  5 18:59:41 2013
> >>>>>>>> @@ -4,7 +4,7 @@ target datalayout = "e-p:64:64:64-i1:8:8
> >>>>>>>> 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
> >>>>>>>>
> >>>>>>>> Modified: llvm/trunk/test/CodeGen/X86/dbg-value-location.ll
> >>>>>>>> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/dbg-value-location.ll?rev=174479&r1=174478&r2=174479&view=diff
> >>>>>>>>
> ==============================================================================
> >>>>>>>> --- llvm/trunk/test/CodeGen/X86/dbg-value-location.ll (original)
> >>>>>>>> +++ llvm/trunk/test/CodeGen/X86/dbg-value-location.ll Tue Feb  5
> 18:59:41 2013
> >>>>>>>> @@ -4,7 +4,7 @@ target datalayout = "e-p:64:64:64-i1:8:8
> >>>>>>>> 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
> >>>>>>>>
> >>>>>>>> Modified: llvm/trunk/test/DebugInfo/X86/stringpool.ll
> >>>>>>>> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/stringpool.ll?rev=174479&r1=174478&r2=174479&view=diff
> >>>>>>>>
> ==============================================================================
> >>>>>>>> --- llvm/trunk/test/DebugInfo/X86/stringpool.ll (original)
> >>>>>>>> +++ llvm/trunk/test/DebugInfo/X86/stringpool.ll Tue Feb  5
> 18:59:41 2013
> >>>>>>>> @@ -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
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> _______________________________________________
> >>>>>>>> llvm-commits mailing list
> >>>>>>>> llvm-commits at cs.uiuc.edu
> >>>>>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> >>>>>>
> >>>>
> >>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140203/9bac9aad/attachment.html>


More information about the llvm-commits mailing list