<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 8, 2013 at 3:44 PM, Manman Ren <span dir="ltr"><<a href="mailto:mren@apple.com" target="_blank">mren@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
On Feb 8, 2013, at 3:39 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
<br>
> On Fri, Feb 8, 2013 at 3:35 PM, Manman Ren <<a href="mailto:mren@apple.com">mren@apple.com</a>> wrote:<br>
>><br>
>> On Feb 8, 2013, at 3:31 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
>><br>
>>> On Fri, Feb 8, 2013 at 3:29 PM, Manman Ren <<a href="mailto:mren@apple.com">mren@apple.com</a>> wrote:<br>
>>>><br>
>>>> On Feb 8, 2013, at 3:21 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
>>>><br>
>>>>> On Fri, Feb 8, 2013 at 3:14 PM, Manman Ren <<a href="mailto:mren@apple.com">mren@apple.com</a>> wrote:<br>
>>>>>><br>
>>>>>> On Feb 8, 2013, at 11:41 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
>>>>>><br>
>>>>>>> On Tue, Feb 5, 2013 at 4:59 PM, Manman Ren <<a href="mailto:mren@apple.com">mren@apple.com</a>> wrote:<br>
>>>>>>>> Author: mren<br>
>>>>>>>> Date: Tue Feb  5 18:59:41 2013<br>
>>>>>>>> New Revision: 174479<br>
>>>>>>>><br>
>>>>>>>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=174479&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=174479&view=rev</a><br>
>>>>>>>> Log:<br>
>>>>>>>> Attempt to recover gdb bot after r174445.<br>
>>>>>>>><br>
>>>>>>>> Failure: undefined symbol 'Lline_table_start0'.<br>
>>>>>>>> Root-cause: we use a symbol subtraction to calculate at_stmt_list, but<br>
>>>>>>>> the line table entries are not dumped in the assembly.<br>
>>>>>>>> Fix: use zero instead of a symbol subtraction for Compile Unit 0.<br>
>>>>>>><br>
>>>>>>> This seems to not have completely fixed problems of this kind. I<br>
>>>>>>> discovered more breakage in DragonEgg. Any attempt to build with debug<br>
>>>>>>> info in DragonEgg is currently broken due to the original change, even<br>
>>>>>>> after this fix.<br>
>>>>>>><br>
>>>>>>> You can reproduce this without dragonegg:<br>
>>>>>>><br>
>>>>>>> $ echo "int main() { }" | clang -x c++ -g -S - -o hello.s && clang hello.s<br>
>>>>>><br>
>>>>>> This simple example worked for me with source up to r174431.<br>
>>>>><br>
>>>>> It works for me when I revert r174479 + r174445, fails for me with ToT.<br>
>>>> Works for me without any local change:<br>
>>>> Maybe it is because our ld version.<br>
>>>> I got another email from Duncan, there the version of ld is: GNU ld (GNU Binutils for Debian) 2.20.1-system.20100303<br>
>>><br>
>>> I'm not sure how it'd be an ld version issue - when I look at the<br>
>>> assembly produced by the above command I see a reference to the<br>
>>> .Lline_table_start0 symbol in the debug info & no other mention of it.<br>
>>> Seems pretty clearly something that would not be able to be linked...<br>
>>><br>
>>> does your hello.s from the above command not contain any mention of<br>
>>> line_table_start0?<br>
>> No, my hello.s does not have line_table_start0.<br>
><br>
> That bit I find a little surprising - but I'm probably still not<br>
> understanding something.<br>
><br>
> Eric pointed out on IRC/offline, though, that this probably doesn't<br>
> reproduce on Darwin as we unconditionally emit the line table on<br>
> Darwin for some reason (perhaps the linker doesn't support the .loc<br>
> directives?).<br>
><br>
> if you try:<br>
><br>
> clang hello.cpp -g -S -target i386-pc-linux-gnu<br>
><br>
> you'll see the hello.s file contains a reference to<br>
> .Lline_table_start0 but no definition for it - this is a/the problem<br>
<br>
</div></div>I see the problem, we are seeing different behavior because of this flag<br>
Asm->MAI->doesDwarfUseRelocationsAcrossSections()<br>
I will check in a fix soon.<br>
<br>
Thanks,<br>
Manman</blockquote><div><br></div><div>(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))</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
>>>>>>>> Modified:<br>
>>>>>>>> llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
>>>>>>>> llvm/trunk/test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll<br>
>>>>>>>> llvm/trunk/test/CodeGen/ARM/2011-08-02-MergedGlobalDbg.ll<br>
>>>>>>>> llvm/trunk/test/CodeGen/X86/2011-01-24-DbgValue-Before-Use.ll<br>
>>>>>>>> llvm/trunk/test/CodeGen/X86/dbg-value-location.ll<br>
>>>>>>>> llvm/trunk/test/DebugInfo/X86/stringpool.ll<br>
>>>>>>>><br>
>>>>>>>> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
>>>>>>>> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=174479&r1=174478&r2=174479&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=174479&r1=174478&r2=174479&view=diff</a><br>

