|
| 1 | +# Test handling of DWARF5 DW_FORM_line_strp from .debug_info as used by GCC. |
| 2 | + |
| 3 | +# UNSUPPORTED: system-darwin, system-windows |
| 4 | +# REQUIRES: x86 |
| 5 | + |
| 6 | +# RUN: llvm-mc -filetype=obj -o %t -triple x86_64-pc-linux %s |
| 7 | +# RUN: %lldb %t -o "p main" \ |
| 8 | +# RUN: -o exit | FileCheck %s |
| 9 | + |
| 10 | +# CHECK: (void (*)()) $0 = 0x0000000000000000 |
| 11 | + |
| 12 | + .text |
| 13 | +.Ltext0: |
| 14 | + .globl main |
| 15 | + .type main, @function |
| 16 | +main: |
| 17 | +.LFB0: |
| 18 | +.LM1: |
| 19 | + .long 0 |
| 20 | +.LM2: |
| 21 | + .long 0 |
| 22 | +.LFE0: |
| 23 | + .size main, .-main |
| 24 | +.Letext0: |
| 25 | + .section .debug_info,"",@progbits |
| 26 | +.Ldebug_info0: |
| 27 | + .long .Ldebug_info0_end - .Ldebug_info0_start # Length of Compilation Unit Info |
| 28 | +.Ldebug_info0_start: |
| 29 | + .value 0x5 # DWARF version number |
| 30 | + .byte 0x1 # DW_UT_compile |
| 31 | + .byte 0x8 # Pointer Size (in bytes) |
| 32 | + .long .Ldebug_abbrev0 # Offset Into Abbrev. Section |
| 33 | + .uleb128 0x1 # (DIE (0xc) DW_TAG_compile_unit) |
| 34 | + .long .LASF2 # DW_AT_producer: "GNU C17 11.0.0 20210210 (Red Hat 11.0.0-0) -mtune=generic -march=x86-64 -gdwarf-5 -gno-as-loc-support" |
| 35 | + .byte 0x1d # DW_AT_language |
| 36 | + .long .LASF0 # DW_AT_name: "main.c" |
| 37 | + .long .LASF1 # DW_AT_comp_dir: "" |
| 38 | + .quad .Ltext0 # DW_AT_low_pc |
| 39 | + .quad .Letext0-.Ltext0 # DW_AT_high_pc |
| 40 | + .long .Ldebug_line0 # DW_AT_stmt_list |
| 41 | + .uleb128 0x2 # (DIE (0x2e) DW_TAG_subprogram) |
| 42 | + # DW_AT_external |
| 43 | + .long .LASF3 # DW_AT_name: "main" |
| 44 | + .byte 0x1 # DW_AT_decl_file (main.c) |
| 45 | + .byte 0x1 # DW_AT_decl_line |
| 46 | + .quad .LFB0 # DW_AT_low_pc |
| 47 | + .quad .LFE0-.LFB0 # DW_AT_high_pc |
| 48 | + .byte 0 # end of children of DIE 0xc |
| 49 | +.Ldebug_info0_end: |
| 50 | + .section .debug_abbrev,"",@progbits |
| 51 | +.Ldebug_abbrev0: |
| 52 | + .uleb128 0x1 # (abbrev code) |
| 53 | + .uleb128 0x11 # (TAG: DW_TAG_compile_unit) |
| 54 | + .byte 0x1 # DW_children_yes |
| 55 | + .uleb128 0x25 # (DW_AT_producer) |
| 56 | + .uleb128 0xe # (DW_FORM_strp) |
| 57 | + .uleb128 0x13 # (DW_AT_language) |
| 58 | + .uleb128 0xb # (DW_FORM_data1) |
| 59 | + .uleb128 0x3 # (DW_AT_name) |
| 60 | + .uleb128 0x1f # (DW_FORM_line_strp) |
| 61 | + .uleb128 0x1b # (DW_AT_comp_dir) |
| 62 | + .uleb128 0x1f # (DW_FORM_line_strp) |
| 63 | + .uleb128 0x11 # (DW_AT_low_pc) |
| 64 | + .uleb128 0x1 # (DW_FORM_addr) |
| 65 | + .uleb128 0x12 # (DW_AT_high_pc) |
| 66 | + .uleb128 0x7 # (DW_FORM_data8) |
| 67 | + .uleb128 0x10 # (DW_AT_stmt_list) |
| 68 | + .uleb128 0x17 # (DW_FORM_sec_offset) |
| 69 | + .byte 0 |
| 70 | + .byte 0 |
| 71 | + .uleb128 0x2 # (abbrev code) |
| 72 | + .uleb128 0x2e # (TAG: DW_TAG_subprogram) |
| 73 | + .byte 0 # DW_children_no |
| 74 | + .uleb128 0x3f # (DW_AT_external) |
| 75 | + .uleb128 0x19 # (DW_FORM_flag_present) |
| 76 | + .uleb128 0x3 # (DW_AT_name) |
| 77 | + .uleb128 0xe # (DW_FORM_strp) |
| 78 | + .uleb128 0x3a # (DW_AT_decl_file) |
| 79 | + .uleb128 0xb # (DW_FORM_data1) |
| 80 | + .uleb128 0x3b # (DW_AT_decl_line) |
| 81 | + .uleb128 0xb # (DW_FORM_data1) |
| 82 | + .uleb128 0x11 # (DW_AT_low_pc) |
| 83 | + .uleb128 0x1 # (DW_FORM_addr) |
| 84 | + .uleb128 0x12 # (DW_AT_high_pc) |
| 85 | + .uleb128 0x7 # (DW_FORM_data8) |
| 86 | + .byte 0 |
| 87 | + .byte 0 |
| 88 | + .uleb128 0x3 # (abbrev code) |
| 89 | + .uleb128 0x24 # (TAG: DW_TAG_base_type) |
| 90 | + .byte 0 # DW_children_no |
| 91 | + .uleb128 0xb # (DW_AT_byte_size) |
| 92 | + .uleb128 0xb # (DW_FORM_data1) |
| 93 | + .uleb128 0x3e # (DW_AT_encoding) |
| 94 | + .uleb128 0xb # (DW_FORM_data1) |
| 95 | + .uleb128 0x3 # (DW_AT_name) |
| 96 | + .uleb128 0x8 # (DW_FORM_string) |
| 97 | + .byte 0 |
| 98 | + .byte 0 |
| 99 | + .byte 0 |
| 100 | + .section .debug_line,"",@progbits |
| 101 | +.Ldebug_line0: |
| 102 | + .long .LELT0-.LSLT0 # Length of Source Line Info |
| 103 | +.LSLT0: |
| 104 | + .value 0x5 # DWARF version number |
| 105 | + .byte 0x8 # Address Size |
| 106 | + .byte 0 # Segment Size |
| 107 | + .long .LELTP0-.LASLTP0 # Prolog Length |
| 108 | +.LASLTP0: |
| 109 | + .byte 0x1 # Minimum Instruction Length |
| 110 | + .byte 0x1 # Maximum Operations Per Instruction |
| 111 | + .byte 0x1 # Default is_stmt_start flag |
| 112 | + .byte 0xf6 # Line Base Value (Special Opcodes) |
| 113 | + .byte 0xf2 # Line Range Value (Special Opcodes) |
| 114 | + .byte 0xd # Special Opcode Base |
| 115 | + .byte 0 # opcode: 0x1 has 0 args |
| 116 | + .byte 0x1 # opcode: 0x2 has 1 args |
| 117 | + .byte 0x1 # opcode: 0x3 has 1 args |
| 118 | + .byte 0x1 # opcode: 0x4 has 1 args |
| 119 | + .byte 0x1 # opcode: 0x5 has 1 args |
| 120 | + .byte 0 # opcode: 0x6 has 0 args |
| 121 | + .byte 0 # opcode: 0x7 has 0 args |
| 122 | + .byte 0 # opcode: 0x8 has 0 args |
| 123 | + .byte 0x1 # opcode: 0x9 has 1 args |
| 124 | + .byte 0 # opcode: 0xa has 0 args |
| 125 | + .byte 0 # opcode: 0xb has 0 args |
| 126 | + .byte 0x1 # opcode: 0xc has 1 args |
| 127 | + .byte 0x1 # Directory entry format count |
| 128 | + .uleb128 0x1 # DW_LNCT_path |
| 129 | + .uleb128 0x1f # DW_FORM_line_strp |
| 130 | + .uleb128 0x2 # Directories count |
| 131 | + .long .LASF1 # Directory Entry: 0: "" |
| 132 | + .long .LASF4 # Directory Entry: 0: "" |
| 133 | + .byte 0x2 # File name entry format count |
| 134 | + .uleb128 0x1 # DW_LNCT_path |
| 135 | + .uleb128 0x1f # DW_FORM_line_strp |
| 136 | + .uleb128 0x2 # DW_LNCT_directory_index |
| 137 | + .uleb128 0xb # DW_FORM_data1 |
| 138 | + .uleb128 0x2 # File names count |
| 139 | + .long .LASF0 # File Entry: 0: "main.c" |
| 140 | + .byte 0 |
| 141 | + .long .LASF5 # File Entry: 0: "main.c" |
| 142 | + .byte 0x1 |
| 143 | +.LELTP0: |
| 144 | + .byte 0 # set address *.LM1 |
| 145 | + .uleb128 0x9 |
| 146 | + .byte 0x2 |
| 147 | + .quad .LM1 |
| 148 | + .byte 0x1 # copy line 1 |
| 149 | + .byte 0x5 # column 12 |
| 150 | + .uleb128 0xc # 12 |
| 151 | + .byte 0 # set address *.LM2 |
| 152 | + .uleb128 0x9 |
| 153 | + .byte 0x2 |
| 154 | + .quad .LM2 |
| 155 | + .byte 0x1 # copy line 1 |
| 156 | + .byte 0x5 # column 13 |
| 157 | + .uleb128 0xd # 13 |
| 158 | + .byte 0 # set address *.Letext0 |
| 159 | + .uleb128 0x9 |
| 160 | + .byte 0x2 |
| 161 | + .quad .Letext0 |
| 162 | + .byte 0 # end sequence |
| 163 | + .uleb128 0x1 |
| 164 | + .byte 0x1 |
| 165 | +.LELT0: |
| 166 | + .section .debug_str,"MS",@progbits,1 |
| 167 | +.LASF2: |
| 168 | + .string "GNU C17 11.0.0 20210210 (Red Hat 11.0.0-0) -mtune=generic -march=x86-64 -gdwarf-5 -gno-as-loc-support" |
| 169 | +.LASF3: |
| 170 | + .string "main" |
| 171 | + .section .debug_line_str,"MS",@progbits,1 |
| 172 | +.LASF1: |
| 173 | + .string "" |
| 174 | +.LASF4: |
| 175 | + .string "" |
| 176 | +.LASF0: |
| 177 | + .string "main.c" |
| 178 | +.LASF5: |
| 179 | + .string "main.c" |
| 180 | + .ident "GCC: (GNU) 11.0.0 20210210 (Red Hat 11.0.0-0)" |
| 181 | + .section .note.GNU-stack,"",@progbits |
0 commit comments