192 lines · plain
1REQUIRES: x86-registered-target2RUN: split-file %s %t3RUN: mkdir -p %t/.build-id/ab4RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %t/asm.s \5RUN: -o %t/.build-id/ab/cdef.debug6RUN: llvm-symbolizer --debug-file-directory=%t --filter-markup < %t/input \7RUN: > %t.output 2> %t.err8RUN: FileCheck %s --input-file=%t.output --match-full-lines \9RUN: --implicit-check-not {{.}}10RUN: FileCheck %s --check-prefix=ERR --input-file=%t.err --match-full-lines11 12CHECK: [[BEGIN:\[{3}]]ELF module #0x0 "a.o"; BuildID=abcdef [0x0-0xff](r)[[END:\]{3}]]13CHECK: first[/dir[[SEP:[/\\]]]tmp.c:3]14CHECK: first[/dir[[SEP]]tmp.c:5]15CHECK: first[/dir[[SEP]]tmp.c:4]16CHECK: first[/dir[[SEP]]tmp.c:5]17 18CHECK: [[BEGIN]]pc:0xff[[END]]19CHECK: [[BEGIN]]pc:0x100[[END]]20CHECK: first[/dir[[SEP]]tmp.c:5]21ERR: error: no mmap covers address22ERR: warning: expected at most 2 field(s); found 323 24ERR: error: expected at least 1 field(s); found 025ERR: error: expected PC type; found ''26 27;--- input28{{{module:0:a.o:elf:abcdef}}}29{{{mmap:0:256:load:0:r:0}}}30{{{pc:0}}}31{{{pc:0x9}}}32{{{pc:0x9:ra}}}33{{{pc:0x9:pc}}}34 35{{{pc:0xff}}}36{{{pc:0x100}}}37{{{pc:0x9:pc:ext}}}38 39{{{pc}}}40{{{pc:0x9:}}}41;--- asm.s42 .text43 .file "tmp.c"44 .globl first # -- Begin function first45 .p2align 4, 0x9046 .type first,@function47first: # @first48.Lfunc_begin0:49 .file 1 "/dir" "tmp.c"50 .loc 1 3 0 # tmp.c:3:051 .cfi_startproc52# %bb.0:53 pushq %rbp54 .cfi_def_cfa_offset 1655 .cfi_offset %rbp, -1656 movq %rsp, %rbp57 .cfi_def_cfa_register %rbp58.Ltmp0:59 .loc 1 4 3 prologue_end # tmp.c:4:360 callq second61 .loc 1 5 1 # tmp.c:5:162 popq %rbp63 .cfi_def_cfa %rsp, 864 retq65.Ltmp1:66.Lfunc_end0:67 .size first, .Lfunc_end0-first68 .cfi_endproc69 # -- End function70 .globl second # -- Begin function second71 .p2align 4, 0x9072 .type second,@function73second: # @second74.Lfunc_begin1:75 .loc 1 7 0 # tmp.c:7:076 .cfi_startproc77# %bb.0:78 pushq %rbp79 .cfi_def_cfa_offset 1680 .cfi_offset %rbp, -1681 movq %rsp, %rbp82 .cfi_def_cfa_register %rbp83.Ltmp2:84 .loc 1 8 3 prologue_end # tmp.c:8:385 callq first86 .loc 1 9 1 # tmp.c:9:187 popq %rbp88 .cfi_def_cfa %rsp, 889 retq90.Ltmp3:91.Lfunc_end1:92 .size second, .Lfunc_end1-second93 .cfi_endproc94 # -- End function95 .section .debug_abbrev,"",@progbits96 .byte 1 # Abbreviation Code97 .byte 17 # DW_TAG_compile_unit98 .byte 1 # DW_CHILDREN_yes99 .byte 37 # DW_AT_producer100 .byte 14 # DW_FORM_strp101 .byte 19 # DW_AT_language102 .byte 5 # DW_FORM_data2103 .byte 3 # DW_AT_name104 .byte 14 # DW_FORM_strp105 .byte 16 # DW_AT_stmt_list106 .byte 23 # DW_FORM_sec_offset107 .byte 27 # DW_AT_comp_dir108 .byte 14 # DW_FORM_strp109 .byte 17 # DW_AT_low_pc110 .byte 1 # DW_FORM_addr111 .byte 18 # DW_AT_high_pc112 .byte 6 # DW_FORM_data4113 .byte 0 # EOM(1)114 .byte 0 # EOM(2)115 .byte 2 # Abbreviation Code116 .byte 46 # DW_TAG_subprogram117 .byte 0 # DW_CHILDREN_no118 .byte 17 # DW_AT_low_pc119 .byte 1 # DW_FORM_addr120 .byte 18 # DW_AT_high_pc121 .byte 6 # DW_FORM_data4122 .byte 64 # DW_AT_frame_base123 .byte 24 # DW_FORM_exprloc124 .byte 3 # DW_AT_name125 .byte 14 # DW_FORM_strp126 .byte 58 # DW_AT_decl_file127 .byte 11 # DW_FORM_data1128 .byte 59 # DW_AT_decl_line129 .byte 11 # DW_FORM_data1130 .byte 39 # DW_AT_prototyped131 .byte 25 # DW_FORM_flag_present132 .byte 63 # DW_AT_external133 .byte 25 # DW_FORM_flag_present134 .byte 0 # EOM(1)135 .byte 0 # EOM(2)136 .byte 0 # EOM(3)137 .section .debug_info,"",@progbits138.Lcu_begin0:139 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit140.Ldebug_info_start0:141 .short 4 # DWARF version number142 .long .debug_abbrev # Offset Into Abbrev. Section143 .byte 8 # Address Size (in bytes)144 .byte 1 # Abbrev [1] 0xb:0x4a DW_TAG_compile_unit145 .long .Linfo_string0 # DW_AT_producer146 .short 12 # DW_AT_language147 .long .Linfo_string1 # DW_AT_name148 .long .Lline_table_start0 # DW_AT_stmt_list149 .long .Linfo_string2 # DW_AT_comp_dir150 .quad .Lfunc_begin0 # DW_AT_low_pc151 .long .Lfunc_end1-.Lfunc_begin0 # DW_AT_high_pc152 .byte 2 # Abbrev [2] 0x2a:0x15 DW_TAG_subprogram153 .quad .Lfunc_begin0 # DW_AT_low_pc154 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc155 .byte 1 # DW_AT_frame_base156 .byte 86157 .long .Linfo_string3 # DW_AT_name158 .byte 1 # DW_AT_decl_file159 .byte 3 # DW_AT_decl_line160 # DW_AT_prototyped161 # DW_AT_external162 .byte 2 # Abbrev [2] 0x3f:0x15 DW_TAG_subprogram163 .quad .Lfunc_begin1 # DW_AT_low_pc164 .long .Lfunc_end1-.Lfunc_begin1 # DW_AT_high_pc165 .byte 1 # DW_AT_frame_base166 .byte 86167 .long .Linfo_string4 # DW_AT_name168 .byte 1 # DW_AT_decl_file169 .byte 7 # DW_AT_decl_line170 # DW_AT_prototyped171 # DW_AT_external172 .byte 0 # End Of Children Mark173.Ldebug_info_end0:174 .section .debug_str,"MS",@progbits,1175.Linfo_string0:176 .asciz "clang" # string offset=0177.Linfo_string1:178 .asciz "tmp.c" # string offset=30179.Linfo_string2:180 .asciz "/dir" # string offset=36181.Linfo_string3:182 .asciz "first" # string offset=85183.Linfo_string4:184 .asciz "second" # string offset=91185 .ident "clang"186 .section ".note.GNU-stack","",@progbits187 .addrsig188 .addrsig_sym first189 .addrsig_sym second190 .section .debug_line,"",@progbits191.Lline_table_start0:192