237 lines · plain
1## This tests if .debug_loclists.dwo are correctly read if they are part2## of a dwp file.3 4# RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj %s --defsym MAIN=0 > %t5# RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj %s > %t.dwp6# RUN: %lldb %t -o "image lookup -v -s lookup_loclists" -o exit | FileCheck %s7 8# CHECK-LABEL: image lookup -v -s lookup_loclists9# CHECK: Variable: id = {{.*}}, name = "x0", type = "int", valid ranges = <block>, location = [0x0000000000000000, 0x0000000000000003) -> DW_OP_reg0 RAX,10# CHECK: Variable: id = {{.*}}, name = "x1", type = "int", valid ranges = <block>, location = [0x0000000000000002, 0x0000000000000004) -> DW_OP_reg1 RDX,11 12## This part is kept in both the main and the dwp file to be able to reference the offsets.13loclists:14 nop15 nop16.Ltmp1:17lookup_loclists:18 nop19.Ltmp2:20 nop21.Ltmp3:22 nop23.Lloclists_end:24 25## The main file.26.ifdef MAIN27 .section .debug_abbrev,"",@progbits28 .byte 1 # Abbreviation Code29 .byte 74 # DW_TAG_compile_unit30 .byte 0 # DW_CHILDREN_no31 .byte 0x76 # DW_AT_dwo_name32 .byte 8 # DW_FORM_string33 .byte 115 # DW_AT_addr_base34 .byte 23 # DW_FORM_sec_offset35 .byte 17 # DW_AT_low_pc36 .byte 1 # DW_FORM_addr37 .byte 85 # DW_AT_ranges38 .byte 35 # DW_FORM_rnglistx39 .byte 116 # DW_AT_rnglists_base40 .byte 23 # DW_FORM_sec_offset41 .byte 0 # EOM(1)42 .byte 0 # EOM(2)43 .byte 0 # EOM(3)44 45 .section .debug_info,"",@progbits46.Lcu_begin0:47 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit48.Ldebug_info_start0:49 .short 5 # DWARF version number50 .byte 4 # DWARF Unit Type51 .byte 8 # Address Size (in bytes)52 .long .debug_abbrev # Offset Into Abbrev. Section53 .quad 1026699901672188186 # DWO id54 .byte 1 # Abbrev [1] DW_TAG_compile_unit55 .asciz "debug_loclists-dwp.dwo" # DW_AT_dwo_name56 .long .Laddr_table_base0 # DW_AT_addr_base57 .quad loclists # DW_AT_low_pc58 .byte 0 # DW_AT_ranges59 .long .Lskel_rnglists_table_base # DW_AT_rnglists_base60.Ldebug_info_end0:61 .section .debug_rnglists,"",@progbits62 .long .Lskel_rnglist_table_end-.Lskel_rnglist_table_start # Length63.Lskel_rnglist_table_start:64 .short 5 # Version65 .byte 8 # Address size66 .byte 0 # Segment selector size67 .long 1 # Offset entry count68.Lskel_rnglists_table_base:69 .long .Lskel_ranges0-.Lskel_rnglists_table_base70.Lskel_ranges0:71 .byte 7 # DW_RLE_start_length72 .quad loclists73 .uleb128 .Lloclists_end-loclists74 .byte 0 # DW_RLE_end_of_list75.Lskel_rnglist_table_end:76 .section .debug_addr,"",@progbits77 .long .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution78.Ldebug_addr_start0:79 .short 5 # DWARF version number80 .byte 8 # Address size81 .byte 0 # Segment selector size82.Laddr_table_base0:83 .quad loclists84 .quad .Ltmp185.Ldebug_addr_end0:86 87.else88## DWP file starts here.89 90 .section .debug_loclists.dwo,"e",@progbits91## Start the section with an unused table to check that the reading offset92## of the real table is correctly adjusted.93 .long .LLLDummyEnd-.LLLDummyVersion # Length of Unit94.LLLDummyVersion:95 .short 5 # Version96 .byte 8 # Address size97 .byte 0 # Segment selector size98 .long 0 # Offset entry count99 .byte 0 # DW_LLE_end_of_list100.LLLDummyEnd:101.LLLBegin:102 .long .Ldebug_loclist_table_end0-.Ldebug_loclist_table_start0 # Length103.Ldebug_loclist_table_start0:104 .short 5 # Version105 .byte 8 # Address size106 .byte 0 # Segment selector size107 .long 2 # Offset entry count108.Lloclists_table_base:109 .long .Ldebug_loc0-.Lloclists_table_base110 .long .Ldebug_loc1-.Lloclists_table_base111.Ldebug_loc0:112 .byte 4 # DW_LLE_offset_pair113 .uleb128 loclists-loclists114 .uleb128 .Ltmp2-loclists115 .uleb128 1 # Expression size116 .byte 80 # super-register DW_OP_reg0117 .byte 0 # DW_LLE_end_of_list118.Ldebug_loc1:119 .byte 3 # DW_LLE_startx_length120 .uleb128 1121 .uleb128 .Ltmp3-.Ltmp1122 .uleb128 1 # Expression size123 .byte 81 # super-register DW_OP_reg1124 .byte 0 # DW_LLE_end_of_list125.Ldebug_loclist_table_end0:126.LLLEnd:127 .section .debug_abbrev.dwo,"e",@progbits128.LAbbrevBegin:129 .byte 1 # Abbreviation Code130 .byte 17 # DW_TAG_compile_unit131 .byte 1 # DW_CHILDREN_yes132 .byte 37 # DW_AT_producer133 .byte 8 # DW_FORM_string134 .byte 19 # DW_AT_language135 .byte 5 # DW_FORM_data2136 .byte 0 # EOM(1)137 .byte 0 # EOM(2)138 .byte 2 # Abbreviation Code139 .byte 46 # DW_TAG_subprogram140 .byte 1 # DW_CHILDREN_yes141 .byte 17 # DW_AT_low_pc142 .byte 27 # DW_FORM_addrx143 .byte 18 # DW_AT_high_pc144 .byte 6 # DW_FORM_data4145 .byte 3 # DW_AT_name146 .byte 8 # DW_FORM_string147 .byte 73 # DW_AT_type148 .byte 19 # DW_FORM_ref4149 .byte 0 # EOM(1)150 .byte 0 # EOM(2)151 .byte 3 # Abbreviation Code152 .byte 5 # DW_TAG_formal_parameter153 .byte 0 # DW_CHILDREN_no154 .byte 2 # DW_AT_location155 .byte 0x22 # DW_FORM_loclistx156 .byte 3 # DW_AT_name157 .byte 8 # DW_FORM_string158 .byte 73 # DW_AT_type159 .byte 19 # DW_FORM_ref4160 .byte 0 # EOM(1)161 .byte 0 # EOM(2)162 .byte 4 # Abbreviation Code163 .byte 36 # DW_TAG_base_type164 .byte 0 # DW_CHILDREN_no165 .byte 3 # DW_AT_name166 .byte 8 # DW_FORM_string167 .byte 62 # DW_AT_encoding168 .byte 11 # DW_FORM_data1169 .byte 11 # DW_AT_byte_size170 .byte 11 # DW_FORM_data1171 .byte 0 # EOM(1)172 .byte 0 # EOM(2)173 .byte 0 # EOM(3)174.LAbbrevEnd:175 .section .debug_info.dwo,"e",@progbits176.LCUBegin:177.Lcu_begin1:178 .long .Ldebug_info_end1-.Ldebug_info_start1 # Length of Unit179.Ldebug_info_start1:180 .short 5 # DWARF version number181 .byte 5 # DWARF Unit Type182 .byte 8 # Address Size (in bytes)183 .long 0 # Offset Into Abbrev. Section184 .quad 1026699901672188186 # DWO id185 .byte 1 # Abbrev [1] DW_TAG_compile_unit186 .asciz "Hand-written DWARF" # DW_AT_producer187 .short 12 # DW_AT_language188 .byte 2 # Abbrev [2] DW_TAG_subprogram189 .byte 0 # DW_AT_low_pc190 .long .Lloclists_end-loclists # DW_AT_high_pc191 .asciz "loclists" # DW_AT_name192 .long .Lint # DW_AT_type193 .byte 3 # Abbrev [3] DW_TAG_formal_parameter194 .uleb128 0 # DW_AT_location195 .asciz "x0" # DW_AT_name196 .long .Lint # DW_AT_type197 .byte 3 # Abbrev [3] DW_TAG_formal_parameter198 .uleb128 1 # DW_AT_location199 .asciz "x1" # DW_AT_name200 .long .Lint # DW_AT_type201 .byte 0 # End Of Children Mark202.Lint:203 .byte 4 # Abbrev [4] DW_TAG_base_type204 .asciz "int" # DW_AT_name205 .byte 5 # DW_AT_encoding206 .byte 4 # DW_AT_byte_size207 .byte 0 # End Of Children Mark208.Ldebug_info_end1:209.LCUEnd:210 .section .debug_cu_index, "", @progbits211## Header:212 .short 5 # Version213 .short 0 # Padding214 .long 3 # Section count215 .long 1 # Unit count216 .long 2 # Slot count217## Hash Table of Signatures:218 .quad 1026699901672188186219 .quad 0220## Parallel Table of Indexes:221 .long 1222 .long 0223## Table of Section Offsets:224## Row 0:225 .long 1 # DW_SECT_INFO226 .long 3 # DW_SECT_ABBREV227 .long 5 # DW_SECT_LOCLISTS228## Row 1:229 .long 0 # Offset in .debug_info.dwo230 .long 0 # Offset in .debug_abbrev.dwo231 .long .LLLBegin-.debug_loclists.dwo # Offset in .debug_loclists.dwo232## Table of Section Sizes:233 .long .LCUEnd-.LCUBegin # Size in .debug_info.dwo234 .long .LAbbrevEnd-.LAbbrevBegin # Size in .debug_abbrev.dwo235 .long .LLLEnd-.LLLBegin # Size in .debug_loclists.dwo236.endif237