332 lines · plain
1# clang++ -fbasic-block-sections=all -ffunction-sections -g2 -gdwarf-42# int doStuff(int val) {3# if (val)4# ++val;5# return val;6# }7#8# int main(int argc, const char** argv) {9# return doStuff(argc);10# }11 .text12 .file "main.cpp"13 .section .text._Z7doStuffi,"ax",@progbits14 .globl _Z7doStuffi # -- Begin function _Z7doStuffi15 .p2align 4, 0x9016 .type _Z7doStuffi,@function17_Z7doStuffi: # @_Z7doStuffi18.Lfunc_begin0:19 .file 1 "/subprogramRanges" "main.cpp"20 .loc 1 1 0 # main.cpp:1:021 .cfi_startproc22# %bb.0: # %entry23 pushq %rbp24 .cfi_def_cfa_offset 1625 .cfi_offset %rbp, -1626 movq %rsp, %rbp27 .cfi_def_cfa_register %rbp28 movl %edi, -4(%rbp)29.Ltmp0:30 .loc 1 2 7 prologue_end # main.cpp:2:731 cmpl $0, -4(%rbp)32.Ltmp1:33 .loc 1 2 7 is_stmt 0 # main.cpp:2:734 je _Z7doStuffi.__part.235 jmp _Z7doStuffi.__part.136.LBB_END0_0:37 .cfi_endproc38 .section .text._Z7doStuffi,"ax",@progbits,unique,139_Z7doStuffi.__part.1: # %if.then40 .cfi_startproc41 .cfi_def_cfa %rbp, 1642 .cfi_offset %rbp, -1643 .loc 1 3 5 is_stmt 1 # main.cpp:3:544 movl -4(%rbp), %eax45 addl $1, %eax46 movl %eax, -4(%rbp)47 jmp _Z7doStuffi.__part.248.LBB_END0_1:49 .size _Z7doStuffi.__part.1, .LBB_END0_1-_Z7doStuffi.__part.150 .cfi_endproc51 .section .text._Z7doStuffi,"ax",@progbits,unique,252_Z7doStuffi.__part.2: # %if.end53 .cfi_startproc54 .cfi_def_cfa %rbp, 1655 .cfi_offset %rbp, -1656 .loc 1 4 10 # main.cpp:4:1057 movl -4(%rbp), %eax58 .loc 1 4 3 epilogue_begin is_stmt 0 # main.cpp:4:359 popq %rbp60 .cfi_def_cfa %rsp, 861 retq62.LBB_END0_2:63 .size _Z7doStuffi.__part.2, .LBB_END0_2-_Z7doStuffi.__part.264 .cfi_endproc65 .section .text._Z7doStuffi,"ax",@progbits66.Lfunc_end0:67 .size _Z7doStuffi, .Lfunc_end0-_Z7doStuffi68 # -- End function69 .section .text.main,"ax",@progbits70 .globl main # -- Begin function main71 .p2align 4, 0x9072 .type main,@function73main: # @main74.Lfunc_begin1:75 .loc 1 7 0 is_stmt 1 # main.cpp:7:076 .cfi_startproc77# %bb.0: # %entry78 pushq %rbp79 .cfi_def_cfa_offset 1680 .cfi_offset %rbp, -1681 movq %rsp, %rbp82 .cfi_def_cfa_register %rbp83 subq $16, %rsp84 movl $0, -4(%rbp)85 movl %edi, -8(%rbp)86 movq %rsi, -16(%rbp)87.Ltmp2:88 .loc 1 8 21 prologue_end # main.cpp:8:2189 movl -8(%rbp), %edi90 .loc 1 8 13 is_stmt 0 # main.cpp:8:1391 callq _Z7doStuffi92 .loc 1 8 5 epilogue_begin # main.cpp:8:593 addq $16, %rsp94 popq %rbp95 .cfi_def_cfa %rsp, 896 retq97.LBB_END1_0:98 .cfi_endproc99.Lfunc_end1:100 .size main, .Lfunc_end1-main101 # -- End function102 .section .debug_abbrev,"",@progbits103 .byte 1 # Abbreviation Code104 .byte 17 # DW_TAG_compile_unit105 .byte 1 # DW_CHILDREN_yes106 .byte 37 # DW_AT_producer107 .byte 14 # DW_FORM_strp108 .byte 19 # DW_AT_language109 .byte 5 # DW_FORM_data2110 .byte 3 # DW_AT_name111 .byte 14 # DW_FORM_strp112 .byte 16 # DW_AT_stmt_list113 .byte 23 # DW_FORM_sec_offset114 .byte 27 # DW_AT_comp_dir115 .byte 14 # DW_FORM_strp116 .byte 17 # DW_AT_low_pc117 .byte 1 # DW_FORM_addr118 .byte 85 # DW_AT_ranges119 .byte 23 # DW_FORM_sec_offset120 .byte 0 # EOM(1)121 .byte 0 # EOM(2)122 .byte 2 # Abbreviation Code123 .byte 46 # DW_TAG_subprogram124 .byte 1 # DW_CHILDREN_yes125 .byte 85 # DW_AT_ranges126 .byte 23 # DW_FORM_sec_offset127 .byte 64 # DW_AT_frame_base128 .byte 24 # DW_FORM_exprloc129 .byte 110 # DW_AT_linkage_name130 .byte 14 # DW_FORM_strp131 .byte 3 # DW_AT_name132 .byte 14 # DW_FORM_strp133 .byte 58 # DW_AT_decl_file134 .byte 11 # DW_FORM_data1135 .byte 59 # DW_AT_decl_line136 .byte 11 # DW_FORM_data1137 .byte 73 # DW_AT_type138 .byte 19 # DW_FORM_ref4139 .byte 63 # DW_AT_external140 .byte 25 # DW_FORM_flag_present141 .byte 0 # EOM(1)142 .byte 0 # EOM(2)143 .byte 3 # Abbreviation Code144 .byte 5 # DW_TAG_formal_parameter145 .byte 0 # DW_CHILDREN_no146 .byte 2 # DW_AT_location147 .byte 24 # DW_FORM_exprloc148 .byte 3 # DW_AT_name149 .byte 14 # DW_FORM_strp150 .byte 58 # DW_AT_decl_file151 .byte 11 # DW_FORM_data1152 .byte 59 # DW_AT_decl_line153 .byte 11 # DW_FORM_data1154 .byte 73 # DW_AT_type155 .byte 19 # DW_FORM_ref4156 .byte 0 # EOM(1)157 .byte 0 # EOM(2)158 .byte 4 # Abbreviation Code159 .byte 46 # DW_TAG_subprogram160 .byte 1 # DW_CHILDREN_yes161 .byte 17 # DW_AT_low_pc162 .byte 1 # DW_FORM_addr163 .byte 18 # DW_AT_high_pc164 .byte 6 # DW_FORM_data4165 .byte 64 # DW_AT_frame_base166 .byte 24 # DW_FORM_exprloc167 .byte 3 # DW_AT_name168 .byte 14 # DW_FORM_strp169 .byte 58 # DW_AT_decl_file170 .byte 11 # DW_FORM_data1171 .byte 59 # DW_AT_decl_line172 .byte 11 # DW_FORM_data1173 .byte 73 # DW_AT_type174 .byte 19 # DW_FORM_ref4175 .byte 63 # DW_AT_external176 .byte 25 # DW_FORM_flag_present177 .byte 0 # EOM(1)178 .byte 0 # EOM(2)179 .byte 5 # Abbreviation Code180 .byte 36 # DW_TAG_base_type181 .byte 0 # DW_CHILDREN_no182 .byte 3 # DW_AT_name183 .byte 14 # DW_FORM_strp184 .byte 62 # DW_AT_encoding185 .byte 11 # DW_FORM_data1186 .byte 11 # DW_AT_byte_size187 .byte 11 # DW_FORM_data1188 .byte 0 # EOM(1)189 .byte 0 # EOM(2)190 .byte 6 # Abbreviation Code191 .byte 15 # DW_TAG_pointer_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 7 # Abbreviation Code198 .byte 38 # DW_TAG_const_type199 .byte 0 # DW_CHILDREN_no200 .byte 73 # DW_AT_type201 .byte 19 # DW_FORM_ref4202 .byte 0 # EOM(1)203 .byte 0 # EOM(2)204 .byte 0 # EOM(3)205 .section .debug_info,"",@progbits206.Lcu_begin0:207 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit208.Ldebug_info_start0:209 .short 4 # DWARF version number210 .long .debug_abbrev # Offset Into Abbrev. Section211 .byte 8 # Address Size (in bytes)212 .byte 1 # Abbrev [1] 0xb:0x97 DW_TAG_compile_unit213 .long .Linfo_string0 # DW_AT_producer214 .short 33 # DW_AT_language215 .long .Linfo_string1 # DW_AT_name216 .long .Lline_table_start0 # DW_AT_stmt_list217 .long .Linfo_string2 # DW_AT_comp_dir218 .quad 0 # DW_AT_low_pc219 .long .Ldebug_ranges1 # DW_AT_ranges220 .byte 2 # Abbrev [2] 0x2a:0x24 DW_TAG_subprogram221 .long .Ldebug_ranges0 # DW_AT_ranges222 .byte 1 # DW_AT_frame_base223 .byte 86224 .long .Linfo_string3 # DW_AT_linkage_name225 .long .Linfo_string4 # DW_AT_name226 .byte 1 # DW_AT_decl_file227 .byte 1 # DW_AT_decl_line228 .long 132 # DW_AT_type229 # DW_AT_external230 .byte 3 # Abbrev [3] 0x3f:0xe DW_TAG_formal_parameter231 .byte 2 # DW_AT_location232 .byte 145233 .byte 124234 .long .Linfo_string7 # DW_AT_name235 .byte 1 # DW_AT_decl_file236 .byte 1 # DW_AT_decl_line237 .long 132 # DW_AT_type238 .byte 0 # End Of Children Mark239 .byte 4 # Abbrev [4] 0x4e:0x36 DW_TAG_subprogram240 .quad .Lfunc_begin1 # DW_AT_low_pc241 .long .Lfunc_end1-.Lfunc_begin1 # DW_AT_high_pc242 .byte 1 # DW_AT_frame_base243 .byte 86244 .long .Linfo_string6 # DW_AT_name245 .byte 1 # DW_AT_decl_file246 .byte 7 # DW_AT_decl_line247 .long 132 # DW_AT_type248 # DW_AT_external249 .byte 3 # Abbrev [3] 0x67:0xe DW_TAG_formal_parameter250 .byte 2 # DW_AT_location251 .byte 145252 .byte 120253 .long .Linfo_string8 # DW_AT_name254 .byte 1 # DW_AT_decl_file255 .byte 7 # DW_AT_decl_line256 .long 132 # DW_AT_type257 .byte 3 # Abbrev [3] 0x75:0xe DW_TAG_formal_parameter258 .byte 2 # DW_AT_location259 .byte 145260 .byte 112261 .long .Linfo_string9 # DW_AT_name262 .byte 1 # DW_AT_decl_file263 .byte 7 # DW_AT_decl_line264 .long 139 # DW_AT_type265 .byte 0 # End Of Children Mark266 .byte 5 # Abbrev [5] 0x84:0x7 DW_TAG_base_type267 .long .Linfo_string5 # DW_AT_name268 .byte 5 # DW_AT_encoding269 .byte 4 # DW_AT_byte_size270 .byte 6 # Abbrev [6] 0x8b:0x5 DW_TAG_pointer_type271 .long 144 # DW_AT_type272 .byte 6 # Abbrev [6] 0x90:0x5 DW_TAG_pointer_type273 .long 149 # DW_AT_type274 .byte 7 # Abbrev [7] 0x95:0x5 DW_TAG_const_type275 .long 154 # DW_AT_type276 .byte 5 # Abbrev [5] 0x9a:0x7 DW_TAG_base_type277 .long .Linfo_string10 # DW_AT_name278 .byte 6 # DW_AT_encoding279 .byte 1 # DW_AT_byte_size280 .byte 0 # End Of Children Mark281.Ldebug_info_end0:282 .section .debug_ranges,"",@progbits283.Ldebug_ranges0:284 .quad _Z7doStuffi.__part.1285 .quad .LBB_END0_1286 .quad _Z7doStuffi.__part.2287 .quad .LBB_END0_2288 .quad .Lfunc_begin0289 .quad .Lfunc_end0290 .quad 0291 .quad 0292.Ldebug_ranges1:293 .quad _Z7doStuffi.__part.1294 .quad .LBB_END0_1295 .quad _Z7doStuffi.__part.2296 .quad .LBB_END0_2297 .quad .Lfunc_begin0298 .quad .Lfunc_end0299 .quad .Lfunc_begin1300 .quad .Lfunc_end1301 .quad 0302 .quad 0303 .section .debug_str,"MS",@progbits,1304.Linfo_string0:305 .asciz "clang version 17.0.0 (https://github.com/llvm/llvm-project.git 640e07c49037cca41a1bfbeb916b569d8c950aea)" # string offset=0306.Linfo_string1:307 .asciz "main.cpp" # string offset=105308.Linfo_string2:309 .asciz "/subprogramRanges" # string offset=114310.Linfo_string3:311 .asciz "_Z7doStuffi" # string offset=169312.Linfo_string4:313 .asciz "doStuff" # string offset=181314.Linfo_string5:315 .asciz "int" # string offset=189316.Linfo_string6:317 .asciz "main" # string offset=193318.Linfo_string7:319 .asciz "val" # string offset=198320.Linfo_string8:321 .asciz "argc" # string offset=202322.Linfo_string9:323 .asciz "argv" # string offset=207324.Linfo_string10:325 .asciz "char" # string offset=212326 .ident "clang version 17.0.0 (https://github.com/llvm/llvm-project.git 640e07c49037cca41a1bfbeb916b569d8c950aea)"327 .section ".note.GNU-stack","",@progbits328 .addrsig329 .addrsig_sym _Z7doStuffi330 .section .debug_line,"",@progbits331.Lline_table_start0:332