1# clang++ -g2 -fdebug-types-section -gdwarf-4 -ffunction-sections 2# struct Foo { 3# int i; 4# }; 5# Foo f2; 6 7 .text 8 .file "main.cpp" 9 .section .text._Z3fooi,"ax",@progbits 10 .globl _Z3fooi # -- Begin function _Z3fooi 11 .p2align 4, 0x90 12 .type _Z3fooi,@function 13_Z3fooi: # @_Z3fooi 14.Lfunc_begin0: 15 .file 1 "/test" "main.cpp" 16 .loc 1 1 0 # main.cpp:1:0 17 .cfi_startproc 18# %bb.0: # %entry 19 pushq %rbp 20 .cfi_def_cfa_offset 16 21 .cfi_offset %rbp, -16 22 movq %rsp, %rbp 23 .cfi_def_cfa_register %rbp 24 movl %edi, -8(%rbp) 25.Ltmp0: 26 .loc 1 2 9 prologue_end # main.cpp:2:9 27 cmpl $1, -8(%rbp) 28.Ltmp1: 29 .loc 1 2 7 is_stmt 0 # main.cpp:2:7 30 jne .LBB0_2 31# %bb.1: # %if.then 32.Ltmp2: 33 .loc 1 3 5 is_stmt 1 # main.cpp:3:5 34 movl $2, -4(%rbp) 35 jmp .LBB0_3 36.Ltmp3: 37.LBB0_2: # %if.end 38 .loc 1 4 3 # main.cpp:4:3 39 movl $1, -4(%rbp) 40.LBB0_3: # %return 41 .loc 1 5 1 # main.cpp:5:1 42 movl -4(%rbp), %eax 43 .loc 1 5 1 epilogue_begin is_stmt 0 # main.cpp:5:1 44 popq %rbp 45 .cfi_def_cfa %rsp, 8 46 retq 47.Ltmp4: 48.Lfunc_end0: 49 .size _Z3fooi, .Lfunc_end0-_Z3fooi 50 .cfi_endproc 51 # -- End function 52 .section .text.main,"ax",@progbits 53 .globl main # -- Begin function main 54 .p2align 4, 0x90 55 .type main,@function 56main: # @main 57.Lfunc_begin1: 58 .loc 1 6 0 is_stmt 1 # main.cpp:6:0 59 .cfi_startproc 60# %bb.0: # %entry 61 pushq %rbp 62 .cfi_def_cfa_offset 16 63 .cfi_offset %rbp, -16 64 movq %rsp, %rbp 65 .cfi_def_cfa_register %rbp 66 subq $32, %rsp 67 movl $0, -4(%rbp) 68 movl %edi, -8(%rbp) 69 movq %rsi, -16(%rbp) 70.Ltmp5: 71 .loc 1 7 11 prologue_end # main.cpp:7:11 72 movl -8(%rbp), %eax 73 .loc 1 7 7 is_stmt 0 # main.cpp:7:7 74 movl %eax, -20(%rbp) 75.Ltmp6: 76 .loc 1 8 9 is_stmt 1 # main.cpp:8:9 77 cmpl $3, -20(%rbp) 78.Ltmp7: 79 .loc 1 8 7 is_stmt 0 # main.cpp:8:7 80 jne .LBB1_2 81# %bb.1: # %if.then 82.Ltmp8: 83 .loc 1 9 13 is_stmt 1 # main.cpp:9:13 84 movl -8(%rbp), %edi 85 .loc 1 9 9 is_stmt 0 # main.cpp:9:9 86 callq _Z3fooi 87 .loc 1 9 6 # main.cpp:9:6 88 addl -20(%rbp), %eax 89 movl %eax, -20(%rbp) 90.Ltmp9: 91.LBB1_2: # %if.end 92 .loc 1 10 10 is_stmt 1 # main.cpp:10:10 93 movl -20(%rbp), %eax 94 .loc 1 10 3 epilogue_begin is_stmt 0 # main.cpp:10:3 95 addq $32, %rsp 96 popq %rbp 97 .cfi_def_cfa %rsp, 8 98 retq 99.Ltmp10: 100.Lfunc_end1: 101 .size main, .Lfunc_end1-main 102 .cfi_endproc 103 # -- End function 104 .section .debug_abbrev,"",@progbits 105 .byte 1 # Abbreviation Code 106 .byte 17 # DW_TAG_compile_unit 107 .byte 1 # DW_CHILDREN_yes 108 .byte 37 # DW_AT_producer 109 .byte 14 # DW_FORM_strp 110 .byte 19 # DW_AT_language 111 .byte 5 # DW_FORM_data2 112 .byte 3 # DW_AT_name 113 .byte 14 # DW_FORM_strp 114 .byte 16 # DW_AT_stmt_list 115 .byte 23 # DW_FORM_sec_offset 116 .byte 27 # DW_AT_comp_dir 117 .byte 14 # DW_FORM_strp 118 .byte 17 # DW_AT_low_pc 119 .byte 1 # DW_FORM_addr 120 .byte 85 # DW_AT_ranges 121 .byte 23 # DW_FORM_sec_offset 122 .byte 0 # EOM(1) 123 .byte 0 # EOM(2) 124 .byte 2 # Abbreviation Code 125 .byte 46 # DW_TAG_subprogram 126 .byte 1 # DW_CHILDREN_yes 127 .byte 17 # DW_AT_low_pc 128 .byte 1 # DW_FORM_addr 129 .byte 18 # DW_AT_high_pc 130 .byte 6 # DW_FORM_data4 131 .byte 64 # DW_AT_frame_base 132 .byte 24 # DW_FORM_exprloc 133 .byte 110 # DW_AT_linkage_name 134 .byte 14 # DW_FORM_strp 135 .byte 3 # DW_AT_name 136 .byte 14 # DW_FORM_strp 137 .byte 58 # DW_AT_decl_file 138 .byte 11 # DW_FORM_data1 139 .byte 59 # DW_AT_decl_line 140 .byte 11 # DW_FORM_data1 141 .byte 73 # DW_AT_type 142 .byte 19 # DW_FORM_ref4 143 .byte 63 # DW_AT_external 144 .byte 25 # DW_FORM_flag_present 145 .byte 0 # EOM(1) 146 .byte 0 # EOM(2) 147 .byte 3 # Abbreviation Code 148 .byte 5 # DW_TAG_formal_parameter 149 .byte 0 # DW_CHILDREN_no 150 .byte 2 # DW_AT_location 151 .byte 24 # DW_FORM_exprloc 152 .byte 3 # DW_AT_name 153 .byte 14 # DW_FORM_strp 154 .byte 58 # DW_AT_decl_file 155 .byte 11 # DW_FORM_data1 156 .byte 59 # DW_AT_decl_line 157 .byte 11 # DW_FORM_data1 158 .byte 73 # DW_AT_type 159 .byte 19 # DW_FORM_ref4 160 .byte 0 # EOM(1) 161 .byte 0 # EOM(2) 162 .byte 4 # Abbreviation Code 163 .byte 46 # DW_TAG_subprogram 164 .byte 1 # DW_CHILDREN_yes 165 .byte 17 # DW_AT_low_pc 166 .byte 1 # DW_FORM_addr 167 .byte 18 # DW_AT_high_pc 168 .byte 6 # DW_FORM_data4 169 .byte 64 # DW_AT_frame_base 170 .byte 24 # DW_FORM_exprloc 171 .byte 3 # DW_AT_name 172 .byte 14 # DW_FORM_strp 173 .byte 58 # DW_AT_decl_file 174 .byte 11 # DW_FORM_data1 175 .byte 59 # DW_AT_decl_line 176 .byte 11 # DW_FORM_data1 177 .byte 73 # DW_AT_type 178 .byte 19 # DW_FORM_ref4 179 .byte 63 # DW_AT_external 180 .byte 25 # DW_FORM_flag_present 181 .byte 0 # EOM(1) 182 .byte 0 # EOM(2) 183 .byte 5 # Abbreviation Code 184 .byte 52 # DW_TAG_variable 185 .byte 0 # DW_CHILDREN_no 186 .byte 2 # DW_AT_location 187 .byte 24 # DW_FORM_exprloc 188 .byte 3 # DW_AT_name 189 .byte 14 # DW_FORM_strp 190 .byte 58 # DW_AT_decl_file 191 .byte 11 # DW_FORM_data1 192 .byte 59 # DW_AT_decl_line 193 .byte 11 # DW_FORM_data1 194 .byte 73 # DW_AT_type 195 .byte 19 # DW_FORM_ref4 196 .byte 0 # EOM(1) 197 .byte 0 # EOM(2) 198 .byte 6 # Abbreviation Code 199 .byte 36 # DW_TAG_base_type 200 .byte 0 # DW_CHILDREN_no 201 .byte 3 # DW_AT_name 202 .byte 14 # DW_FORM_strp 203 .byte 62 # DW_AT_encoding 204 .byte 11 # DW_FORM_data1 205 .byte 11 # DW_AT_byte_size 206 .byte 11 # DW_FORM_data1 207 .byte 0 # EOM(1) 208 .byte 0 # EOM(2) 209 .byte 7 # Abbreviation Code 210 .byte 15 # DW_TAG_pointer_type 211 .byte 0 # DW_CHILDREN_no 212 .byte 73 # DW_AT_type 213 .byte 19 # DW_FORM_ref4 214 .byte 0 # EOM(1) 215 .byte 0 # EOM(2) 216 .byte 0 # EOM(3) 217 .section .debug_info,"",@progbits 218.Lcu_begin0: 219 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit 220.Ldebug_info_start0: 221 .short 4 # DWARF version number 222 .long .debug_abbrev # Offset Into Abbrev. Section 223 .byte 8 # Address Size (in bytes) 224 .byte 1 # Abbrev [1] 0xb:0xa8 DW_TAG_compile_unit 225 .long .Linfo_string0 # DW_AT_producer 226 .short 33 # DW_AT_language 227 .long .Linfo_string1 # DW_AT_name 228 .long .Lline_table_start0 # DW_AT_stmt_list 229 .long .Linfo_string2 # DW_AT_comp_dir 230 .quad 0 # DW_AT_low_pc 231 .long .Ldebug_ranges0 # DW_AT_ranges 232 .byte 2 # Abbrev [2] 0x2a:0x2c DW_TAG_subprogram 233 .quad .Lfunc_begin0 # DW_AT_low_pc 234 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc 235 .byte 1 # DW_AT_frame_base 236 .byte 86 237 .long .Linfo_string3 # DW_AT_linkage_name 238 .long .Linfo_string4 # DW_AT_name 239 .byte 1 # DW_AT_decl_file 240 .byte 1 # DW_AT_decl_line 241 .long 154 # DW_AT_type 242 # DW_AT_external 243 .byte 3 # Abbrev [3] 0x47:0xe DW_TAG_formal_parameter 244 .byte 2 # DW_AT_location 245 .byte 145 246 .byte 120 247 .long .Linfo_string7 # DW_AT_name 248 .byte 1 # DW_AT_decl_file 249 .byte 1 # DW_AT_decl_line 250 .long 154 # DW_AT_type 251 .byte 0 # End Of Children Mark 252 .byte 4 # Abbrev [4] 0x56:0x44 DW_TAG_subprogram 253 .quad .Lfunc_begin1 # DW_AT_low_pc 254 .long .Lfunc_end1-.Lfunc_begin1 # DW_AT_high_pc 255 .byte 1 # DW_AT_frame_base 256 .byte 86 257 .long .Linfo_string6 # DW_AT_name 258 .byte 1 # DW_AT_decl_file 259 .byte 6 # DW_AT_decl_line 260 .long 154 # DW_AT_type 261 # DW_AT_external 262 .byte 3 # Abbrev [3] 0x6f:0xe DW_TAG_formal_parameter 263 .byte 2 # DW_AT_location 264 .byte 145 265 .byte 120 266 .long .Linfo_string8 # DW_AT_name 267 .byte 1 # DW_AT_decl_file 268 .byte 6 # DW_AT_decl_line 269 .long 154 # DW_AT_type 270 .byte 3 # Abbrev [3] 0x7d:0xe DW_TAG_formal_parameter 271 .byte 2 # DW_AT_location 272 .byte 145 273 .byte 112 274 .long .Linfo_string9 # DW_AT_name 275 .byte 1 # DW_AT_decl_file 276 .byte 6 # DW_AT_decl_line 277 .long 161 # DW_AT_type 278 .byte 5 # Abbrev [5] 0x8b:0xe DW_TAG_variable 279 .byte 2 # DW_AT_location 280 .byte 145 281 .byte 108 282 .long .Linfo_string11 # DW_AT_name 283 .byte 1 # DW_AT_decl_file 284 .byte 7 # DW_AT_decl_line 285 .long 154 # DW_AT_type 286 .byte 0 # End Of Children Mark 287 .byte 6 # Abbrev [6] 0x9a:0x7 DW_TAG_base_type 288 .long .Linfo_string5 # DW_AT_name 289 .byte 5 # DW_AT_encoding 290 .byte 4 # DW_AT_byte_size 291 .byte 7 # Abbrev [7] 0xa1:0x5 DW_TAG_pointer_type 292 .long 166 # DW_AT_type 293 .byte 7 # Abbrev [7] 0xa6:0x5 DW_TAG_pointer_type 294 .long 171 # DW_AT_type 295 .byte 6 # Abbrev [6] 0xab:0x7 DW_TAG_base_type 296 .long .Linfo_string10 # DW_AT_name 297 .byte 6 # DW_AT_encoding 298 .byte 1 # DW_AT_byte_size 299 .byte 0 # End Of Children Mark 300.Ldebug_info_end0: 301 .section .debug_ranges,"",@progbits 302.Ldebug_ranges0: 303 .quad .Lfunc_begin0 304 .quad .Lfunc_end0 305 .quad .Lfunc_begin1 306 .quad .Lfunc_end1 307 .quad 0 308 .quad 0 309 .section .debug_str,"MS",@progbits,1 310.Linfo_string0: 311 .asciz "clang version 18.0.0git" # string offset=0 312.Linfo_string1: 313 .asciz "main.cpp" # string offset=24 314.Linfo_string2: 315 .asciz "/test" # string offset=33 316.Linfo_string3: 317 .asciz "_Z3fooi" # string offset=71 318.Linfo_string4: 319 .asciz "foo" # string offset=79 320.Linfo_string5: 321 .asciz "int" # string offset=83 322.Linfo_string6: 323 .asciz "main" # string offset=87 324.Linfo_string7: 325 .asciz "i" # string offset=92 326.Linfo_string8: 327 .asciz "argc" # string offset=94 328.Linfo_string9: 329 .asciz "argv" # string offset=99 330.Linfo_string10: 331 .asciz "char" # string offset=104 332.Linfo_string11: 333 .asciz "j" # string offset=109 334 .ident "clang version 18.0.0git" 335 .section ".note.GNU-stack","",@progbits 336 .addrsig 337 .addrsig_sym _Z3fooi 338 .section .debug_line,"",@progbits 339.Lline_table_start0: 340