>>>>>>>> ==============================================================================<br>
>>>>>>>> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)<br>
>>>>>>>> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Feb  5 18:59:41 2013<br>
>>>>>>>> @@ -674,6 +674,8 @@ CompileUnit *DwarfDebug::constructCompil<br>
>>>>>>>> if (Asm->MAI->doesDwarfUseRelocationsAcrossSections())<br>
>>>>>>>>  NewCU->addLabel(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4,<br>
>>>>>>>>                  LineTableStartSym);<br>
>>>>>>>> +  else if (NewCU->getUniqueID() == 0)<br>
>>>>>>>> +    NewCU->addUInt(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4, 0);<br></div></div></blockquote><div><br></div><div>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).<br>
<br>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.<br><br>- David</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">
>>>>>>>> else<br>
>>>>>>>>  NewCU->addDelta(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4,<br>
>>>>>>>>                  LineTableStartSym, Asm->GetTempSymbol("section_line"));<br>
>>>>>>>><br>
>>>>>>>> Modified: llvm/trunk/test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll<br>
>>>>>>>> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll?rev=174479&r1=174478&r2=174479&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll?rev=174479&r1=174478&r2=174479&view=diff</a><br>

>>>>>>>> ==============================================================================<br>
>>>>>>>> --- llvm/trunk/test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll (original)<br>
>>>>>>>> +++ llvm/trunk/test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll Tue Feb  5 18:59:41 2013<br>
>>>>>>>> @@ -17,7 +17,7 @@ target triple = "thumbv7-apple-darwin10"<br>
>>>>>>>> ; DW_OP_constu<br>
>>>>>>>> ; offset<br>
>>>>>>>><br>
>>>>>>>> -;CHECK: .long Lset7<br>
>>>>>>>> +;CHECK: .long Lset6<br>
>>>>>>>> ;CHECK-NEXT:        @ DW_AT_type<br>
>>>>>>>> ;CHECK-NEXT:        @ DW_AT_decl_file<br>
>>>>>>>> ;CHECK-NEXT:        @ DW_AT_decl_line<br>
>>>>>>>><br>
>>>>>>>> Modified: llvm/trunk/test/CodeGen/ARM/2011-08-02-MergedGlobalDbg.ll<br>
>>>>>>>> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2011-08-02-MergedGlobalDbg.ll?rev=174479&r1=174478&r2=174479&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2011-08-02-MergedGlobalDbg.ll?rev=174479&r1=174478&r2=174479&view=diff</a><br>

>>>>>>>> ==============================================================================<br>
>>>>>>>> --- llvm/trunk/test/CodeGen/ARM/2011-08-02-MergedGlobalDbg.ll (original)<br>
>>>>>>>> +++ llvm/trunk/test/CodeGen/ARM/2011-08-02-MergedGlobalDbg.ll Tue Feb  5 18:59:41 2013<br>
>>>>>>>> @@ -8,7 +8,7 @@<br>
>>>>>>>> ; DW_OP_constu<br>
>>>>>>>> ; offset<br>
>>>>>>>><br>
>>>>>>>> -;CHECK: .long Lset34<br>
>>>>>>>> +;CHECK: .long Lset33<br>
>>>>>>>> ;CHECK-NEXT:        @ DW_AT_type<br>
>>>>>>>> ;CHECK-NEXT:        @ DW_AT_decl_file<br>
>>>>>>>> ;CHECK-NEXT:        @ DW_AT_decl_line<br>
>>>>>>>><br>
>>>>>>>> Modified: llvm/trunk/test/CodeGen/X86/2011-01-24-DbgValue-Before-Use.ll<br>
>>>>>>>> URL: <a href="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" target="_blank">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</a><br>

