134 lines · plain
1# RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj %s > %t2# RUN: not llvm-dwarfdump %t 2> %t.err | FileCheck %s3# RUN: FileCheck %s < %t.err -check-prefix=ERR4 5# CHECK: DW_AT_name ("x0")6# CHECK-NEXT: DW_AT_location (0x0000000c7# CHECK-NEXT: [0x0000000000000000, 0x0000000000000002): DW_OP_reg5 RDI8# CHECK-NEXT: [0x0000000000000002, 0x0000000000000003): DW_OP_reg0 RAX)9 10# CHECK: DW_AT_name ("x1")11# CHECK-NEXT: DW_AT_location (0xdeadbeef: )12# ERR: error: offset 0xdeadbeef is beyond the end of data at 0x3413 14# CHECK: DW_AT_name ("x2")15# CHECK-NEXT: DW_AT_location (0x0000002516# ERR: error: unexpected end of data at offset 0x34 while reading [0x34, 0xdeadbf23)17 18 19 .type f,@function20f: # @f21.Lfunc_begin0:22 movl %edi, %eax23.Ltmp0:24 retq25.Ltmp1:26.Lfunc_end0:27 .size f, .Lfunc_end0-f28 29 .section .debug_str,"MS",@progbits,130.Linfo_string0:31 .asciz "Hand-written DWARF"32.Linfo_string3:33 .asciz "f"34.Linfo_string4:35 .asciz "int"36.Lx0:37 .asciz "x0"38.Lx1:39 .asciz "x1"40.Lx2:41 .asciz "x2"42 43 .section .debug_loclists,"",@progbits44 .long .Ldebug_loclist_table_end0-.Ldebug_loclist_table_start0 # Length45.Ldebug_loclist_table_start0:46 .short 5 # Version47 .byte 8 # Address size48 .byte 0 # Segment selector size49 .long 0 # Offset entry count50.Lloclists_table_base0:51.Ldebug_loc0:52 .byte 8 # DW_LLE_start_length53 .quad .Lfunc_begin0-.Lfunc_begin0 # starting offset54 .uleb128 .Ltmp0-.Lfunc_begin0 # size55 .byte 1 # Loc expr size56 .byte 85 # super-register DW_OP_reg557 .byte 8 # DW_LLE_start_length58 .quad .Ltmp0-.Lfunc_begin0 # starting offset59 .uleb128 .Lfunc_end0-.Ltmp0 # size60 .byte 1 # Loc expr size61 .byte 80 # super-register DW_OP_reg062 .byte 0 # DW_LLE_end_of_list63.Ldebug_loc2:64 .byte 8 # DW_LLE_start_length65 .quad .Lfunc_begin0-.Lfunc_begin0 # starting offset66 .uleb128 .Ltmp0-.Lfunc_begin0 # size67 .uleb128 0xdeadbeef # Loc expr size68.Ldebug_loclist_table_end0:69 70 .section .debug_abbrev,"",@progbits71 .byte 1 # Abbreviation Code72 .byte 17 # DW_TAG_compile_unit73 .byte 1 # DW_CHILDREN_yes74 .byte 37 # DW_AT_producer75 .byte 14 # DW_FORM_strp76 .byte 19 # DW_AT_language77 .byte 5 # DW_FORM_data278 .byte 0 # EOM(1)79 .byte 0 # EOM(2)80 .byte 2 # Abbreviation Code81 .byte 46 # DW_TAG_subprogram82 .byte 1 # DW_CHILDREN_yes83 .byte 3 # DW_AT_name84 .byte 14 # DW_FORM_strp85 .byte 0 # EOM(1)86 .byte 0 # EOM(2)87 .byte 3 # Abbreviation Code88 .byte 5 # DW_TAG_formal_parameter89 .byte 0 # DW_CHILDREN_no90 .byte 3 # DW_AT_name91 .byte 14 # DW_FORM_strp92 .byte 2 # DW_AT_location93 .byte 23 # DW_FORM_sec_offset94 .byte 0 # EOM(1)95 .byte 0 # EOM(2)96 .byte 4 # Abbreviation Code97 .byte 36 # DW_TAG_base_type98 .byte 0 # DW_CHILDREN_no99 .byte 3 # DW_AT_name100 .byte 14 # DW_FORM_strp101 .byte 62 # DW_AT_encoding102 .byte 11 # DW_FORM_data1103 .byte 11 # DW_AT_byte_size104 .byte 11 # DW_FORM_data1105 .byte 0 # EOM(1)106 .byte 0 # EOM(2)107 .byte 0 # EOM(3)108 109 .section .debug_info,"",@progbits110.Lcu_begin0:111 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit112.Ldebug_info_start0:113 .short 5 # DWARF version number114 .byte 1 # DWARF Unit Type115 .byte 8 # Address Size (in bytes)116 .long .debug_abbrev # Offset Into Abbrev. Section117 .byte 1 # Abbrev [1] 0xb:0x50 DW_TAG_compile_unit118 .long .Linfo_string0 # DW_AT_producer119 .short 12 # DW_AT_language120 .byte 2 # Abbrev [2] 0x2a:0x29 DW_TAG_subprogram121 .long .Linfo_string3 # DW_AT_name122 .byte 3 # Abbrev [3] DW_TAG_formal_parameter123 .long .Lx0 # DW_AT_name124 .long .Ldebug_loc0 # DW_AT_location125 .byte 3 # Abbrev [3] DW_TAG_formal_parameter126 .long .Lx1 # DW_AT_name127 .long 0xdeadbeef # DW_AT_location128 .byte 3 # Abbrev [3] DW_TAG_formal_parameter129 .long .Lx2 # DW_AT_name130 .long .Ldebug_loc2 # DW_AT_location131 .byte 0 # End Of Children Mark132 .byte 0 # End Of Children Mark133.Ldebug_info_end0:134