358 lines · plain
1# clang++ -ffunction-sections -g2 -gdwarf-52# Manually modified to use ranges like what generates sometimes -fbasic-block-sections=all3# int doStuff(int val) {4# if (val)5# ++val;6# return val;7# }8#9# int main(int argc, const char** argv) {10# return doStuff(argc);11# }12 .text13 .file "main.cpp"14 .section .text._Z7doStuffi,"ax",@progbits15 .globl _Z7doStuffi # -- Begin function _Z7doStuffi16 .p2align 4, 0x9017 .type _Z7doStuffi,@function18_Z7doStuffi: # @_Z7doStuffi19.Lfunc_begin0:20 .file 0 "/subprogramRanges" "main.cpp" md5 0x45fd34ef778739dca24be206894f1d1521 .loc 0 1 0 # main.cpp:1:022 .cfi_startproc23# %bb.0: # %entry24 pushq %rbp25 .cfi_def_cfa_offset 1626 .cfi_offset %rbp, -1627 movq %rsp, %rbp28 .cfi_def_cfa_register %rbp29 movl %edi, -4(%rbp)30.Ltmp0:31 .loc 0 2 7 prologue_end # main.cpp:2:732 cmpl $0, -4(%rbp)33.Ltmp1:34 .loc 0 2 7 is_stmt 0 # main.cpp:2:735 je .LBB0_236# %bb.1: # %if.then37.Ltmp2:38 .loc 0 3 5 is_stmt 1 # main.cpp:3:539 movl -4(%rbp), %eax40 addl $1, %eax41 movl %eax, -4(%rbp)42.Ltmp3:43.LBB0_2: # %if.end44 .loc 0 4 10 # main.cpp:4:1045 movl -4(%rbp), %eax46 .loc 0 4 3 epilogue_begin is_stmt 0 # main.cpp:4:347 popq %rbp48 .cfi_def_cfa %rsp, 849 retq50.Ltmp4:51.Lfunc_end0:52 .size _Z7doStuffi, .Lfunc_end0-_Z7doStuffi53 .cfi_endproc54 # -- End function55 .section .text.main,"ax",@progbits56 .globl main # -- Begin function main57 .p2align 4, 0x9058 .type main,@function59main: # @main60.Lfunc_begin1:61 .loc 0 7 0 is_stmt 1 # main.cpp:7:062 .cfi_startproc63# %bb.0: # %entry64 pushq %rbp65 .cfi_def_cfa_offset 1666 .cfi_offset %rbp, -1667 movq %rsp, %rbp68 .cfi_def_cfa_register %rbp69 subq $16, %rsp70 movl $0, -4(%rbp)71 movl %edi, -8(%rbp)72 movq %rsi, -16(%rbp)73.Ltmp5:74 .loc 0 8 21 prologue_end # main.cpp:8:2175 movl -8(%rbp), %edi76 .loc 0 8 13 is_stmt 0 # main.cpp:8:1377 callq _Z7doStuffi78 .loc 0 8 5 epilogue_begin # main.cpp:8:579 addq $16, %rsp80 popq %rbp81 .cfi_def_cfa %rsp, 882 retq83.Ltmp6:84.Lfunc_end1:85 .size main, .Lfunc_end1-main86 .cfi_endproc87 # -- End function88 .section .debug_abbrev,"",@progbits89 .byte 1 # Abbreviation Code90 .byte 17 # DW_TAG_compile_unit91 .byte 1 # DW_CHILDREN_yes92 .byte 37 # DW_AT_producer93 .byte 37 # DW_FORM_strx194 .byte 19 # DW_AT_language95 .byte 5 # DW_FORM_data296 .byte 3 # DW_AT_name97 .byte 37 # DW_FORM_strx198 .byte 114 # DW_AT_str_offsets_base99 .byte 23 # DW_FORM_sec_offset100 .byte 16 # DW_AT_stmt_list101 .byte 23 # DW_FORM_sec_offset102 .byte 27 # DW_AT_comp_dir103 .byte 37 # DW_FORM_strx1104 .byte 17 # DW_AT_low_pc105 .byte 1 # DW_FORM_addr106 .byte 85 # DW_AT_ranges107 .byte 35 # DW_FORM_rnglistx108 .byte 115 # DW_AT_addr_base109 .byte 23 # DW_FORM_sec_offset110 .byte 116 # DW_AT_rnglists_base111 .byte 23 # DW_FORM_sec_offset112 .byte 0 # EOM(1)113 .byte 0 # EOM(2)114 .byte 2 # Abbreviation Code115 .byte 46 # DW_TAG_subprogram116 .byte 1 # DW_CHILDREN_yes117 .byte 85 # DW_AT_ranges118 .byte 35 # DW_FORM_rnglistx119 .byte 64 # DW_AT_frame_base120 .byte 24 # DW_FORM_exprloc121 .byte 110 # DW_AT_linkage_name122 .byte 37 # DW_FORM_strx1123 .byte 3 # DW_AT_name124 .byte 37 # DW_FORM_strx1125 .byte 58 # DW_AT_decl_file126 .byte 11 # DW_FORM_data1127 .byte 59 # DW_AT_decl_line128 .byte 11 # DW_FORM_data1129 .byte 73 # DW_AT_type130 .byte 19 # DW_FORM_ref4131 .byte 63 # DW_AT_external132 .byte 25 # DW_FORM_flag_present133 .byte 0 # EOM(1)134 .byte 0 # EOM(2)135 .byte 3 # Abbreviation Code136 .byte 5 # DW_TAG_formal_parameter137 .byte 0 # DW_CHILDREN_no138 .byte 2 # DW_AT_location139 .byte 24 # DW_FORM_exprloc140 .byte 3 # DW_AT_name141 .byte 37 # DW_FORM_strx1142 .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 0 # EOM(1)149 .byte 0 # EOM(2)150 .byte 4 # Abbreviation Code151 .byte 46 # DW_TAG_subprogram152 .byte 1 # DW_CHILDREN_yes153 .byte 17 # DW_AT_low_pc154 .byte 27 # DW_FORM_addrx155 .byte 18 # DW_AT_high_pc156 .byte 6 # DW_FORM_data4157 .byte 64 # DW_AT_frame_base158 .byte 24 # DW_FORM_exprloc159 .byte 3 # DW_AT_name160 .byte 37 # DW_FORM_strx1161 .byte 58 # DW_AT_decl_file162 .byte 11 # DW_FORM_data1163 .byte 59 # DW_AT_decl_line164 .byte 11 # DW_FORM_data1165 .byte 73 # DW_AT_type166 .byte 19 # DW_FORM_ref4167 .byte 63 # DW_AT_external168 .byte 25 # DW_FORM_flag_present169 .byte 0 # EOM(1)170 .byte 0 # EOM(2)171 .byte 5 # Abbreviation Code172 .byte 36 # DW_TAG_base_type173 .byte 0 # DW_CHILDREN_no174 .byte 3 # DW_AT_name175 .byte 37 # DW_FORM_strx1176 .byte 62 # DW_AT_encoding177 .byte 11 # DW_FORM_data1178 .byte 11 # DW_AT_byte_size179 .byte 11 # DW_FORM_data1180 .byte 0 # EOM(1)181 .byte 0 # EOM(2)182 .byte 6 # Abbreviation Code183 .byte 15 # DW_TAG_pointer_type184 .byte 0 # DW_CHILDREN_no185 .byte 73 # DW_AT_type186 .byte 19 # DW_FORM_ref4187 .byte 0 # EOM(1)188 .byte 0 # EOM(2)189 .byte 7 # Abbreviation Code190 .byte 38 # DW_TAG_const_type191 .byte 0 # DW_CHILDREN_no192 .byte 73 # DW_AT_type193 .byte 19 # DW_FORM_ref4194 .byte 0 # EOM(1)195 .byte 0 # EOM(2)196 .byte 0 # EOM(3)197 .section .debug_info,"",@progbits198.Lcu_begin0:199 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit200.Ldebug_info_start0:201 .short 5 # DWARF version number202 .byte 1 # DWARF Unit Type203 .byte 8 # Address Size (in bytes)204 .long .debug_abbrev # Offset Into Abbrev. Section205 .byte 1 # Abbrev [1] 0xc:0x79 DW_TAG_compile_unit206 .byte 0 # DW_AT_producer207 .short 33 # DW_AT_language208 .byte 1 # DW_AT_name209 .long .Lstr_offsets_base0 # DW_AT_str_offsets_base210 .long .Lline_table_start0 # DW_AT_stmt_list211 .byte 2 # DW_AT_comp_dir212 .quad 0 # DW_AT_low_pc213 .byte 0 # DW_AT_ranges214 .long .Laddr_table_base0 # DW_AT_addr_base215 .long .Lrnglists_table_base0 # DW_AT_rnglists_base216 .byte 2 # Abbrev [2] 0x2b:0x1c DW_TAG_subprogram217 .byte 1 # DW_AT_ranges218 .byte 1 # DW_AT_frame_base219 .byte 86220 .byte 3 # DW_AT_linkage_name221 .byte 4 # DW_AT_name222 .byte 0 # DW_AT_decl_file223 .byte 1 # DW_AT_decl_line224 .long 109 # DW_AT_type225 # DW_AT_external226 .byte 3 # Abbrev [3] 0x3b:0xb DW_TAG_formal_parameter227 .byte 2 # DW_AT_location228 .byte 145229 .byte 124230 .byte 7 # DW_AT_name231 .byte 0 # DW_AT_decl_file232 .byte 1 # DW_AT_decl_line233 .long 109 # DW_AT_type234 .byte 0 # End Of Children Mark235 .byte 4 # Abbrev [4] 0x47:0x26 DW_TAG_subprogram236 .byte 1 # DW_AT_low_pc237 .long .Lfunc_end1-.Lfunc_begin1 # DW_AT_high_pc238 .byte 1 # DW_AT_frame_base239 .byte 86240 .byte 6 # DW_AT_name241 .byte 0 # DW_AT_decl_file242 .byte 7 # DW_AT_decl_line243 .long 109 # DW_AT_type244 # DW_AT_external245 .byte 3 # Abbrev [3] 0x56:0xb DW_TAG_formal_parameter246 .byte 2 # DW_AT_location247 .byte 145248 .byte 120249 .byte 8 # DW_AT_name250 .byte 0 # DW_AT_decl_file251 .byte 7 # DW_AT_decl_line252 .long 109 # DW_AT_type253 .byte 3 # Abbrev [3] 0x61:0xb DW_TAG_formal_parameter254 .byte 2 # DW_AT_location255 .byte 145256 .byte 112257 .byte 9 # DW_AT_name258 .byte 0 # DW_AT_decl_file259 .byte 7 # DW_AT_decl_line260 .long 105 # DW_AT_type261 .byte 0 # End Of Children Mark262 .byte 5 # Abbrev [5] 0x6d:0x4 DW_TAG_base_type263 .byte 5 # DW_AT_name264 .byte 5 # DW_AT_encoding265 .byte 4 # DW_AT_byte_size266 .byte 6 # Abbrev [6] 0x71:0x5 DW_TAG_pointer_type267 .long 114 # DW_AT_type268 .byte 6 # Abbrev [6] 0x76:0x5 DW_TAG_pointer_type269 .long 119 # DW_AT_type270 .byte 7 # Abbrev [7] 0x7b:0x5 DW_TAG_const_type271 .long 124 # DW_AT_type272 .byte 5 # Abbrev [5] 0x80:0x4 DW_TAG_base_type273 .byte 10 # DW_AT_name274 .byte 6 # DW_AT_encoding275 .byte 1 # DW_AT_byte_size276 .byte 0 # End Of Children Mark277.Ldebug_info_end0:278 .section .debug_rnglists,"",@progbits279 .long .Ldebug_list_header_end0-.Ldebug_list_header_start0 # Length280.Ldebug_list_header_start0:281 .short 5 # Version282 .byte 8 # Address size283 .byte 0 # Segment selector size284 .long 1 # Offset entry count285.Lrnglists_table_base0:286 .long .Ldebug_ranges0-.Lrnglists_table_base0287 .long .Ldebug_ranges1-.Lrnglists_table_base0288.Ldebug_ranges0:289 .byte 3 # DW_RLE_startx_length290 .byte 0 # start index291 .uleb128 .Lfunc_end0-.Lfunc_begin0 # length292 .byte 3 # DW_RLE_startx_length293 .byte 1 # start index294 .uleb128 .Lfunc_end1-.Lfunc_begin1 # length295 .byte 0 # DW_RLE_end_of_list296.Ldebug_ranges1:297 .byte 3 # DW_RLE_startx_length298 .byte 0 # start index299 .uleb128 .Lfunc_end0-.Lfunc_begin0 # length300 .byte 0 # DW_RLE_end_of_list301.Ldebug_list_header_end0:302 .section .debug_str_offsets,"",@progbits303 .long 48 # Length of String Offsets Set304 .short 5305 .short 0306.Lstr_offsets_base0:307 .section .debug_str,"MS",@progbits,1308.Linfo_string0:309 .asciz "clang version 17.0.0 (https://github.com/llvm/llvm-project.git 640e07c49037cca41a1bfbeb916b569d8c950aea)" # string offset=0310.Linfo_string1:311 .asciz "main.cpp" # string offset=105312.Linfo_string2:313 .asciz "/subprogramRanges" # string offset=114314.Linfo_string3:315 .asciz "_Z7doStuffi" # string offset=169316.Linfo_string4:317 .asciz "doStuff" # string offset=181318.Linfo_string5:319 .asciz "int" # string offset=189320.Linfo_string6:321 .asciz "main" # string offset=193322.Linfo_string7:323 .asciz "val" # string offset=198324.Linfo_string8:325 .asciz "argc" # string offset=202326.Linfo_string9:327 .asciz "argv" # string offset=207328.Linfo_string10:329 .asciz "char" # string offset=212330 .section .debug_str_offsets,"",@progbits331 .long .Linfo_string0332 .long .Linfo_string1333 .long .Linfo_string2334 .long .Linfo_string3335 .long .Linfo_string4336 .long .Linfo_string5337 .long .Linfo_string6338 .long .Linfo_string7339 .long .Linfo_string8340 .long .Linfo_string9341 .long .Linfo_string10342 .section .debug_addr,"",@progbits343 .long .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution344.Ldebug_addr_start0:345 .short 5 # DWARF version number346 .byte 8 # Address size347 .byte 0 # Segment selector size348.Laddr_table_base0:349 .quad .Lfunc_begin0350 .quad .Lfunc_begin1351.Ldebug_addr_end0:352 .ident "clang version 17.0.0 (https://github.com/llvm/llvm-project.git 640e07c49037cca41a1bfbeb916b569d8c950aea)"353 .section ".note.GNU-stack","",@progbits354 .addrsig355 .addrsig_sym _Z7doStuffi356 .section .debug_line,"",@progbits357.Lline_table_start0:358