408 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: llvm-mc -filetype=obj -triple aarch64-unknown-unknown --split-dwarf-file=main.exe-main.dwo %t/main.s -o %t/main.o5# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown --split-dwarf-file=main.exe-callee.dwo %t/callee.s -o %t/callee.o6# RUN: %clangxx %cxxflags -gdwarf-4 -gsplit-dwarf=split -Wl,-e,main %t/main.o %t/callee.o -o main.exe7# RUN: llvm-dwp -e %t/main.exe -o %t/main.exe.dwp8# RUN: llvm-bolt %t/main.exe -o %t/main.exe.bolt -update-debug-sections 2>&1 | FileCheck %s9 10# CHECK-NOT: Assertion11 12#--- main.s13 .file "main.cpp"14 .globl main // -- Begin function main15 .type main,@function16main: // @main17.Lfunc_begin0:18 .file 1 "." "main.cpp"19 .loc 1 2 0 // main.cpp:2:020 .loc 1 2 21 prologue_end // main.cpp:2:2121 .loc 1 2 14 epilogue_begin is_stmt 0 // main.cpp:2:1422 ret23.Lfunc_end0:24 .size main, .Lfunc_end0-main25 .section .debug_abbrev,"",@progbits26 .byte 1 // Abbreviation Code27 .byte 17 // DW_TAG_compile_unit28 .byte 0 // DW_CHILDREN_no29 .byte 16 // DW_AT_stmt_list30 .byte 23 // DW_FORM_sec_offset31 .byte 27 // DW_AT_comp_dir32 .byte 14 // DW_FORM_strp33 .ascii "\264B" // DW_AT_GNU_pubnames34 .byte 25 // DW_FORM_flag_present35 .ascii "\260B" // DW_AT_GNU_dwo_name36 .byte 14 // DW_FORM_strp37 .ascii "\261B" // DW_AT_GNU_dwo_id38 .byte 7 // DW_FORM_data839 .byte 17 // DW_AT_low_pc40 .byte 1 // DW_FORM_addr41 .byte 18 // DW_AT_high_pc42 .byte 6 // DW_FORM_data443 .ascii "\263B" // DW_AT_GNU_addr_base44 .byte 23 // DW_FORM_sec_offset45 .byte 0 // EOM(1)46 .byte 0 // EOM(2)47 .byte 0 // EOM(3)48 .section .debug_info,"",@progbits49.Lcu_begin0:50 .word .Ldebug_info_end0-.Ldebug_info_start0 // Length of Unit51.Ldebug_info_start0:52 .hword 4 // DWARF version number53 .word .debug_abbrev // Offset Into Abbrev. Section54 .byte 8 // Address Size (in bytes)55 .byte 1 // Abbrev [1] 0xb:0x25 DW_TAG_compile_unit56 .word .Lline_table_start0 // DW_AT_stmt_list57 .word .Lskel_string0 // DW_AT_comp_dir58 // DW_AT_GNU_pubnames59 .word .Lskel_string1 // DW_AT_GNU_dwo_name60 .xword 1465063543908291764 // DW_AT_GNU_dwo_id61 .xword .Lfunc_begin0 // DW_AT_low_pc62 .word .Lfunc_end0-.Lfunc_begin0 // DW_AT_high_pc63 .word .Laddr_table_base0 // DW_AT_GNU_addr_base64.Ldebug_info_end0:65 .section .debug_str,"MS",@progbits,166.Lskel_string0:67 .asciz "." // string offset=068.Lskel_string1:69 .asciz "main.exe-main.dwo" // string offset=270 .section .debug_str.dwo,"eMS",@progbits,171.Linfo_string0:72 .asciz "main" // string offset=073.Linfo_string1:74 .asciz "int" // string offset=575.Linfo_string2:76 .byte 0 // string offset=977.Linfo_string3:78 .asciz "main.cpp" // string offset=1079.Linfo_string4:80 .asciz "main.exe-main.dwo" // string offset=1981 .section .debug_str_offsets.dwo,"e",@progbits82 .word 083 .word 584 .word 985 .word 1086 .word 1987 .section .debug_info.dwo,"e",@progbits88 .word .Ldebug_info_dwo_end0-.Ldebug_info_dwo_start0 // Length of Unit89.Ldebug_info_dwo_start0:90 .hword 4 // DWARF version number91 .word 0 // Offset Into Abbrev. Section92 .byte 8 // Address Size (in bytes)93 .byte 1 // Abbrev [1] 0xb:0x22 DW_TAG_compile_unit94 .byte 2 // DW_AT_producer95 .hword 33 // DW_AT_language96 .byte 3 // DW_AT_name97 .byte 4 // DW_AT_GNU_dwo_name98 .xword 1465063543908291764 // DW_AT_GNU_dwo_id99 .byte 2 // Abbrev [2] 0x19:0xf DW_TAG_subprogram100 .byte 0 // DW_AT_low_pc101 .word .Lfunc_end0-.Lfunc_begin0 // DW_AT_high_pc102 .byte 1 // DW_AT_frame_base103 .byte 109104 .byte 0 // DW_AT_name105 .byte 1 // DW_AT_decl_file106 .byte 2 // DW_AT_decl_line107 .word 40 // DW_AT_type108 // DW_AT_external109 .byte 3 // Abbrev [3] 0x28:0x4 DW_TAG_base_type110 .byte 1 // DW_AT_name111 .byte 5 // DW_AT_encoding112 .byte 4 // DW_AT_byte_size113 .byte 0 // End Of Children Mark114.Ldebug_info_dwo_end0:115 .section .debug_abbrev.dwo,"e",@progbits116 .byte 1 // Abbreviation Code117 .byte 17 // DW_TAG_compile_unit118 .byte 1 // DW_CHILDREN_yes119 .byte 37 // DW_AT_producer120 .ascii "\202>" // DW_FORM_GNU_str_index121 .byte 19 // DW_AT_language122 .byte 5 // DW_FORM_data2123 .byte 3 // DW_AT_name124 .ascii "\202>" // DW_FORM_GNU_str_index125 .ascii "\260B" // DW_AT_GNU_dwo_name126 .ascii "\202>" // DW_FORM_GNU_str_index127 .ascii "\261B" // DW_AT_GNU_dwo_id128 .byte 7 // DW_FORM_data8129 .byte 0 // EOM(1)130 .byte 0 // EOM(2)131 .byte 2 // Abbreviation Code132 .byte 46 // DW_TAG_subprogram133 .byte 0 // DW_CHILDREN_no134 .byte 17 // DW_AT_low_pc135 .ascii "\201>" // DW_FORM_GNU_addr_index136 .byte 18 // DW_AT_high_pc137 .byte 6 // DW_FORM_data4138 .byte 64 // DW_AT_frame_base139 .byte 24 // DW_FORM_exprloc140 .byte 3 // DW_AT_name141 .ascii "\202>" // DW_FORM_GNU_str_index142 .byte 58 // DW_AT_decl_file143 .byte 11 // DW_FORM_data1144 .byte 59 // DW_AT_decl_line145 .byte 11 // DW_FORM_data1146 .byte 73 // DW_AT_type147 .byte 19 // DW_FORM_ref4148 .byte 63 // DW_AT_external149 .byte 25 // DW_FORM_flag_present150 .byte 0 // EOM(1)151 .byte 0 // EOM(2)152 .byte 3 // Abbreviation Code153 .byte 36 // DW_TAG_base_type154 .byte 0 // DW_CHILDREN_no155 .byte 3 // DW_AT_name156 .ascii "\202>" // DW_FORM_GNU_str_index157 .byte 62 // DW_AT_encoding158 .byte 11 // DW_FORM_data1159 .byte 11 // DW_AT_byte_size160 .byte 11 // DW_FORM_data1161 .byte 0 // EOM(1)162 .byte 0 // EOM(2)163 .byte 0 // EOM(3)164 .section .debug_addr,"",@progbits165.Laddr_table_base0:166 .xword .Lfunc_begin0167 .section .debug_gnu_pubnames,"",@progbits168 .word .LpubNames_end0-.LpubNames_start0 // Length of Public Names Info169.LpubNames_start0:170 .hword 2 // DWARF Version171 .word .Lcu_begin0 // Offset of Compilation Unit Info172 .word 48 // Compilation Unit Length173 .word 25 // DIE offset174 .byte 48 // Attributes: FUNCTION, EXTERNAL175 .asciz "main" // External Name176 .word 0 // End Mark177.LpubNames_end0:178 .section .debug_gnu_pubtypes,"",@progbits179 .word .LpubTypes_end0-.LpubTypes_start0 // Length of Public Types Info180.LpubTypes_start0:181 .hword 2 // DWARF Version182 .word .Lcu_begin0 // Offset of Compilation Unit Info183 .word 48 // Compilation Unit Length184 .word 40 // DIE offset185 .byte 144 // Attributes: TYPE, STATIC186 .asciz "int" // External Name187 .word 0 // End Mark188.LpubTypes_end0:189 .section ".note.GNU-stack","",@progbits190 .addrsig191 .addrsig_sym _Z6calleei192 .section .debug_line,"",@progbits193.Lline_table_start0:194#--- callee.s195 .file "callee.cpp"196 .globl _Z6calleei // -- Begin function _Z6calleei197 .type _Z6calleei,@function198_Z6calleei: // @_Z6calleei199.Lfunc_begin0:200 .file 1 "." "callee.cpp"201 .loc 1 1 0 // callee.cpp:1:0202 .loc 1 1 28 prologue_end // callee.cpp:1:28203 .loc 1 1 21 epilogue_begin is_stmt 0 // callee.cpp:1:21204 ret205.Lfunc_end0:206 .size _Z6calleei, .Lfunc_end0-_Z6calleei207 .section .debug_abbrev,"",@progbits208 .byte 1 // Abbreviation Code209 .byte 17 // DW_TAG_compile_unit210 .byte 0 // DW_CHILDREN_no211 .byte 16 // DW_AT_stmt_list212 .byte 23 // DW_FORM_sec_offset213 .byte 27 // DW_AT_comp_dir214 .byte 14 // DW_FORM_strp215 .ascii "\264B" // DW_AT_GNU_pubnames216 .byte 25 // DW_FORM_flag_present217 .ascii "\260B" // DW_AT_GNU_dwo_name218 .byte 14 // DW_FORM_strp219 .ascii "\261B" // DW_AT_GNU_dwo_id220 .byte 7 // DW_FORM_data8221 .byte 17 // DW_AT_low_pc222 .byte 1 // DW_FORM_addr223 .byte 18 // DW_AT_high_pc224 .byte 6 // DW_FORM_data4225 .ascii "\263B" // DW_AT_GNU_addr_base226 .byte 23 // DW_FORM_sec_offset227 .byte 0 // EOM(1)228 .byte 0 // EOM(2)229 .byte 0 // EOM(3)230 .section .debug_info,"",@progbits231.Lcu_begin0:232 .word .Ldebug_info_end0-.Ldebug_info_start0 // Length of Unit233.Ldebug_info_start0:234 .hword 4 // DWARF version number235 .word .debug_abbrev // Offset Into Abbrev. Section236 .byte 8 // Address Size (in bytes)237 .byte 1 // Abbrev [1] 0xb:0x25 DW_TAG_compile_unit238 .word .Lline_table_start0 // DW_AT_stmt_list239 .word .Lskel_string0 // DW_AT_comp_dir240 // DW_AT_GNU_pubnames241 .word .Lskel_string1 // DW_AT_GNU_dwo_name242 .xword 7650227797527095061 // DW_AT_GNU_dwo_id243 .xword .Lfunc_begin0 // DW_AT_low_pc244 .word .Lfunc_end0-.Lfunc_begin0 // DW_AT_high_pc245 .word .Laddr_table_base0 // DW_AT_GNU_addr_base246.Ldebug_info_end0:247 .section .debug_str,"MS",@progbits,1248.Lskel_string0:249 .asciz "." // string offset=0250.Lskel_string1:251 .asciz "main.exe-callee.dwo" // string offset=2252 .section .debug_str.dwo,"eMS",@progbits,1253.Linfo_string0:254 .asciz "_Z6calleei" // string offset=0255.Linfo_string1:256 .asciz "callee" // string offset=11257.Linfo_string2:258 .asciz "int" // string offset=18259.Linfo_string3:260 .asciz "x" // string offset=22261.Linfo_string4:262 .byte 0 // string offset=24263.Linfo_string5:264 .asciz "callee.cpp" // string offset=25265.Linfo_string6:266 .asciz "main.exe-callee.dwo" // string offset=36267 .section .debug_str_offsets.dwo,"e",@progbits268 .word 0269 .word 11270 .word 18271 .word 22272 .word 24273 .word 25274 .word 36275 .section .debug_info.dwo,"e",@progbits276 .word .Ldebug_info_dwo_end0-.Ldebug_info_dwo_start0 // Length of Unit277.Ldebug_info_dwo_start0:278 .hword 4 // DWARF version number279 .word 0 // Offset Into Abbrev. Section280 .byte 8 // Address Size (in bytes)281 .byte 1 // Abbrev [1] 0xb:0x2f DW_TAG_compile_unit282 .byte 4 // DW_AT_producer283 .hword 33 // DW_AT_language284 .byte 5 // DW_AT_name285 .byte 6 // DW_AT_GNU_dwo_name286 .xword 7650227797527095061 // DW_AT_GNU_dwo_id287 .byte 2 // Abbrev [2] 0x19:0x1c DW_TAG_subprogram288 .byte 0 // DW_AT_low_pc289 .word .Lfunc_end0-.Lfunc_begin0 // DW_AT_high_pc290 .byte 1 // DW_AT_frame_base291 .byte 111292 .byte 0 // DW_AT_linkage_name293 .byte 1 // DW_AT_name294 .byte 1 // DW_AT_decl_file295 .byte 1 // DW_AT_decl_line296 .word 53 // DW_AT_type297 // DW_AT_external298 .byte 3 // Abbrev [3] 0x29:0xb DW_TAG_formal_parameter299 .byte 2 // DW_AT_location300 .byte 145301 .byte 12302 .byte 3 // DW_AT_name303 .byte 1 // DW_AT_decl_file304 .byte 1 // DW_AT_decl_line305 .word 53 // DW_AT_type306 .byte 0 // End Of Children Mark307 .byte 4 // Abbrev [4] 0x35:0x4 DW_TAG_base_type308 .byte 2 // DW_AT_name309 .byte 5 // DW_AT_encoding310 .byte 4 // DW_AT_byte_size311 .byte 0 // End Of Children Mark312.Ldebug_info_dwo_end0:313 .section .debug_abbrev.dwo,"e",@progbits314 .byte 1 // Abbreviation Code315 .byte 17 // DW_TAG_compile_unit316 .byte 1 // DW_CHILDREN_yes317 .byte 37 // DW_AT_producer318 .ascii "\202>" // DW_FORM_GNU_str_index319 .byte 19 // DW_AT_language320 .byte 5 // DW_FORM_data2321 .byte 3 // DW_AT_name322 .ascii "\202>" // DW_FORM_GNU_str_index323 .ascii "\260B" // DW_AT_GNU_dwo_name324 .ascii "\202>" // DW_FORM_GNU_str_index325 .ascii "\261B" // DW_AT_GNU_dwo_id326 .byte 7 // DW_FORM_data8327 .byte 0 // EOM(1)328 .byte 0 // EOM(2)329 .byte 2 // Abbreviation Code330 .byte 46 // DW_TAG_subprogram331 .byte 1 // DW_CHILDREN_yes332 .byte 17 // DW_AT_low_pc333 .ascii "\201>" // DW_FORM_GNU_addr_index334 .byte 18 // DW_AT_high_pc335 .byte 6 // DW_FORM_data4336 .byte 64 // DW_AT_frame_base337 .byte 24 // DW_FORM_exprloc338 .byte 110 // DW_AT_linkage_name339 .ascii "\202>" // DW_FORM_GNU_str_index340 .byte 3 // DW_AT_name341 .ascii "\202>" // DW_FORM_GNU_str_index342 .byte 58 // DW_AT_decl_file343 .byte 11 // DW_FORM_data1344 .byte 59 // DW_AT_decl_line345 .byte 11 // DW_FORM_data1346 .byte 73 // DW_AT_type347 .byte 19 // DW_FORM_ref4348 .byte 63 // DW_AT_external349 .byte 25 // DW_FORM_flag_present350 .byte 0 // EOM(1)351 .byte 0 // EOM(2)352 .byte 3 // Abbreviation Code353 .byte 5 // DW_TAG_formal_parameter354 .byte 0 // DW_CHILDREN_no355 .byte 2 // DW_AT_location356 .byte 24 // DW_FORM_exprloc357 .byte 3 // DW_AT_name358 .ascii "\202>" // DW_FORM_GNU_str_index359 .byte 58 // DW_AT_decl_file360 .byte 11 // DW_FORM_data1361 .byte 59 // DW_AT_decl_line362 .byte 11 // DW_FORM_data1363 .byte 73 // DW_AT_type364 .byte 19 // DW_FORM_ref4365 .byte 0 // EOM(1)366 .byte 0 // EOM(2)367 .byte 4 // Abbreviation Code368 .byte 36 // DW_TAG_base_type369 .byte 0 // DW_CHILDREN_no370 .byte 3 // DW_AT_name371 .ascii "\202>" // DW_FORM_GNU_str_index372 .byte 62 // DW_AT_encoding373 .byte 11 // DW_FORM_data1374 .byte 11 // DW_AT_byte_size375 .byte 11 // DW_FORM_data1376 .byte 0 // EOM(1)377 .byte 0 // EOM(2)378 .byte 0 // EOM(3)379 .section .debug_addr,"",@progbits380.Laddr_table_base0:381 .xword .Lfunc_begin0382 .section .debug_gnu_pubnames,"",@progbits383 .word .LpubNames_end0-.LpubNames_start0 // Length of Public Names Info384.LpubNames_start0:385 .hword 2 // DWARF Version386 .word .Lcu_begin0 // Offset of Compilation Unit Info387 .word 48 // Compilation Unit Length388 .word 25 // DIE offset389 .byte 48 // Attributes: FUNCTION, EXTERNAL390 .asciz "callee" // External Name391 .word 0 // End Mark392.LpubNames_end0:393 .section .debug_gnu_pubtypes,"",@progbits394 .word .LpubTypes_end0-.LpubTypes_start0 // Length of Public Types Info395.LpubTypes_start0:396 .hword 2 // DWARF Version397 .word .Lcu_begin0 // Offset of Compilation Unit Info398 .word 48 // Compilation Unit Length399 .word 53 // DIE offset400 .byte 144 // Attributes: TYPE, STATIC401 .asciz "int" // External Name402 .word 0 // End Mark403.LpubTypes_end0:404 .section ".note.GNU-stack","",@progbits405 .addrsig406 .section .debug_line,"",@progbits407.Lline_table_start0:408