>>>>>>>> ==============================================================================<br>
>>>>>>>> --- llvm/trunk/test/CodeGen/X86/2011-01-24-DbgValue-Before-Use.ll (original)<br>
>>>>>>>> +++ llvm/trunk/test/CodeGen/X86/2011-01-24-DbgValue-Before-Use.ll Tue Feb  5 18:59:41 2013<br>
>>>>>>>> @@ -4,7 +4,7 @@ target datalayout = "e-p:64:64:64-i1:8:8<br>
>>>>>>>> target triple = "x86_64-apple-darwin10.0.0"<br>
>>>>>>>><br>
>>>>>>>> ; Check debug info for variable z_s<br>
>>>>>>>> -;CHECK: .long Lset14<br>
>>>>>>>> +;CHECK: .long Lset13<br>
>>>>>>>> ;CHECK-NEXT:  ## DW_AT_decl_file<br>
>>>>>>>> ;CHECK-NEXT:  ## DW_AT_decl_line<br>
>>>>>>>> ;CHECK-NEXT:  ## DW_AT_type<br>
>>>>>>>><br>
>>>>>>>> Modified: llvm/trunk/test/CodeGen/X86/dbg-value-location.ll<br>
>>>>>>>> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/dbg-value-location.ll?rev=174479&r1=174478&r2=174479&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/dbg-value-location.ll?rev=174479&r1=174478&r2=174479&view=diff</a><br>

>>>>>>>> ==============================================================================<br>
>>>>>>>> --- llvm/trunk/test/CodeGen/X86/dbg-value-location.ll (original)<br>
>>>>>>>> +++ llvm/trunk/test/CodeGen/X86/dbg-value-location.ll Tue Feb  5 18:59:41 2013<br>
>>>>>>>> @@ -4,7 +4,7 @@ target datalayout = "e-p:64:64:64-i1:8:8<br>
>>>>>>>> target triple = "x86_64-apple-darwin10.0.0"<br>
>>>>>>>> ;Radar 8950491<br>
>>>>>>>><br>
>>>>>>>> -;CHECK: .long Lset6<br>
>>>>>>>> +;CHECK: .long Lset5<br>
>>>>>>>> ;CHECK-NEXT:        ## DW_AT_decl_file<br>
>>>>>>>> ;CHECK-NEXT:        ## DW_AT_decl_line<br>
>>>>>>>> ;CHECK-NEXT:        ## DW_AT_type<br>
>>>>>>>><br>
>>>>>>>> Modified: llvm/trunk/test/DebugInfo/X86/stringpool.ll<br>
>>>>>>>> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/stringpool.ll?rev=174479&r1=174478&r2=174479&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/stringpool.ll?rev=174479&r1=174478&r2=174479&view=diff</a><br>

>>>>>>>> ==============================================================================<br>
>>>>>>>> --- llvm/trunk/test/DebugInfo/X86/stringpool.ll (original)<br>
>>>>>>>> +++ llvm/trunk/test/DebugInfo/X86/stringpool.ll Tue Feb  5 18:59:41 2013<br>
>>>>>>>> @@ -23,8 +23,8 @@<br>
>>>>>>>> ; LINUX-NEXT: .quad   yyyy<br>
>>>>>>>><br>
>>>>>>>> ; Verify that we refer to 'yyyy' without a relocation.<br>
>>>>>>>> -; DARWIN: Lset6 = Linfo_string3-Linfo_string          ## DW_AT_name<br>
>>>>>>>> -; DARWIN-NEXT:        .long   Lset6<br>
>>>>>>>> +; DARWIN: Lset5 = Linfo_string3-Linfo_string          ## DW_AT_name<br>
>>>>>>>> +; DARWIN-NEXT:        .long   Lset5<br>
>>>>>>>> ; DARWIN-NEXT:        .long   39                      ## DW_AT_type<br>
>>>>>>>> ; DARWIN-NEXT:        .byte   1                       ## DW_AT_external<br>
>>>>>>>> ; DARWIN-NEXT:        .byte   1                       ## DW_AT_decl_file<br>
>>>>>>>><br>
>>>>>>>><br>
>>>>>>>> _______________________________________________<br>
>>>>>>>> llvm-commits mailing list<br>
>>>>>>>> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
>>>>>>>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
>>>>>><br>
>>>><br>
>><br>
<br>
</div></div></blockquote></div><br></div></div>