107 lines · plain
1# Create .debug_line containing absolute path in filename. Show that the path is sensibly printed/found/etc.2# REQUIRES: x86-registered-target3 4# RUN: sed s!FILEPATH!%/s! %s > %t.s5# RUN: llvm-mc --filetype=obj --triple=x86_64-pc-linux %t.s -o %t.o6# RUN: llvm-symbolizer --obj=%t.o 0 | FileCheck %s -DPATH=%/s7 8# CHECK: {{^}}[[PATH]]:1:09 10.type _start,@function11_start:12.Lfunc_begin0:13 ret14.Lfunc_end0:15 16.section .debug_str,"MS",@progbits,117.Linfo_string1:18 .asciz "test.c"19.Linfo_string2:20 .asciz "/some/dir"21.Linfo_string3:22 .asciz "_start"23 24.section .debug_abbrev,"",@progbits25 .byte 1 # Abbreviation Code26 .byte 17 # DW_TAG_compile_unit27 .byte 1 # DW_CHILDREN_yes28 .byte 3 # DW_AT_name29 .byte 14 # DW_FORM_strp30 .byte 16 # DW_AT_stmt_list31 .byte 23 # DW_FORM_sec_offset32 .byte 27 # DW_AT_comp_dir33 .byte 14 # DW_FORM_strp34 .byte 17 # DW_AT_low_pc35 .byte 1 # DW_FORM_addr36 .byte 18 # DW_AT_high_pc37 .byte 6 # DW_FORM_data438 .byte 0 # EOM(1)39 .byte 0 # EOM(2)40 .byte 2 # Abbreviation Code41 .byte 46 # DW_TAG_subprogram42 .byte 0 # DW_CHILDREN_no43 .byte 17 # DW_AT_low_pc44 .byte 1 # DW_FORM_addr45 .byte 18 # DW_AT_high_pc46 .byte 6 # DW_FORM_data447 .byte 3 # DW_AT_name48 .byte 14 # DW_FORM_strp49 .byte 58 # DW_AT_decl_file50 .byte 11 # DW_FORM_data151 .byte 59 # DW_AT_decl_line52 .byte 11 # DW_FORM_data153 .byte 63 # DW_AT_external54 .byte 25 # DW_FORM_flag_present55 .byte 0 # EOM(1)56 .byte 0 # EOM(2)57 .byte 0 # EOM(3)58 .section .debug_info,"",@progbits59 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit60.Ldebug_info_start0:61 .short 4 # DWARF version number62 .long .debug_abbrev # Offset Into Abbrev. Section63 .byte 8 # Address Size (in bytes)64 .byte 1 # Abbrev [1] 0xb:0x35 DW_TAG_compile_unit65 .long .Linfo_string1 # DW_AT_name66 .long .Lline_table_start0 # DW_AT_stmt_list67 .long .Linfo_string2 # DW_AT_comp_dir68 .quad .Lfunc_begin0 # DW_AT_low_pc69 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc70 .byte 2 # Abbrev [2] 0x2a:0x15 DW_TAG_subprogram71 .quad .Lfunc_begin0 # DW_AT_low_pc72 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc73 .long .Linfo_string3 # DW_AT_name74 .byte 1 # DW_AT_decl_file75 .byte 1 # DW_AT_decl_line76 # DW_AT_external77 .byte 0 # End Of Children Mark78.Ldebug_info_end0:79 80# Hand-written .debug_line to allow replacing in the absolute path81# into the filename table at runtime.82.section .debug_line,"",@progbits83.Lline_table_start0:84 .long .Ltable_end - .Ltable_start # unit length85.Ltable_start:86 .short 4 # version87 .long .Lheader_end - .Lheader_start # header length88.Lheader_start:89 .byte 1 # min instruction length90 .byte 1 # max ops per instruction91 .byte 1 # default is_stmt92 .byte -5 # line base93 .byte 14 # line range94 .byte 13 # opcode base95 .byte 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 # standard opcode lengths96 .byte 0 # directory table97 .asciz "FILEPATH" # filename table98 .byte 0, 0, 099 .byte 0100.Lheader_end:101 .byte 0, 9, 2 # DW_LNE_set_address102 .quad .Lfunc_begin0103 .byte 1 # DW_LNS_copy104 .byte 33 # +1 address, +1 line105 .byte 0, 1, 1 # DW_LNE_end_sequence106.Ltable_end:107