170 lines · plain
1# Test handling of DWARF5 DW_FORM_line_strp from .debug_info as used by GCC.2 3# UNSUPPORTED: system-darwin, system-windows4 5# RUN: llvm-mc -filetype=obj -o %t -triple x86_64-pc-linux %s6# RUN: %lldb %t -o "expression main" \7# RUN: -o exit | FileCheck %s8 9# CHECK: (void (*)()) $0 = 0x000000000000000010 11 .text12.Ltext0:13 .globl main14 .type main, @function15main:16.LFB0:17.LM1:18 .long 019.LM2:20 .long 021.LFE0:22 .size main, .-main23.Letext0:24 .section .debug_info,"",@progbits25.Ldebug_info0:26 .long .Ldebug_info0_end - .Ldebug_info0_start # Length of Compilation Unit Info27.Ldebug_info0_start:28 .value 0x5 # DWARF version number29 .byte 0x1 # DW_UT_compile30 .byte 0x8 # Pointer Size (in bytes)31 .long .Ldebug_abbrev0 # Offset Into Abbrev. Section32 .uleb128 0x1 # (DIE DW_TAG_compile_unit)33 .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"34 .byte 0x1d # DW_AT_language35 .long .LASF0 # DW_AT_name: "main.c"36 .long .LASF1 # DW_AT_comp_dir: ""37 .quad .Ltext0 # DW_AT_low_pc38 .quad .Letext0-.Ltext0 # DW_AT_high_pc39 .long .Ldebug_line0 # DW_AT_stmt_list40 .uleb128 0x2 # (DIE DW_TAG_subprogram)41 # DW_AT_external42 .long .LASF3 # DW_AT_name: "main"43 .byte 0x1 # DW_AT_decl_file (main.c)44 .byte 0x1 # DW_AT_decl_line45 .quad .LFB0 # DW_AT_low_pc46 .quad .LFE0-.LFB0 # DW_AT_high_pc47 .byte 0 # end of children of DIE DW_TAG_compile_unit48.Ldebug_info0_end:49 .section .debug_abbrev,"",@progbits50.Ldebug_abbrev0:51 .uleb128 0x1 # (abbrev code)52 .uleb128 0x11 # (TAG: DW_TAG_compile_unit)53 .byte 0x1 # DW_children_yes54 .uleb128 0x25 # (DW_AT_producer)55 .uleb128 0xe # (DW_FORM_strp)56 .uleb128 0x13 # (DW_AT_language)57 .uleb128 0xb # (DW_FORM_data1)58 .uleb128 0x3 # (DW_AT_name)59 .uleb128 0x1f # (DW_FORM_line_strp)60 .uleb128 0x1b # (DW_AT_comp_dir)61 .uleb128 0x1f # (DW_FORM_line_strp)62 .uleb128 0x11 # (DW_AT_low_pc)63 .uleb128 0x1 # (DW_FORM_addr)64 .uleb128 0x12 # (DW_AT_high_pc)65 .uleb128 0x7 # (DW_FORM_data8)66 .uleb128 0x10 # (DW_AT_stmt_list)67 .uleb128 0x17 # (DW_FORM_sec_offset)68 .byte 069 .byte 070 .uleb128 0x2 # (abbrev code)71 .uleb128 0x2e # (TAG: DW_TAG_subprogram)72 .byte 0 # DW_children_no73 .uleb128 0x3f # (DW_AT_external)74 .uleb128 0x19 # (DW_FORM_flag_present)75 .uleb128 0x3 # (DW_AT_name)76 .uleb128 0xe # (DW_FORM_strp)77 .uleb128 0x3a # (DW_AT_decl_file)78 .uleb128 0xb # (DW_FORM_data1)79 .uleb128 0x3b # (DW_AT_decl_line)80 .uleb128 0xb # (DW_FORM_data1)81 .uleb128 0x11 # (DW_AT_low_pc)82 .uleb128 0x1 # (DW_FORM_addr)83 .uleb128 0x12 # (DW_AT_high_pc)84 .uleb128 0x7 # (DW_FORM_data8)85 .byte 086 .byte 087 .byte 088 .section .debug_line,"",@progbits89.Ldebug_line0:90 .long .LELT0-.LSLT0 # Length of Source Line Info91.LSLT0:92 .value 0x5 # DWARF version number93 .byte 0x8 # Address Size94 .byte 0 # Segment Size95 .long .LELTP0-.LASLTP0 # Prolog Length96.LASLTP0:97 .byte 0x1 # Minimum Instruction Length98 .byte 0x1 # Maximum Operations Per Instruction99 .byte 0x1 # Default is_stmt_start flag100 .byte 0xf6 # Line Base Value (Special Opcodes)101 .byte 0xf2 # Line Range Value (Special Opcodes)102 .byte 0xd # Special Opcode Base103 .byte 0 # opcode: 0x1 has 0 args104 .byte 0x1 # opcode: 0x2 has 1 args105 .byte 0x1 # opcode: 0x3 has 1 args106 .byte 0x1 # opcode: 0x4 has 1 args107 .byte 0x1 # opcode: 0x5 has 1 args108 .byte 0 # opcode: 0x6 has 0 args109 .byte 0 # opcode: 0x7 has 0 args110 .byte 0 # opcode: 0x8 has 0 args111 .byte 0x1 # opcode: 0x9 has 1 args112 .byte 0 # opcode: 0xa has 0 args113 .byte 0 # opcode: 0xb has 0 args114 .byte 0x1 # opcode: 0xc has 1 args115 .byte 0x1 # Directory entry format count116 .uleb128 0x1 # DW_LNCT_path117 .uleb128 0x1f # DW_FORM_line_strp118 .uleb128 0x2 # Directories count119 .long .LASF1 # Directory Entry: 0: ""120 .long .LASF4 # Directory Entry: 0: ""121 .byte 0x2 # File name entry format count122 .uleb128 0x1 # DW_LNCT_path123 .uleb128 0x1f # DW_FORM_line_strp124 .uleb128 0x2 # DW_LNCT_directory_index125 .uleb128 0xb # DW_FORM_data1126 .uleb128 0x2 # File names count127 .long .LASF0 # File Entry: 0: "main.c"128 .byte 0129 .long .LASF5 # File Entry: 0: "main.c"130 .byte 0x1131.LELTP0:132 .byte 0 # set address *.LM1133 .uleb128 0x9134 .byte 0x2135 .quad .LM1136 .byte 0x1 # copy line 1137 .byte 0x5 # column 12138 .uleb128 0xc # 12139 .byte 0 # set address *.LM2140 .uleb128 0x9141 .byte 0x2142 .quad .LM2143 .byte 0x1 # copy line 1144 .byte 0x5 # column 13145 .uleb128 0xd # 13146 .byte 0 # set address *.Letext0147 .uleb128 0x9148 .byte 0x2149 .quad .Letext0150 .byte 0 # end sequence151 .uleb128 0x1152 .byte 0x1153.LELT0:154 .section .debug_str,"MS",@progbits,1155.LASF2:156 .string "GNU C17 11.0.0 20210210 (Red Hat 11.0.0-0) -mtune=generic -march=x86-64 -gdwarf-5 -gno-as-loc-support"157.LASF3:158 .string "main"159 .section .debug_line_str,"MS",@progbits,1160.LASF1:161 .string ""162.LASF4:163 .string ""164.LASF0:165 .string "main.c"166.LASF5:167 .string "main.c"168 .ident "GCC: (GNU) 11.0.0 20210210 (Red Hat 11.0.0-0)"169 .section .note.GNU-stack,"",@progbits170