[llvm] 84e5760 - [DebugInfo]: Reorderd the emission of debug_str section.
Adrian Prantl via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 7 08:55:08 PST 2020
This seems to have broken an LLDB test.
http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/8169/
Script:
--
: 'RUN: at line 6'; /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/bin/clang /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/debuginfo-tests/llgdb-tests/apple-accel.cpp --target=x86_64-apple-darwin18.0.0 -gdwarf-2 -O0 -c -g -o /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/projects/debuginfo-tests/llgdb-tests/Output/apple-accel.cpp.tmp-ex
: 'RUN: at line 7'; llvm-objdump -section-headers /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/projects/debuginfo-tests/llgdb-tests/Output/apple-accel.cpp.tmp-ex | /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/bin/FileCheck /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/debuginfo-tests/llgdb-tests/apple-accel.cpp
: 'RUN: at line 8'; /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/bin/clang /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/debuginfo-tests/llgdb-tests/apple-accel.cpp --target=x86_64-apple-darwin18.0.0 -gdwarf-4 -O0 -c -g -o /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/projects/debuginfo-tests/llgdb-tests/Output/apple-accel.cpp.tmp-ex
: 'RUN: at line 9'; llvm-objdump -section-headers /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/projects/debuginfo-tests/llgdb-tests/Output/apple-accel.cpp.tmp-ex | /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/bin/FileCheck /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/debuginfo-tests/llgdb-tests/apple-accel.cpp
--
Exit Code: 1
Command Output (stderr):
--
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/debuginfo-tests/llgdb-tests/apple-accel.cpp:17:16: error: CHECK-NEXT: expected string not found in input
// CHECK-NEXT: __debug_abbrev
^
<stdin>:11:16: note: scanning from here
5 __debug_str 000001bd 0000000000000165 DATA
^
<stdin>:18:5: note: possible intended match here
12 __debug_line 000000bb 00000000000004f0 DATA
^
I *think* the test just needs to be updated to expect a different ordering.
-- adrian
> On Feb 6, 2020, at 9:46 PM, Sourabh Singh Tomar via llvm-commits <llvm-commits at lists.llvm.org> wrote:
>
>
> Author: Sourabh Singh Tomar
> Date: 2020-02-07T11:15:55+05:30
> New Revision: 84e5760a1637d89c6c90a218abfe6d4d0ce85c97
>
> URL: https://github.com/llvm/llvm-project/commit/84e5760a1637d89c6c90a218abfe6d4d0ce85c97
> DIFF: https://github.com/llvm/llvm-project/commit/84e5760a1637d89c6c90a218abfe6d4d0ce85c97.diff
>
> LOG: [DebugInfo]: Reorderd the emission of debug_str section.
>
> Summary:
> This patch reorders the emission of debug_str section, so that
> string can come after macros.
> This is necessary for macro forms like DW_MACRO_define_strp,
> which emits macro as a string in debug_str section.
>
> Added:
>
>
> Modified:
> llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
> llvm/test/DebugInfo/MIR/X86/dbg-stack-value-range.mir
> llvm/test/DebugInfo/X86/stringpool.ll
>
> Removed:
>
>
>
> ################################################################################
> diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
> index 447d3fa3e206..3a8252e8b320 100644
> --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
> +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
> @@ -1260,8 +1260,6 @@ void DwarfDebug::endModule() {
> // Finalize the debug info for the module.
> finalizeModuleInfo();
>
> - emitDebugStr();
> -
> if (useSplitDwarf())
> // Emit debug_loc.dwo/debug_loclists.dwo section.
> emitDebugLocDWO();
> @@ -1289,6 +1287,8 @@ void DwarfDebug::endModule() {
> // Emit info into a debug macinfo section.
> emitDebugMacinfo();
>
> + emitDebugStr();
> +
> if (useSplitDwarf()) {
> emitDebugStrDWO();
> emitDebugInfoDWO();
>
> diff --git a/llvm/test/DebugInfo/MIR/X86/dbg-stack-value-range.mir b/llvm/test/DebugInfo/MIR/X86/dbg-stack-value-range.mir
> index a1dae268e326..6664a8127866 100644
> --- a/llvm/test/DebugInfo/MIR/X86/dbg-stack-value-range.mir
> +++ b/llvm/test/DebugInfo/MIR/X86/dbg-stack-value-range.mir
> @@ -18,9 +18,6 @@
> # CHECK-NEXT: .Ltmp6:
> # CHECK: .Lfunc_end0:
> #
> -# CHECK: .Linfo_string7:
> -# CHECK-NEXT: .asciz "local1"
> -#
> # CHECK: .Ldebug_loc2:
> # CHECK-NEXT: .quad .Ltmp1-.Lfunc_begin0
> # CHECK-NEXT: .quad .Ltmp4-.Lfunc_begin0
> @@ -34,8 +31,9 @@
> #
> # CHECK: .long .Ldebug_loc2 # DW_AT_location
> # CHECK-NEXT: .long .Linfo_string7 # DW_AT_name
> -
> -
> +#
> +# CHECK: .Linfo_string7:
> +# CHECK-NEXT: .asciz "local1"
> --- |
> ; ModuleID = 'dbg-stack-value-range.ll'
> source_filename = "dbg-stack-value-range.c"
>
> diff --git a/llvm/test/DebugInfo/X86/stringpool.ll b/llvm/test/DebugInfo/X86/stringpool.ll
> index 95c514997de4..219e6728c6ce 100644
> --- a/llvm/test/DebugInfo/X86/stringpool.ll
> +++ b/llvm/test/DebugInfo/X86/stringpool.ll
> @@ -14,11 +14,6 @@ source_filename = "test/DebugInfo/X86/stringpool.ll"
> !3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
> !4 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 3.1 (trunk 143009)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !5, globals: !6, imports: !5)
> !5 = !{}
> -; Verify that "yyyy" ended up in the stringpool.
> -; LINUX: .section .debug_str,"MS", at progbits,1
> -; LINUX: yyyy
> -; DARWIN: .section __DWARF,__debug_str,regular,debug
> -; DARWIN: .asciz "yyyy" ## string offset=[[YYYY:[0-9]+]]
>
> ; Verify that we refer to 'yyyy' with a relocation.
> ; LINUX: .long .Linfo_string3 # DW_AT_name
> @@ -29,9 +24,14 @@ source_filename = "test/DebugInfo/X86/stringpool.ll"
> ; LINUX-NEXT: .byte 9 # DW_AT_location
> ; LINUX-NEXT: .byte 3
> ; LINUX-NEXT: .quad yyyy
> +; Verify that "yyyy" ended up in the stringpool.
> +; LINUX: .section .debug_str,"MS", at progbits,1
> +; LINUX: yyyy
>
> ; Verify that we refer to 'yyyy' with a direct offset.
> -; DARWIN: .long [[YYYY]]
> +; DARWIN: .section __DWARF,__debug_info,regular,debug
> +; DARWIN: DW_TAG_variable
> +; DARWIN: .long [[YYYY:[0-9]+]]
> ; DARWIN-NEXT: .long {{[0-9]+}} ## DW_AT_type
> ; DARWIN-NEXT: ## DW_AT_external
> ; DARWIN-NEXT: .byte 1 ## DW_AT_decl_file
> @@ -39,5 +39,7 @@ source_filename = "test/DebugInfo/X86/stringpool.ll"
> ; DARWIN-NEXT: .byte 9 ## DW_AT_location
> ; DARWIN-NEXT: .byte 3
> ; DARWIN-NEXT: .quad _yyyy
> +; DARWIN: .section __DWARF,__debug_str,regular,debug
> +; DARWIN: .asciz "yyyy" ## string offset=[[YYYY]]
> !6 = !{!0}
> !7 = !{i32 1, !"Debug Info Version", i32 3}
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list