360 lines · plain
1# clang++ -ffunction-sections -g2 -gdwarf-52# Manually modified to use ranges like what generates sometimes -fbasic-block-sections=all,3# and changed start of range to 0.4# int doStuff(int val) {5# if (val)6# ++val;7# return val;8# }9#10# int main(int argc, const char** argv) {11# return doStuff(argc);12# }13 .text14 .file "main.cpp"15 .section .text._Z7doStuffi,"ax",@progbits16 .globl _Z7doStuffi # -- Begin function _Z7doStuffi17 .p2align 4, 0x9018 .type _Z7doStuffi,@function19_Z7doStuffi: # @_Z7doStuffi20.Lfunc_begin0:21 .file 0 "/subprogramRanges" "main.cpp" md5 0x45fd34ef778739dca24be206894f1d1522 .loc 0 1 0 # main.cpp:1:023 .cfi_startproc24# %bb.0: # %entry25 pushq %rbp26 .cfi_def_cfa_offset 1627 .cfi_offset %rbp, -1628 movq %rsp, %rbp29 .cfi_def_cfa_register %rbp30 movl %edi, -4(%rbp)31.Ltmp0:32 .loc 0 2 7 prologue_end # main.cpp:2:733 cmpl $0, -4(%rbp)34.Ltmp1:35 .loc 0 2 7 is_stmt 0 # main.cpp:2:736 je .LBB0_237# %bb.1: # %if.then38.Ltmp2:39 .loc 0 3 5 is_stmt 1 # main.cpp:3:540 movl -4(%rbp), %eax41 addl $1, %eax42 movl %eax, -4(%rbp)43.Ltmp3:44.LBB0_2: # %if.end45 .loc 0 4 10 # main.cpp:4:1046 movl -4(%rbp), %eax47 .loc 0 4 3 epilogue_begin is_stmt 0 # main.cpp:4:348 popq %rbp49 .cfi_def_cfa %rsp, 850 retq51.Ltmp4:52.Lfunc_end0:53 .size _Z7doStuffi, .Lfunc_end0-_Z7doStuffi54 .cfi_endproc55 # -- End function56 .section .text.main,"ax",@progbits57 .globl main # -- Begin function main58 .p2align 4, 0x9059 .type main,@function60main: # @main61.Lfunc_begin1:62 .loc 0 7 0 is_stmt 1 # main.cpp:7:063 .cfi_startproc64# %bb.0: # %entry65 pushq %rbp66 .cfi_def_cfa_offset 1667 .cfi_offset %rbp, -1668 movq %rsp, %rbp69 .cfi_def_cfa_register %rbp70 subq $16, %rsp71 movl $0, -4(%rbp)72 movl %edi, -8(%rbp)73 movq %rsi, -16(%rbp)74.Ltmp5:75 .loc 0 8 21 prologue_end # main.cpp:8:2176 movl -8(%rbp), %edi77 .loc 0 8 13 is_stmt 0 # main.cpp:8:1378 callq _Z7doStuffi79 .loc 0 8 5 epilogue_begin # main.cpp:8:580 addq $16, %rsp81 popq %rbp82 .cfi_def_cfa %rsp, 883 retq84.Ltmp6:85.Lfunc_end1:86 .size main, .Lfunc_end1-main87 .cfi_endproc88 # -- End function89 .section .debug_abbrev,"",@progbits90 .byte 1 # Abbreviation Code91 .byte 17 # DW_TAG_compile_unit92 .byte 1 # DW_CHILDREN_yes93 .byte 37 # DW_AT_producer94 .byte 37 # DW_FORM_strx195 .byte 19 # DW_AT_language96 .byte 5 # DW_FORM_data297 .byte 3 # DW_AT_name98 .byte 37 # DW_FORM_strx199 .byte 114 # DW_AT_str_offsets_base100 .byte 23 # DW_FORM_sec_offset101 .byte 16 # DW_AT_stmt_list102 .byte 23 # DW_FORM_sec_offset103 .byte 27 # DW_AT_comp_dir104 .byte 37 # DW_FORM_strx1105 .byte 17 # DW_AT_low_pc106 .byte 1 # DW_FORM_addr107 .byte 85 # DW_AT_ranges108 .byte 35 # DW_FORM_rnglistx109 .byte 115 # DW_AT_addr_base110 .byte 23 # DW_FORM_sec_offset111 .byte 116 # DW_AT_rnglists_base112 .byte 23 # DW_FORM_sec_offset113 .byte 0 # EOM(1)114 .byte 0 # EOM(2)115 .byte 2 # Abbreviation Code116 .byte 46 # DW_TAG_subprogram117 .byte 1 # DW_CHILDREN_yes118 .byte 85 # DW_AT_ranges119 .byte 35 # DW_FORM_rnglistx120 .byte 64 # DW_AT_frame_base121 .byte 24 # DW_FORM_exprloc122 .byte 110 # DW_AT_linkage_name123 .byte 37 # DW_FORM_strx1124 .byte 3 # DW_AT_name125 .byte 37 # DW_FORM_strx1126 .byte 58 # DW_AT_decl_file127 .byte 11 # DW_FORM_data1128 .byte 59 # DW_AT_decl_line129 .byte 11 # DW_FORM_data1130 .byte 73 # DW_AT_type131 .byte 19 # DW_FORM_ref4132 .byte 63 # DW_AT_external133 .byte 25 # DW_FORM_flag_present134 .byte 0 # EOM(1)135 .byte 0 # EOM(2)136 .byte 3 # Abbreviation Code137 .byte 5 # DW_TAG_formal_parameter138 .byte 0 # DW_CHILDREN_no139 .byte 2 # DW_AT_location140 .byte 24 # DW_FORM_exprloc141 .byte 3 # DW_AT_name142 .byte 37 # DW_FORM_strx1143 .byte 58 # DW_AT_decl_file144 .byte 11 # DW_FORM_data1145 .byte 59 # DW_AT_decl_line146 .byte 11 # DW_FORM_data1147 .byte 73 # DW_AT_type148 .byte 19 # DW_FORM_ref4149 .byte 0 # EOM(1)150 .byte 0 # EOM(2)151 .byte 4 # Abbreviation Code152 .byte 46 # DW_TAG_subprogram153 .byte 1 # DW_CHILDREN_yes154 .byte 17 # DW_AT_low_pc155 .byte 27 # DW_FORM_addrx156 .byte 18 # DW_AT_high_pc157 .byte 6 # DW_FORM_data4158 .byte 64 # DW_AT_frame_base159 .byte 24 # DW_FORM_exprloc160 .byte 3 # DW_AT_name161 .byte 37 # DW_FORM_strx1162 .byte 58 # DW_AT_decl_file163 .byte 11 # DW_FORM_data1164 .byte 59 # DW_AT_decl_line165 .byte 11 # DW_FORM_data1166 .byte 73 # DW_AT_type167 .byte 19 # DW_FORM_ref4168 .byte 63 # DW_AT_external169 .byte 25 # DW_FORM_flag_present170 .byte 0 # EOM(1)171 .byte 0 # EOM(2)172 .byte 5 # Abbreviation Code173 .byte 36 # DW_TAG_base_type174 .byte 0 # DW_CHILDREN_no175 .byte 3 # DW_AT_name176 .byte 37 # DW_FORM_strx1177 .byte 62 # DW_AT_encoding178 .byte 11 # DW_FORM_data1179 .byte 11 # DW_AT_byte_size180 .byte 11 # DW_FORM_data1181 .byte 0 # EOM(1)182 .byte 0 # EOM(2)183 .byte 6 # Abbreviation Code184 .byte 15 # DW_TAG_pointer_type185 .byte 0 # DW_CHILDREN_no186 .byte 73 # DW_AT_type187 .byte 19 # DW_FORM_ref4188 .byte 0 # EOM(1)189 .byte 0 # EOM(2)190 .byte 7 # Abbreviation Code191 .byte 38 # DW_TAG_const_type192 .byte 0 # DW_CHILDREN_no193 .byte 73 # DW_AT_type194 .byte 19 # DW_FORM_ref4195 .byte 0 # EOM(1)196 .byte 0 # EOM(2)197 .byte 0 # EOM(3)198 .section .debug_info,"",@progbits199.Lcu_begin0:200 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit201.Ldebug_info_start0:202 .short 5 # DWARF version number203 .byte 1 # DWARF Unit Type204 .byte 8 # Address Size (in bytes)205 .long .debug_abbrev # Offset Into Abbrev. Section206 .byte 1 # Abbrev [1] 0xc:0x79 DW_TAG_compile_unit207 .byte 0 # DW_AT_producer208 .short 33 # DW_AT_language209 .byte 1 # DW_AT_name210 .long .Lstr_offsets_base0 # DW_AT_str_offsets_base211 .long .Lline_table_start0 # DW_AT_stmt_list212 .byte 2 # DW_AT_comp_dir213 .quad 0 # DW_AT_low_pc214 .byte 0 # DW_AT_ranges215 .long .Laddr_table_base0 # DW_AT_addr_base216 .long .Lrnglists_table_base0 # DW_AT_rnglists_base217 .byte 2 # Abbrev [2] 0x2b:0x1c DW_TAG_subprogram218 .byte 1 # DW_AT_ranges219 .byte 1 # DW_AT_frame_base220 .byte 86221 .byte 3 # DW_AT_linkage_name222 .byte 4 # DW_AT_name223 .byte 0 # DW_AT_decl_file224 .byte 1 # DW_AT_decl_line225 .long 109 # DW_AT_type226 # DW_AT_external227 .byte 3 # Abbrev [3] 0x3b:0xb DW_TAG_formal_parameter228 .byte 2 # DW_AT_location229 .byte 145230 .byte 124231 .byte 7 # DW_AT_name232 .byte 0 # DW_AT_decl_file233 .byte 1 # DW_AT_decl_line234 .long 109 # DW_AT_type235 .byte 0 # End Of Children Mark236 .byte 4 # Abbrev [4] 0x47:0x26 DW_TAG_subprogram237 .byte 1 # DW_AT_low_pc238 .long .Lfunc_end1-.Lfunc_begin1 # DW_AT_high_pc239 .byte 1 # DW_AT_frame_base240 .byte 86241 .byte 6 # DW_AT_name242 .byte 0 # DW_AT_decl_file243 .byte 7 # DW_AT_decl_line244 .long 109 # DW_AT_type245 # DW_AT_external246 .byte 3 # Abbrev [3] 0x56:0xb DW_TAG_formal_parameter247 .byte 2 # DW_AT_location248 .byte 145249 .byte 120250 .byte 8 # DW_AT_name251 .byte 0 # DW_AT_decl_file252 .byte 7 # DW_AT_decl_line253 .long 109 # DW_AT_type254 .byte 3 # Abbrev [3] 0x61:0xb DW_TAG_formal_parameter255 .byte 2 # DW_AT_location256 .byte 145257 .byte 112258 .byte 9 # DW_AT_name259 .byte 0 # DW_AT_decl_file260 .byte 7 # DW_AT_decl_line261 .long 105 # DW_AT_type262 .byte 0 # End Of Children Mark263 .byte 5 # Abbrev [5] 0x6d:0x4 DW_TAG_base_type264 .byte 5 # DW_AT_name265 .byte 5 # DW_AT_encoding266 .byte 4 # DW_AT_byte_size267 .byte 6 # Abbrev [6] 0x71:0x5 DW_TAG_pointer_type268 .long 114 # DW_AT_type269 .byte 6 # Abbrev [6] 0x76:0x5 DW_TAG_pointer_type270 .long 119 # DW_AT_type271 .byte 7 # Abbrev [7] 0x7b:0x5 DW_TAG_const_type272 .long 124 # DW_AT_type273 .byte 5 # Abbrev [5] 0x80:0x4 DW_TAG_base_type274 .byte 10 # DW_AT_name275 .byte 6 # DW_AT_encoding276 .byte 1 # DW_AT_byte_size277 .byte 0 # End Of Children Mark278.Ldebug_info_end0:279 .section .debug_rnglists,"",@progbits280 .long .Ldebug_list_header_end0-.Ldebug_list_header_start0 # Length281.Ldebug_list_header_start0:282 .short 5 # Version283 .byte 8 # Address size284 .byte 0 # Segment selector size285 .long 1 # Offset entry count286.Lrnglists_table_base0:287 .long .Ldebug_ranges0-.Lrnglists_table_base0288 .long .Ldebug_ranges1-.Lrnglists_table_base0289.Ldebug_ranges0:290 .byte 3 # DW_RLE_startx_length291 .byte 0 # start index292 .uleb128 .Lfunc_end0-.Lfunc_begin0 # length293 .byte 3 # DW_RLE_startx_length294 .byte 1 # start index295 .uleb128 .Lfunc_end1-.Lfunc_begin1 # length296 .byte 0 # DW_RLE_end_of_list297.Ldebug_ranges1:298 .byte 3 # DW_RLE_startx_length299 .byte 2 # start index300 .uleb128 .Lfunc_end0-.Lfunc_begin0 # length301 .byte 0 # DW_RLE_end_of_list302.Ldebug_list_header_end0:303 .section .debug_str_offsets,"",@progbits304 .long 48 # Length of String Offsets Set305 .short 5306 .short 0307.Lstr_offsets_base0:308 .section .debug_str,"MS",@progbits,1309.Linfo_string0:310 .asciz "clang version 17.0.0 (https://github.com/llvm/llvm-project.git 640e07c49037cca41a1bfbeb916b569d8c950aea)" # string offset=0311.Linfo_string1:312 .asciz "main.cpp" # string offset=105313.Linfo_string2:314 .asciz "/subprogramRanges" # string offset=114315.Linfo_string3:316 .asciz "_Z7doStuffi" # string offset=169317.Linfo_string4:318 .asciz "doStuff" # string offset=181319.Linfo_string5:320 .asciz "int" # string offset=189321.Linfo_string6:322 .asciz "main" # string offset=193323.Linfo_string7:324 .asciz "val" # string offset=198325.Linfo_string8:326 .asciz "argc" # string offset=202327.Linfo_string9:328 .asciz "argv" # string offset=207329.Linfo_string10:330 .asciz "char" # string offset=212331 .section .debug_str_offsets,"",@progbits332 .long .Linfo_string0333 .long .Linfo_string1334 .long .Linfo_string2335 .long .Linfo_string3336 .long .Linfo_string4337 .long .Linfo_string5338 .long .Linfo_string6339 .long .Linfo_string7340 .long .Linfo_string8341 .long .Linfo_string9342 .long .Linfo_string10343 .section .debug_addr,"",@progbits344 .long .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution345.Ldebug_addr_start0:346 .short 5 # DWARF version number347 .byte 8 # Address size348 .byte 0 # Segment selector size349.Laddr_table_base0:350 .quad .Lfunc_begin0351 .quad .Lfunc_begin1352 .quad 0x0353.Ldebug_addr_end0:354 .ident "clang version 17.0.0 (https://github.com/llvm/llvm-project.git 640e07c49037cca41a1bfbeb916b569d8c950aea)"355 .section ".note.GNU-stack","",@progbits356 .addrsig357 .addrsig_sym _Z7doStuffi358 .section .debug_line,"",@progbits359.Lline_table_start0:360