<p dir="ltr"><br>
On Aug 6, 2014 8:58 PM, "Justin Bogner" <<a href="mailto:mail@justinbogner.com">mail@justinbogner.com</a>> wrote:<br>
><br>
> Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> writes:<br>
> > Nah, just make it a Darwin like section. "__TEXT,__bar" should work.<br>
><br>
> Right, elf don't care ;) Fixed in r215052. Thanks!<br>
></p>
<p dir="ltr">Thank you!</p>
<p dir="ltr">-eric</p>
<p dir="ltr">> > On Aug 6, 2014 7:03 PM, "Justin Bogner" <<a href="mailto:mail@justinbogner.com">mail@justinbogner.com</a>> wrote:<br>
> ><br>
> > David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> writes:<br>
> > > Author: dblaikie<br>
> > > Date: Wed Aug 6 13:24:19 2014<br>
> > > New Revision: 214985<br>
> > ><br>
> > > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=214985&view=rev">http://llvm.org/viewvc/llvm-project?rev=214985&view=rev</a><br>
> > > Log:<br>
> > > DebugInfo: Fix ranges+gmlt test case to actually exercise the gmlt<br>
> > situation.<br>
> ><br>
> > This is causing a test failure on Darwin:<br>
> ><br>
> > LLVM ERROR: Global variable 'f2' has an invalid section specifier<br>
> > 'bar': mach-o section specifier requires a segment and section separated<br>
> > by a comma.<br>
> ><br>
> > I guess this test needs a triple so that it generates elf?<br>
> ><br>
> > > Originally this test case tested the specified behavior (that -gmlt<br>
> > > would not produce DW_AT_ranges and that when no CU DW_AT_ranges were<br>
> > > produced, no debug_ranges section (not even an empty list) would be<br>
> > > produced) but then the ranges emission code was improved not to create<br>
> > > ranges of a single element (instead favoring high_pc/low_pc) and so this<br>
> > > test case no longer exercised the -gmlt portion of the behavior.<br>
> > ><br>
> > > This caused me some confusion when reading the comments and trying to<br>
> > > update this test case for future changes to -gmlt. I've made this test<br>
> > > resilient to those changes (by using the {{DW_TAG|NULL}} pattern to<br>
> > > block the end of the attribute search at the end of the CU's attribute<br>
> > > list without mandating that it must (or must not) be followed by another<br>
> > > tag (the future changes to -gmlt should produce no subprograms in this<br>
> > > CU))<br>
> > ><br>
> > > Fix the test case to have two functions in distinct sections to force<br>
> > > the use of DW_AT_ranges.<br>
> > ><br>
> > > Modified:<br>
> > > llvm/trunk/test/DebugInfo/cu-line-tables.ll<br>
> > ><br>
> > > Modified: llvm/trunk/test/DebugInfo/cu-line-tables.ll<br>
> > > URL:<br>
> > > <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/</a><br>
> > cu-line-tables.ll?rev=214985&r1=214984&r2=214985&view=diff================<br>
> > ==============================================================<br>
> > > --- llvm/trunk/test/DebugInfo/cu-line-tables.ll (original)<br>
> > > +++ llvm/trunk/test/DebugInfo/cu-line-tables.ll Wed Aug 6 13:24:19 2014<br>
> > > @@ -1,17 +1,28 @@<br>
> > > ; REQUIRES: object-emission<br>
> > > -; RUN: %llc_dwarf -O0 -filetype=obj %s -o %t<br>
> > > -; RUN: llvm-dwarfdump %t | FileCheck %s<br>
> > > -<br>
> > > -; Check that we don't emit ranges if we're emitting line tables only.<br>
> > > +; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump - | FileCheck<br>
> > %s<br>
> > ><br>
> > > +; Generated from the following source compiled with clang -gmlt:<br>
> > > +; void f1(void) {}<br>
> > > +; void f2(void) __attribute__((section("bar"))) {}<br>
> > > +<br>
> > > +; Check that<br>
> > > +; * -gmlt ('Emission Kind' of 'LineTablesOnly' in the CU debug info<br>
> > metadata)<br>
> > > +; doesn't produce ranges.<br>
> > > +; * if no ranges are produced, no debug_ranges list (not even an empty<br>
> > one) is<br>
> > > +; emitted.<br>
> > > +<br>
> > > +; -gmlt means no DW_AT_ranges on the CU, even though there are parts of<br>
> > the CU<br>
> > > +; in different sections and this would normally necessitate a<br>
> > DW_AT_ranges<br>
> > > +; attribute on the CU.<br>
> > > ; CHECK: DW_TAG_compile_unit<br>
> > > ; CHECK-NOT: DW_AT_ranges<br>
> > > -; CHECK: DW_TAG_subprogram<br>
> > > +; CHECK: {{DW_TAG|NULL}}<br>
> > ><br>
> > > ; FIXME: We probably want to avoid printing out anything if the section<br>
> > isn't there.<br>
> > > ; CHECK: .debug_ranges contents:<br>
> > > ; CHECK-NOT: 00000000 <End of list><br>
> > ><br>
> > > +; Check that we don't emit any pubnames or pubtypes under -gmlt<br>
> > > ; CHECK: .debug_pubnames contents:<br>
> > > ; CHECK-NOT: Offset<br>
> > ><br>
> > > @@ -19,33 +30,33 @@<br>
> > > ; CHECK-NOT: Offset<br>
> > ><br>
> > > ; Function Attrs: nounwind uwtable<br>
> > > -define i32 @f(i32 %a) #0 {<br>
> > > +define void @f1() #0 {<br>
> > > entry:<br>
> > > - %a.addr = alloca i32, align 4<br>
> > > - store i32 %a, i32* %a.addr, align 4<br>
> > > - %0 = load i32* %a.addr, align 4, !dbg !14<br>
> > > - %add = add nsw i32 %0, 4, !dbg !14<br>
> > > - ret i32 %add, !dbg !14<br>
> > > + ret void, !dbg !11<br>
> > > }<br>
> > ><br>
> > > -; Function Attrs: nounwind readnone<br>
> > > -declare void @llvm.dbg.declare(metadata, metadata) #1<br>
> > > +; Function Attrs: nounwind uwtable<br>
> > > +define void @f2() #0 section "bar" {<br>
> > > +entry:<br>
> > > + ret void, !dbg !12<br>
> > > +}<br>
> > ><br>
> > > attributes #0 = { nounwind uwtable "less-precise-fpmad"="false"<br>
> > "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"<br>
> > "no-infs-fp-math"="false" "no-nans-fp-math"="false"<br>
> > "stack-protector-buffer-size"="8" "unsafe-fp-math"="false"<br>
> > "use-soft-float"="false" }<br>
> > > -attributes #1 = { nounwind readnone }<br>
> > ><br>
> > > !<a href="http://llvm.dbg.cu">llvm.dbg.cu</a> = !{!0}<br>
> > > -!llvm.module.flags = !{!9, !10}<br>
> > > -!llvm.ident = !{!11}<br>
> > > +!llvm.module.flags = !{!8, !9}<br>
> > > +!llvm.ident = !{!10}<br>
> > ><br>
> > > -!0 = metadata !{i32 786449, metadata !1, i32 12, metadata !"clang<br>
> > version 3.5 (trunk 197756) (llvm/trunk 197768)", i1 false, metadata !"",<br>
> > i32 0, metadata !2, metadata !2, metadata !3, metadata !2, metadata !2,<br>
> > metadata !"", i32 2} ; [ DW_TAG_compile_unit ] [/usr/local/google/home/<br>
> > echristo/tmp/foo.c] [DW_LANG_C99]<br>
> > > -!1 = metadata !{metadata !"foo.c", metadata !"/usr/local/google/home/<br>
> > echristo/tmp"}<br>
> > > +!0 = metadata !{i32 786449, metadata !1, i32 12, metadata !"clang<br>
> > version 3.6.0 ", i1 false, metadata !"", i32 0, metadata !2, metadata !2,<br>
> > metadata !3, metadata !2, metadata !2, metadata !"", i32 2} ; [<br>
> > DW_TAG_compile_unit ] [/tmp/dbginfo/cu-line-tables.c] [DW_LANG_C99]<br>
> > > +!1 = metadata !{metadata !"cu-line-tables.c", metadata !"/tmp/dbginfo"}<br>
> > > !2 = metadata !{}<br>
> > > -!3 = metadata !{metadata !4}<br>
> > > -!4 = metadata !{i32 786478, metadata !1, metadata !5, metadata !"f",<br>
> > metadata !"f", metadata !"", i32 1, metadata !6, i1 false, i1 true, i32 0,<br>
> > i32 0, null, i32 256, i1 false, i32 (i32)* @f, null, null, metadata !2,<br>
> > i32 1} ; [ DW_TAG_subprogram ] [line 1] [def] [f]<br>
> > > -!5 = metadata !{i32 786473, metadata !1} ; [ DW_TAG_file_type<br>
> > ] [/usr/local/google/home/echristo/tmp/foo.c]<br>
> > > +!3 = metadata !{metadata !4, metadata !7}<br>
> > > +!4 = metadata !{i32 786478, metadata !1, metadata !5, metadata !"f1",<br>
> > metadata !"f1", metadata !"", i32 1, metadata !6, i1 false, i1 true, i32<br>
> > 0, i32 0, null, i32 256, i1 false, void ()* @f1, null, null, metadata !2,<br>
> > i32 1} ; [ DW_TAG_subprogram ] [line 1] [def] [f1]<br>
> > > +!5 = metadata !{i32 786473, metadata !1} ; [ DW_TAG_file_type<br>
> > ] [/tmp/dbginfo/cu-line-tables.c]<br>
> > > !6 = metadata !{i32 786453, i32 0, null, metadata !"", i32 0, i64 0,<br>
> > i64 0, i64 0, i32 0, null, metadata !2, i32 0, null, null, null} ; [<br>
> > DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]<br>
> > > -!9 = metadata !{i32 2, metadata !"Dwarf Version", i32 4}<br>
> > > -!10 = metadata !{i32 1, metadata !"Debug Info Version", i32 1}<br>
> > > -!11 = metadata !{metadata !"clang version 3.5 (trunk 197756) (llvm/<br>
> > trunk 197768)"}<br>
> > > -!14 = metadata !{i32 2, i32 0, metadata !4, null}<br>
> > > +!7 = metadata !{i32 786478, metadata !1, metadata !5, metadata !"f2",<br>
> > metadata !"f2", metadata !"", i32 2, metadata !6, i1 false, i1 true, i32<br>
> > 0, i32 0, null, i32 256, i1 false, void ()* @f2, null, null, metadata !2,<br>
> > i32 2} ; [ DW_TAG_subprogram ] [line 2] [def] [f2]<br>
> > > +!8 = metadata !{i32 2, metadata !"Dwarf Version", i32 4}<br>
> > > +!9 = metadata !{i32 2, metadata !"Debug Info Version", i32 1}<br>
> > > +!10 = metadata !{metadata !"clang version 3.6.0 "}<br>
> > > +!11 = metadata !{i32 1, i32 16, metadata !4, null}<br>
> > > +!12 = metadata !{i32 2, i32 48, metadata !7, null}<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">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><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">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</p>