1# RUN: rm -rf %t 2# RUN: mkdir %t 3# RUN: llvm-mc -filetype=obj -triple=x86_64 -dwarf-version=4 %s -o %t/test.o -split-dwarf-file %t/test.dwo 4# RUN: cd %t 5# RUN: llvm-symbolizer --verbose 0x0 --obj=test.o | FileCheck --check-prefix=SYM %s 6# RUN: llvm-dwarfdump -lookup=0x1 test.o | FileCheck --check-prefix=LOOKUP %s 7 8# SYM: Filename: .{{[/\\]}}.{{[/\\]}}./test.h 9# SYM: Function start filename: .{{[/\\]}}.{{[/\\]}}test.cpp 10 11# LOOKUP: Line info: line 0, column 0, start file 'test.cpp', start line 1 12 13 14 .text 15 .file "test.cpp" 16 .globl _Z2f1v # -- Begin function _Z2f1v 17 .p2align 4, 0x90 18 .type _Z2f1v,@function 19_Z2f1v: # @_Z2f1v 20.Lfunc_begin0: 21 .file 1 "." "test.cpp" 22 .loc 1 1 0 # test.cpp:1:0 23 .cfi_startproc 24# %bb.0: # %entry 25 .file 2 "." "./test.h" 26 .loc 2 1 1 prologue_end # ./test.h:1:1 27 xorl %eax, %eax 28 retq 29.Ltmp0: 30.Lfunc_end0: 31 .size _Z2f1v, .Lfunc_end0-_Z2f1v 32 .cfi_endproc 33 # -- End function 34 .section .debug_abbrev,"",@progbits 35 .byte 1 # Abbreviation Code 36 .byte 17 # DW_TAG_compile_unit 37 .byte 0 # DW_CHILDREN_no 38 .byte 16 # DW_AT_stmt_list 39 .byte 23 # DW_FORM_sec_offset 40 .byte 27 # DW_AT_comp_dir 41 .byte 14 # DW_FORM_strp 42 .ascii "\264B" # DW_AT_GNU_pubnames 43 .byte 25 # DW_FORM_flag_present 44 .ascii "\260B" # DW_AT_GNU_dwo_name 45 .byte 14 # DW_FORM_strp 46 .ascii "\261B" # DW_AT_GNU_dwo_id 47 .byte 7 # DW_FORM_data8 48 .byte 17 # DW_AT_low_pc 49 .byte 1 # DW_FORM_addr 50 .byte 18 # DW_AT_high_pc 51 .byte 6 # DW_FORM_data4 52 .ascii "\263B" # DW_AT_GNU_addr_base 53 .byte 23 # DW_FORM_sec_offset 54 .byte 0 # EOM(1) 55 .byte 0 # EOM(2) 56 .byte 0 # EOM(3) 57 .section .debug_info,"",@progbits 58.Lcu_begin0: 59 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit 60.Ldebug_info_start0: 61 .short 4 # DWARF version number 62 .long .debug_abbrev # Offset Into Abbrev. Section 63 .byte 8 # Address Size (in bytes) 64 .byte 1 # Abbrev [1] 0xb:0x25 DW_TAG_compile_unit 65 .long .Lline_table_start0 # DW_AT_stmt_list 66 .long .Lskel_string0 # DW_AT_comp_dir 67 # DW_AT_GNU_pubnames 68 .long .Lskel_string1 # DW_AT_GNU_dwo_name 69 .quad 7198491773836599109 # DW_AT_GNU_dwo_id 70 .quad .Lfunc_begin0 # DW_AT_low_pc 71 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc 72 .long .Laddr_table_base0 # DW_AT_GNU_addr_base 73.Ldebug_info_end0: 74 .section .debug_str,"MS",@progbits,1 75.Lskel_string0: 76 .asciz "." # string offset=0 77.Lskel_string1: 78 .asciz "test.dwo" # string offset=2 79 .section .debug_str.dwo,"eMS",@progbits,1 80.Linfo_string0: 81 .asciz "_Z2f1v" # string offset=0 82.Linfo_string1: 83 .asciz "f1" # string offset=7 84.Linfo_string2: 85 .asciz "int" # string offset=10 86.Linfo_string3: 87 .asciz "clang version 13.0.0 (git@github.com:llvm/llvm-project.git 882ee7fbd6fc989fba53f3d9672440771feb80f5)" # string offset=14 88.Linfo_string4: 89 .asciz "test.cpp" # string offset=115 90.Linfo_string5: 91 .asciz "test.dwo" # string offset=124 92 .section .debug_str_offsets.dwo,"e",@progbits 93 .long 0 94 .long 7 95 .long 10 96 .long 14 97 .long 115 98 .long 124 99 .section .debug_info.dwo,"e",@progbits 100 .long .Ldebug_info_dwo_end0-.Ldebug_info_dwo_start0 # Length of Unit 101.Ldebug_info_dwo_start0: 102 .short 4 # DWARF version number 103 .long 0 # Offset Into Abbrev. Section 104 .byte 8 # Address Size (in bytes) 105 .byte 1 # Abbrev [1] 0xb:0x23 DW_TAG_compile_unit 106 .byte 3 # DW_AT_producer 107 .short 33 # DW_AT_language 108 .byte 4 # DW_AT_name 109 .byte 5 # DW_AT_GNU_dwo_name 110 .quad 7198491773836599109 # DW_AT_GNU_dwo_id 111 .byte 2 # Abbrev [2] 0x19:0x10 DW_TAG_subprogram 112 .byte 0 # DW_AT_low_pc 113 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc 114 .byte 1 # DW_AT_frame_base 115 .byte 87 116 # DW_AT_GNU_all_call_sites 117 .byte 0 # DW_AT_linkage_name 118 .byte 1 # DW_AT_name 119 .byte 1 # DW_AT_decl_file 120 .byte 1 # DW_AT_decl_line 121 .long 41 # DW_AT_type 122 # DW_AT_external 123 .byte 3 # Abbrev [3] 0x29:0x4 DW_TAG_base_type 124 .byte 2 # DW_AT_name 125 .byte 5 # DW_AT_encoding 126 .byte 4 # DW_AT_byte_size 127 .byte 0 # End Of Children Mark 128.Ldebug_info_dwo_end0: 129 .section .debug_abbrev.dwo,"e",@progbits 130 .byte 1 # Abbreviation Code 131 .byte 17 # DW_TAG_compile_unit 132 .byte 1 # DW_CHILDREN_yes 133 .byte 37 # DW_AT_producer 134 .ascii "\202>" # DW_FORM_GNU_str_index 135 .byte 19 # DW_AT_language 136 .byte 5 # DW_FORM_data2 137 .byte 3 # DW_AT_name 138 .ascii "\202>" # DW_FORM_GNU_str_index 139 .ascii "\260B" # DW_AT_GNU_dwo_name 140 .ascii "\202>" # DW_FORM_GNU_str_index 141 .ascii "\261B" # DW_AT_GNU_dwo_id 142 .byte 7 # DW_FORM_data8 143 .byte 0 # EOM(1) 144 .byte 0 # EOM(2) 145 .byte 2 # Abbreviation Code 146 .byte 46 # DW_TAG_subprogram 147 .byte 0 # DW_CHILDREN_no 148 .byte 17 # DW_AT_low_pc 149 .ascii "\201>" # DW_FORM_GNU_addr_index 150 .byte 18 # DW_AT_high_pc 151 .byte 6 # DW_FORM_data4 152 .byte 64 # DW_AT_frame_base 153 .byte 24 # DW_FORM_exprloc 154 .ascii "\227B" # DW_AT_GNU_all_call_sites 155 .byte 25 # DW_FORM_flag_present 156 .byte 110 # DW_AT_linkage_name 157 .ascii "\202>" # DW_FORM_GNU_str_index 158 .byte 3 # DW_AT_name 159 .ascii "\202>" # DW_FORM_GNU_str_index 160 .byte 58 # DW_AT_decl_file 161 .byte 11 # DW_FORM_data1 162 .byte 59 # DW_AT_decl_line 163 .byte 11 # DW_FORM_data1 164 .byte 73 # DW_AT_type 165 .byte 19 # DW_FORM_ref4 166 .byte 63 # DW_AT_external 167 .byte 25 # DW_FORM_flag_present 168 .byte 0 # EOM(1) 169 .byte 0 # EOM(2) 170 .byte 3 # Abbreviation Code 171 .byte 36 # DW_TAG_base_type 172 .byte 0 # DW_CHILDREN_no 173 .byte 3 # DW_AT_name 174 .ascii "\202>" # DW_FORM_GNU_str_index 175 .byte 62 # DW_AT_encoding 176 .byte 11 # DW_FORM_data1 177 .byte 11 # DW_AT_byte_size 178 .byte 11 # DW_FORM_data1 179 .byte 0 # EOM(1) 180 .byte 0 # EOM(2) 181 .byte 0 # EOM(3) 182 .section .debug_addr,"",@progbits 183.Laddr_table_base0: 184 .quad .Lfunc_begin0 185 .section .debug_gnu_pubnames,"",@progbits 186 .long .LpubNames_end0-.LpubNames_start0 # Length of Public Names Info 187.LpubNames_start0: 188 .short 2 # DWARF Version 189 .long .Lcu_begin0 # Offset of Compilation Unit Info 190 .long 48 # Compilation Unit Length 191 .long 25 # DIE offset 192 .byte 48 # Attributes: FUNCTION, EXTERNAL 193 .asciz "f1" # External Name 194 .long 0 # End Mark 195.LpubNames_end0: 196 .section .debug_gnu_pubtypes,"",@progbits 197 .long .LpubTypes_end0-.LpubTypes_start0 # Length of Public Types Info 198.LpubTypes_start0: 199 .short 2 # DWARF Version 200 .long .Lcu_begin0 # Offset of Compilation Unit Info 201 .long 48 # Compilation Unit Length 202 .long 41 # DIE offset 203 .byte 144 # Attributes: TYPE, STATIC 204 .asciz "int" # External Name 205 .long 0 # End Mark 206.LpubTypes_end0: 207 .ident "clang version 13.0.0 (git@github.com:llvm/llvm-project.git 882ee7fbd6fc989fba53f3d9672440771feb80f5)" 208 .section ".note.GNU-stack","",@progbits 209 .addrsig 210 .section .debug_line,"",@progbits 211.Lline_table_start0: 212