xref: /llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/debug_loclists-dwo.s (revision 15983c28aa819031e08a2b3fe49d02c41839b22c)
1# RUN: cd %T
2# RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj %s >debug_loclists-dwo.o
3# RUN: %lldb debug_loclists-dwo.o -o "image lookup -v -s lookup_loclists" -o exit | FileCheck %s
4
5# CHECK-LABEL: image lookup -v -s lookup_loclists
6# CHECK: Variable: {{.*}}, name = "x0", type = "int", valid ranges = <block>, location = [0x0000000000000000, 0x0000000000000003) -> DW_OP_reg0 RAX,
7# CHECK: Variable: {{.*}}, name = "x1", type = "int", valid ranges = <block>, location = [0x0000000000000002, 0x0000000000000004) -> DW_OP_reg1 RDX,
8
9loclists:
10        nop
11.Ltmp0:
12        nop
13.Ltmp1:
14lookup_loclists:
15        nop
16.Ltmp2:
17        nop
18.Ltmp3:
19        nop
20.Lloclists_end:
21
22        .section        .debug_abbrev,"",@progbits
23        .byte   1                       # Abbreviation Code
24        .byte   17                      # DW_TAG_compile_unit
25        .byte   0                       # DW_CHILDREN_no
26        .byte   0x76                    # DW_AT_dwo_name
27        .byte   8                       # DW_FORM_string
28        .byte   115                     # DW_AT_addr_base
29        .byte   23                      # DW_FORM_sec_offset
30        .byte   17                      # DW_AT_low_pc
31        .byte   1                       # DW_FORM_addr
32        .byte   85                      # DW_AT_ranges
33        .byte   35                      # DW_FORM_rnglistx
34        .byte   116                     # DW_AT_rnglists_base
35        .byte   23                      # DW_FORM_sec_offset
36        .byte   0                       # EOM(1)
37        .byte   0                       # EOM(2)
38        .byte   0                       # EOM(3)
39
40        .section        .debug_info,"",@progbits
41.Lcu_begin0:
42        .long   .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
43.Ldebug_info_start0:
44        .short  5                       # DWARF version number
45        .byte   4                       # DWARF Unit Type
46        .byte   8                       # Address Size (in bytes)
47        .long   .debug_abbrev           # Offset Into Abbrev. Section
48        .quad   0xdeadbeefbaadf00d      # DWO id
49        .byte   1                       # Abbrev [1] 0xc:0x5f DW_TAG_compile_unit
50        .asciz  "debug_loclists-dwo.o"  # DW_AT_dwo_name
51        .long   .Laddr_table_base0      # DW_AT_addr_base
52        .quad   loclists                # DW_AT_low_pc
53        .byte   0                       # DW_AT_ranges
54        .long   .Lskel_rnglists_table_base # DW_AT_rnglists_base
55.Ldebug_info_end0:
56
57        .section        .debug_rnglists,"",@progbits
58        .long   .Lskel_rnglist_table_end-.Lskel_rnglist_table_start # Length
59.Lskel_rnglist_table_start:
60        .short  5                       # Version
61        .byte   8                       # Address size
62        .byte   0                       # Segment selector size
63        .long   1                       # Offset entry count
64.Lskel_rnglists_table_base:
65        .long   .Lskel_ranges0-.Lskel_rnglists_table_base
66.Lskel_ranges0:
67        .byte   7                       # DW_RLE_start_length
68        .quad   loclists
69        .uleb128   .Lloclists_end-loclists
70        .byte   0                       # DW_RLE_end_of_list
71.Lskel_rnglist_table_end:
72        .section        .debug_addr,"",@progbits
73        .long   .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution
74.Ldebug_addr_start0:
75        .short  5                       # DWARF version number
76        .byte   8                       # Address size
77        .byte   0                       # Segment selector size
78.Laddr_table_base0:
79        .quad   loclists
80        .quad   .Ltmp1
81.Ldebug_addr_end0:
82
83# The presence of an extra non-dwo loclists section should not confuse us.
84# .debug_info.dwo always refers to .debug_loclists.dwo
85        .section        .debug_loclists,"",@progbits
86        .quad 0xdeadbeefbaadf00d
87
88        .section        .debug_loclists.dwo,"e",@progbits
89        .long   .Ldebug_loclist_table_end0-.Ldebug_loclist_table_start0 # Length
90.Ldebug_loclist_table_start0:
91        .short  5                       # Version
92        .byte   8                       # Address size
93        .byte   0                       # Segment selector size
94        .long   2                       # Offset entry count
95.Lloclists_table_base:
96        .long   .Ldebug_loc0-.Lloclists_table_base
97        .long   .Ldebug_loc1-.Lloclists_table_base
98.Ldebug_loc0:
99        .byte   4                       # DW_LLE_offset_pair
100        .uleb128 loclists-loclists
101        .uleb128  .Ltmp2-loclists
102        .uleb128 1                      # Expression size
103        .byte   80                      # super-register DW_OP_reg0
104        .byte   0                       # DW_LLE_end_of_list
105.Ldebug_loc1:
106        .byte   3                       # DW_LLE_startx_length
107        .uleb128 1
108        .uleb128  .Ltmp3-.Ltmp1
109        .uleb128 1                      # Expression size
110        .byte   81                      # super-register DW_OP_reg1
111        .byte   0                       # DW_LLE_end_of_list
112.Ldebug_loclist_table_end0:
113
114        .section        .debug_abbrev.dwo,"e",@progbits
115        .byte   1                       # Abbreviation Code
116        .byte   17                      # DW_TAG_compile_unit
117        .byte   1                       # DW_CHILDREN_yes
118        .byte   37                      # DW_AT_producer
119        .byte   8                       # DW_FORM_string
120        .byte   19                      # DW_AT_language
121        .byte   5                       # DW_FORM_data2
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   27                      # DW_FORM_addrx
129        .byte   18                      # DW_AT_high_pc
130        .byte   6                       # DW_FORM_data4
131        .byte   3                       # DW_AT_name
132        .byte   8                       # DW_FORM_string
133        .byte   73                      # DW_AT_type
134        .byte   19                      # DW_FORM_ref4
135        .byte   0                       # EOM(1)
136        .byte   0                       # EOM(2)
137        .byte   3                       # Abbreviation Code
138        .byte   5                       # DW_TAG_formal_parameter
139        .byte   0                       # DW_CHILDREN_no
140        .byte   2                       # DW_AT_location
141        .byte   0x22                    # DW_FORM_loclistx
142        .byte   3                       # DW_AT_name
143        .byte   8                       # DW_FORM_string
144        .byte   73                      # DW_AT_type
145        .byte   19                      # DW_FORM_ref4
146        .byte   0                       # EOM(1)
147        .byte   0                       # EOM(2)
148        .byte   4                       # Abbreviation Code
149        .byte   36                      # DW_TAG_base_type
150        .byte   0                       # DW_CHILDREN_no
151        .byte   3                       # DW_AT_name
152        .byte   8                       # DW_FORM_string
153        .byte   62                      # DW_AT_encoding
154        .byte   11                      # DW_FORM_data1
155        .byte   11                      # DW_AT_byte_size
156        .byte   11                      # DW_FORM_data1
157        .byte   0                       # EOM(1)
158        .byte   0                       # EOM(2)
159        .byte   0                       # EOM(3)
160
161        .section        .debug_info.dwo,"e",@progbits
162.Lcu_begin1:
163        .long   .Ldebug_info_end1-.Ldebug_info_start1 # Length of Unit
164.Ldebug_info_start1:
165        .short  5                       # DWARF version number
166        .byte   5                       # DWARF Unit Type
167        .byte   8                       # Address Size (in bytes)
168        .long   .debug_abbrev           # Offset Into Abbrev. Section
169        .quad   0xdeadbeefbaadf00d      # DWO id
170        .byte   1                       # Abbrev [1] 0xb:0x50 DW_TAG_compile_unit
171        .asciz  "Hand-written DWARF"    # DW_AT_producer
172        .short  12                      # DW_AT_language
173        .byte   2                       # Abbrev [2] 0x2a:0x29 DW_TAG_subprogram
174        .byte   0                       # DW_AT_low_pc
175        .long   .Lloclists_end-loclists # DW_AT_high_pc
176        .asciz  "loclists"              # DW_AT_name
177        .long   .Lint                   # DW_AT_type
178        .byte   3                       # Abbrev [3] DW_TAG_formal_parameter
179        .uleb128 0                      # DW_AT_location
180        .asciz  "x0"                    # DW_AT_name
181        .long   .Lint                   # DW_AT_type
182        .byte   3                       # Abbrev [3] DW_TAG_formal_parameter
183        .uleb128 1                      # DW_AT_location
184        .asciz  "x1"                    # DW_AT_name
185        .long   .Lint                   # DW_AT_type
186        .byte   0                       # End Of Children Mark
187.Lint:
188        .byte   4                       # Abbrev [4] 0x53:0x7 DW_TAG_base_type
189        .asciz  "int"                   # DW_AT_name
190        .byte   5                       # DW_AT_encoding
191        .byte   4                       # DW_AT_byte_size
192        .byte   0                       # End Of Children Mark
193.Ldebug_info_end1:
194