406 lines · plain
1## This test checks updating debuginfo via dwarf4 dwp file2# RUN: rm -rf %t && mkdir -p %t && cd %t3# RUN: split-file %s %t4# RUN: %clangxx %cxxflags -g -gdwarf-4 -gsplit-dwarf %t/main.s %t/callee.s -o main.exe5# RUN: llvm-dwp -e %t/main.exe -o %t/main.exe.dwp6# RUN: llvm-bolt %t/main.exe -o %t/main.exe.bolt -update-debug-sections 2>&1 | FileCheck %s7 8# CHECK-NOT: Assertion9 10#--- main.s11 .file "main.cpp"12 .globl main # -- Begin function main13 .type main,@function14main: # @main15.Lfunc_begin0:16 .file 1 "." "main.cpp"17 .loc 1 2 0 # main.cpp:2:018 .loc 1 2 21 prologue_end # main.cpp:2:2119 .loc 1 2 14 epilogue_begin is_stmt 0 # main.cpp:2:1420 retq21.Lfunc_end0:22 .size main, .Lfunc_end0-main23 .section .debug_abbrev,"",@progbits24 .byte 1 # Abbreviation Code25 .byte 17 # DW_TAG_compile_unit26 .byte 0 # DW_CHILDREN_no27 .byte 16 # DW_AT_stmt_list28 .byte 23 # DW_FORM_sec_offset29 .byte 27 # DW_AT_comp_dir30 .byte 14 # DW_FORM_strp31 .ascii "\264B" # DW_AT_GNU_pubnames32 .byte 25 # DW_FORM_flag_present33 .ascii "\260B" # DW_AT_GNU_dwo_name34 .byte 14 # DW_FORM_strp35 .ascii "\261B" # DW_AT_GNU_dwo_id36 .byte 7 # DW_FORM_data837 .byte 17 # DW_AT_low_pc38 .byte 1 # DW_FORM_addr39 .byte 18 # DW_AT_high_pc40 .byte 6 # DW_FORM_data441 .ascii "\263B" # DW_AT_GNU_addr_base42 .byte 23 # DW_FORM_sec_offset43 .byte 0 # EOM(1)44 .byte 0 # EOM(2)45 .byte 0 # EOM(3)46 .section .debug_info,"",@progbits47.Lcu_begin0:48 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit49.Ldebug_info_start0:50 .short 4 # DWARF version number51 .long .debug_abbrev # Offset Into Abbrev. Section52 .byte 8 # Address Size (in bytes)53 .byte 1 # Abbrev [1] 0xb:0x25 DW_TAG_compile_unit54 .long .Lline_table_start0 # DW_AT_stmt_list55 .long .Lskel_string0 # DW_AT_comp_dir56 # DW_AT_GNU_pubnames57 .long .Lskel_string1 # DW_AT_GNU_dwo_name58 .quad 1465063543908291764 # DW_AT_GNU_dwo_id59 .quad .Lfunc_begin0 # DW_AT_low_pc60 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc61 .long .Laddr_table_base0 # DW_AT_GNU_addr_base62.Ldebug_info_end0:63 .section .debug_str,"MS",@progbits,164.Lskel_string0:65 .asciz "." # string offset=066.Lskel_string1:67 .asciz "main.exe-main.dwo" # string offset=268 .section .debug_str.dwo,"eMS",@progbits,169.Linfo_string0:70 .asciz "main" # string offset=071.Linfo_string1:72 .asciz "int" # string offset=573.Linfo_string2:74 .byte 0 # string offset=975.Linfo_string3:76 .asciz "main.cpp" # string offset=1077.Linfo_string4:78 .asciz "main.exe-main.dwo" # string offset=1979 .section .debug_str_offsets.dwo,"e",@progbits80 .long 081 .long 582 .long 983 .long 1084 .long 1985 .section .debug_info.dwo,"e",@progbits86 .long .Ldebug_info_dwo_end0-.Ldebug_info_dwo_start0 # Length of Unit87.Ldebug_info_dwo_start0:88 .short 4 # DWARF version number89 .long 0 # Offset Into Abbrev. Section90 .byte 8 # Address Size (in bytes)91 .byte 1 # Abbrev [1] 0xb:0x22 DW_TAG_compile_unit92 .byte 2 # DW_AT_producer93 .short 33 # DW_AT_language94 .byte 3 # DW_AT_name95 .byte 4 # DW_AT_GNU_dwo_name96 .quad 1465063543908291764 # DW_AT_GNU_dwo_id97 .byte 2 # Abbrev [2] 0x19:0xf DW_TAG_subprogram98 .byte 0 # DW_AT_low_pc99 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc100 .byte 1 # DW_AT_frame_base101 .byte 86102 .byte 0 # DW_AT_name103 .byte 1 # DW_AT_decl_file104 .byte 2 # DW_AT_decl_line105 .long 40 # DW_AT_type106 # DW_AT_external107 .byte 3 # Abbrev [3] 0x28:0x4 DW_TAG_base_type108 .byte 1 # DW_AT_name109 .byte 5 # DW_AT_encoding110 .byte 4 # DW_AT_byte_size111 .byte 0 # End Of Children Mark112.Ldebug_info_dwo_end0:113 .section .debug_abbrev.dwo,"e",@progbits114 .byte 1 # Abbreviation Code115 .byte 17 # DW_TAG_compile_unit116 .byte 1 # DW_CHILDREN_yes117 .byte 37 # DW_AT_producer118 .ascii "\202>" # DW_FORM_GNU_str_index119 .byte 19 # DW_AT_language120 .byte 5 # DW_FORM_data2121 .byte 3 # DW_AT_name122 .ascii "\202>" # DW_FORM_GNU_str_index123 .ascii "\260B" # DW_AT_GNU_dwo_name124 .ascii "\202>" # DW_FORM_GNU_str_index125 .ascii "\261B" # DW_AT_GNU_dwo_id126 .byte 7 # DW_FORM_data8127 .byte 0 # EOM(1)128 .byte 0 # EOM(2)129 .byte 2 # Abbreviation Code130 .byte 46 # DW_TAG_subprogram131 .byte 0 # DW_CHILDREN_no132 .byte 17 # DW_AT_low_pc133 .ascii "\201>" # DW_FORM_GNU_addr_index134 .byte 18 # DW_AT_high_pc135 .byte 6 # DW_FORM_data4136 .byte 64 # DW_AT_frame_base137 .byte 24 # DW_FORM_exprloc138 .byte 3 # DW_AT_name139 .ascii "\202>" # DW_FORM_GNU_str_index140 .byte 58 # DW_AT_decl_file141 .byte 11 # DW_FORM_data1142 .byte 59 # DW_AT_decl_line143 .byte 11 # DW_FORM_data1144 .byte 73 # DW_AT_type145 .byte 19 # DW_FORM_ref4146 .byte 63 # DW_AT_external147 .byte 25 # DW_FORM_flag_present148 .byte 0 # EOM(1)149 .byte 0 # EOM(2)150 .byte 3 # Abbreviation Code151 .byte 36 # DW_TAG_base_type152 .byte 0 # DW_CHILDREN_no153 .byte 3 # DW_AT_name154 .ascii "\202>" # DW_FORM_GNU_str_index155 .byte 62 # DW_AT_encoding156 .byte 11 # DW_FORM_data1157 .byte 11 # DW_AT_byte_size158 .byte 11 # DW_FORM_data1159 .byte 0 # EOM(1)160 .byte 0 # EOM(2)161 .byte 0 # EOM(3)162 .section .debug_addr,"",@progbits163.Laddr_table_base0:164 .quad .Lfunc_begin0165 .section .debug_gnu_pubnames,"",@progbits166 .long .LpubNames_end0-.LpubNames_start0 # Length of Public Names Info167.LpubNames_start0:168 .short 2 # DWARF Version169 .long .Lcu_begin0 # Offset of Compilation Unit Info170 .long 48 # Compilation Unit Length171 .long 25 # DIE offset172 .byte 48 # Attributes: FUNCTION, EXTERNAL173 .asciz "main" # External Name174 .long 0 # End Mark175.LpubNames_end0:176 .section .debug_gnu_pubtypes,"",@progbits177 .long .LpubTypes_end0-.LpubTypes_start0 # Length of Public Types Info178.LpubTypes_start0:179 .short 2 # DWARF Version180 .long .Lcu_begin0 # Offset of Compilation Unit Info181 .long 48 # Compilation Unit Length182 .long 40 # DIE offset183 .byte 144 # Attributes: TYPE, STATIC184 .asciz "int" # External Name185 .long 0 # End Mark186.LpubTypes_end0:187 .section ".note.GNU-stack","",@progbits188 .addrsig189 .addrsig_sym _Z6calleei190 .section .debug_line,"",@progbits191.Lline_table_start0:192#--- callee.s193 .file "callee.cpp"194 .globl _Z6calleei # -- Begin function _Z6calleei195 .type _Z6calleei,@function196_Z6calleei: # @_Z6calleei197.Lfunc_begin0:198 .file 1 "." "callee.cpp"199 .loc 1 1 0 # callee.cpp:1:0200 .loc 1 1 28 prologue_end # callee.cpp:1:28201 .loc 1 1 21 epilogue_begin is_stmt 0 # callee.cpp:1:21202 retq203.Lfunc_end0:204 .size _Z6calleei, .Lfunc_end0-_Z6calleei205 .section .debug_abbrev,"",@progbits206 .byte 1 # Abbreviation Code207 .byte 17 # DW_TAG_compile_unit208 .byte 0 # DW_CHILDREN_no209 .byte 16 # DW_AT_stmt_list210 .byte 23 # DW_FORM_sec_offset211 .byte 27 # DW_AT_comp_dir212 .byte 14 # DW_FORM_strp213 .ascii "\264B" # DW_AT_GNU_pubnames214 .byte 25 # DW_FORM_flag_present215 .ascii "\260B" # DW_AT_GNU_dwo_name216 .byte 14 # DW_FORM_strp217 .ascii "\261B" # DW_AT_GNU_dwo_id218 .byte 7 # DW_FORM_data8219 .byte 17 # DW_AT_low_pc220 .byte 1 # DW_FORM_addr221 .byte 18 # DW_AT_high_pc222 .byte 6 # DW_FORM_data4223 .ascii "\263B" # DW_AT_GNU_addr_base224 .byte 23 # DW_FORM_sec_offset225 .byte 0 # EOM(1)226 .byte 0 # EOM(2)227 .byte 0 # EOM(3)228 .section .debug_info,"",@progbits229.Lcu_begin0:230 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit231.Ldebug_info_start0:232 .short 4 # DWARF version number233 .long .debug_abbrev # Offset Into Abbrev. Section234 .byte 8 # Address Size (in bytes)235 .byte 1 # Abbrev [1] 0xb:0x25 DW_TAG_compile_unit236 .long .Lline_table_start0 # DW_AT_stmt_list237 .long .Lskel_string0 # DW_AT_comp_dir238 # DW_AT_GNU_pubnames239 .long .Lskel_string1 # DW_AT_GNU_dwo_name240 .quad -8413212350243343807 # DW_AT_GNU_dwo_id241 .quad .Lfunc_begin0 # DW_AT_low_pc242 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc243 .long .Laddr_table_base0 # DW_AT_GNU_addr_base244.Ldebug_info_end0:245 .section .debug_str,"MS",@progbits,1246.Lskel_string0:247 .asciz "." # string offset=0248.Lskel_string1:249 .asciz "main.exe-callee.dwo" # string offset=2250 .section .debug_str.dwo,"eMS",@progbits,1251.Linfo_string0:252 .asciz "_Z6calleei" # string offset=0253.Linfo_string1:254 .asciz "callee" # string offset=11255.Linfo_string2:256 .asciz "int" # string offset=18257.Linfo_string3:258 .asciz "x" # string offset=22259.Linfo_string4:260 .byte 0 # string offset=24261.Linfo_string5:262 .asciz "callee.cpp" # string offset=25263.Linfo_string6:264 .asciz "main.exe-callee.dwo" # string offset=36265 .section .debug_str_offsets.dwo,"e",@progbits266 .long 0267 .long 11268 .long 18269 .long 22270 .long 24271 .long 25272 .long 36273 .section .debug_info.dwo,"e",@progbits274 .long .Ldebug_info_dwo_end0-.Ldebug_info_dwo_start0 # Length of Unit275.Ldebug_info_dwo_start0:276 .short 4 # DWARF version number277 .long 0 # Offset Into Abbrev. Section278 .byte 8 # Address Size (in bytes)279 .byte 1 # Abbrev [1] 0xb:0x2f DW_TAG_compile_unit280 .byte 4 # DW_AT_producer281 .short 33 # DW_AT_language282 .byte 5 # DW_AT_name283 .byte 6 # DW_AT_GNU_dwo_name284 .quad -8413212350243343807 # DW_AT_GNU_dwo_id285 .byte 2 # Abbrev [2] 0x19:0x1c DW_TAG_subprogram286 .byte 0 # DW_AT_low_pc287 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc288 .byte 1 # DW_AT_frame_base289 .byte 86290 .byte 0 # DW_AT_linkage_name291 .byte 1 # DW_AT_name292 .byte 1 # DW_AT_decl_file293 .byte 1 # DW_AT_decl_line294 .long 53 # DW_AT_type295 # DW_AT_external296 .byte 3 # Abbrev [3] 0x29:0xb DW_TAG_formal_parameter297 .byte 2 # DW_AT_location298 .byte 145299 .byte 124300 .byte 3 # DW_AT_name301 .byte 1 # DW_AT_decl_file302 .byte 1 # DW_AT_decl_line303 .long 53 # DW_AT_type304 .byte 0 # End Of Children Mark305 .byte 4 # Abbrev [4] 0x35:0x4 DW_TAG_base_type306 .byte 2 # DW_AT_name307 .byte 5 # DW_AT_encoding308 .byte 4 # DW_AT_byte_size309 .byte 0 # End Of Children Mark310.Ldebug_info_dwo_end0:311 .section .debug_abbrev.dwo,"e",@progbits312 .byte 1 # Abbreviation Code313 .byte 17 # DW_TAG_compile_unit314 .byte 1 # DW_CHILDREN_yes315 .byte 37 # DW_AT_producer316 .ascii "\202>" # DW_FORM_GNU_str_index317 .byte 19 # DW_AT_language318 .byte 5 # DW_FORM_data2319 .byte 3 # DW_AT_name320 .ascii "\202>" # DW_FORM_GNU_str_index321 .ascii "\260B" # DW_AT_GNU_dwo_name322 .ascii "\202>" # DW_FORM_GNU_str_index323 .ascii "\261B" # DW_AT_GNU_dwo_id324 .byte 7 # DW_FORM_data8325 .byte 0 # EOM(1)326 .byte 0 # EOM(2)327 .byte 2 # Abbreviation Code328 .byte 46 # DW_TAG_subprogram329 .byte 1 # DW_CHILDREN_yes330 .byte 17 # DW_AT_low_pc331 .ascii "\201>" # DW_FORM_GNU_addr_index332 .byte 18 # DW_AT_high_pc333 .byte 6 # DW_FORM_data4334 .byte 64 # DW_AT_frame_base335 .byte 24 # DW_FORM_exprloc336 .byte 110 # DW_AT_linkage_name337 .ascii "\202>" # DW_FORM_GNU_str_index338 .byte 3 # DW_AT_name339 .ascii "\202>" # DW_FORM_GNU_str_index340 .byte 58 # DW_AT_decl_file341 .byte 11 # DW_FORM_data1342 .byte 59 # DW_AT_decl_line343 .byte 11 # DW_FORM_data1344 .byte 73 # DW_AT_type345 .byte 19 # DW_FORM_ref4346 .byte 63 # DW_AT_external347 .byte 25 # DW_FORM_flag_present348 .byte 0 # EOM(1)349 .byte 0 # EOM(2)350 .byte 3 # Abbreviation Code351 .byte 5 # DW_TAG_formal_parameter352 .byte 0 # DW_CHILDREN_no353 .byte 2 # DW_AT_location354 .byte 24 # DW_FORM_exprloc355 .byte 3 # DW_AT_name356 .ascii "\202>" # DW_FORM_GNU_str_index357 .byte 58 # DW_AT_decl_file358 .byte 11 # DW_FORM_data1359 .byte 59 # DW_AT_decl_line360 .byte 11 # DW_FORM_data1361 .byte 73 # DW_AT_type362 .byte 19 # DW_FORM_ref4363 .byte 0 # EOM(1)364 .byte 0 # EOM(2)365 .byte 4 # Abbreviation Code366 .byte 36 # DW_TAG_base_type367 .byte 0 # DW_CHILDREN_no368 .byte 3 # DW_AT_name369 .ascii "\202>" # DW_FORM_GNU_str_index370 .byte 62 # DW_AT_encoding371 .byte 11 # DW_FORM_data1372 .byte 11 # DW_AT_byte_size373 .byte 11 # DW_FORM_data1374 .byte 0 # EOM(1)375 .byte 0 # EOM(2)376 .byte 0 # EOM(3)377 .section .debug_addr,"",@progbits378.Laddr_table_base0:379 .quad .Lfunc_begin0380 .section .debug_gnu_pubnames,"",@progbits381 .long .LpubNames_end0-.LpubNames_start0 # Length of Public Names Info382.LpubNames_start0:383 .short 2 # DWARF Version384 .long .Lcu_begin0 # Offset of Compilation Unit Info385 .long 48 # Compilation Unit Length386 .long 25 # DIE offset387 .byte 48 # Attributes: FUNCTION, EXTERNAL388 .asciz "callee" # External Name389 .long 0 # End Mark390.LpubNames_end0:391 .section .debug_gnu_pubtypes,"",@progbits392 .long .LpubTypes_end0-.LpubTypes_start0 # Length of Public Types Info393.LpubTypes_start0:394 .short 2 # DWARF Version395 .long .Lcu_begin0 # Offset of Compilation Unit Info396 .long 48 # Compilation Unit Length397 .long 53 # DIE offset398 .byte 144 # Attributes: TYPE, STATIC399 .asciz "int" # External Name400 .long 0 # End Mark401.LpubTypes_end0:402 .section ".note.GNU-stack","",@progbits403 .addrsig404 .section .debug_line,"",@progbits405.Lline_table_start0:406