xref: /llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/DW_AT_loclists_base.s (revision 15983c28aa819031e08a2b3fe49d02c41839b22c)
1# RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj %s > %t
2# RUN: %lldb %t -o "image lookup -v -s lookup_loclists" -o exit | FileCheck %s
3
4# CHECK-LABEL: image lookup -v -s lookup_loclists
5# CHECK: Variable: {{.*}}, name = "x0", type = "int", valid ranges = <block>, location = [0x0000000000000000, 0x0000000000000003) -> DW_OP_reg0 RAX,
6# CHECK-NOT: Variable:
7
8loclists:
9        nop
10.Ltmp0:
11        nop
12lookup_loclists:
13.Ltmp1:
14        nop
15.Ltmp2:
16        nop
17.Ltmp3:
18        nop
19.Ltmp4:
20        nop
21.Lloclists_end:
22
23        .section        .debug_loclists,"",@progbits
24        .long   .Ldebug_loclist_table_end0-.Ldebug_loclist_table_start0 # Length
25.Ldebug_loclist_table_start0:
26        .short  5                       # Version
27        .byte   8                       # Address size
28        .byte   0                       # Segment selector size
29        .long   2                       # Offset entry count
30.Lloclists_table_base:
31        .long   .Ldebug_loc0-.Lloclists_table_base
32        .long   .Ldebug_loc1-.Lloclists_table_base
33.Ldebug_loc0:
34        .byte   4                       # DW_LLE_offset_pair
35        .uleb128 loclists-loclists
36        .uleb128  .Ltmp2-loclists
37        .uleb128 1                      # Expression size
38        .byte   80                      # super-register DW_OP_reg0
39        .byte   0                       # DW_LLE_end_of_list
40.Ldebug_loc1:
41        .byte   4                       # DW_LLE_offset_pair
42        .uleb128 .Ltmp3-loclists
43        .uleb128  .Ltmp4-loclists
44        .uleb128 1                      # Expression size
45        .byte   81                      # super-register DW_OP_reg1
46        .byte   0                       # DW_LLE_end_of_list
47.Ldebug_loclist_table_end0:
48
49        .section        .debug_abbrev,"",@progbits
50        .byte   1                       # Abbreviation Code
51        .byte   17                      # DW_TAG_compile_unit
52        .byte   1                       # DW_CHILDREN_yes
53        .byte   37                      # DW_AT_producer
54        .byte   8                       # DW_FORM_string
55        .byte   19                      # DW_AT_language
56        .byte   5                       # DW_FORM_data2
57        .uleb128 0x8c                   # DW_AT_loclists_base
58        .byte   0x17                    # DW_FORM_sec_offset
59        .byte   17                      # DW_AT_low_pc
60        .byte   1                       # DW_FORM_addr
61        .byte   18                      # DW_AT_high_pc
62        .byte   6                       # DW_FORM_data4
63        .byte   0                       # EOM(1)
64        .byte   0                       # EOM(2)
65        .byte   2                       # Abbreviation Code
66        .byte   46                      # DW_TAG_subprogram
67        .byte   1                       # DW_CHILDREN_yes
68        .byte   17                      # DW_AT_low_pc
69        .byte   1                       # DW_FORM_addr
70        .byte   18                      # DW_AT_high_pc
71        .byte   6                       # DW_FORM_data4
72        .byte   3                       # DW_AT_name
73        .byte   8                       # DW_FORM_string
74        .byte   73                      # DW_AT_type
75        .byte   19                      # DW_FORM_ref4
76        .byte   0                       # EOM(1)
77        .byte   0                       # EOM(2)
78        .byte   3                       # Abbreviation Code
79        .byte   5                       # DW_TAG_formal_parameter
80        .byte   0                       # DW_CHILDREN_no
81        .byte   2                       # DW_AT_location
82        .byte   0x22                    # DW_FORM_loclistx
83        .byte   3                       # DW_AT_name
84        .byte   8                       # DW_FORM_string
85        .byte   73                      # DW_AT_type
86        .byte   19                      # DW_FORM_ref4
87        .byte   0                       # EOM(1)
88        .byte   0                       # EOM(2)
89        .byte   4                       # Abbreviation Code
90        .byte   36                      # DW_TAG_base_type
91        .byte   0                       # DW_CHILDREN_no
92        .byte   3                       # DW_AT_name
93        .byte   8                       # DW_FORM_string
94        .byte   62                      # DW_AT_encoding
95        .byte   11                      # DW_FORM_data1
96        .byte   11                      # DW_AT_byte_size
97        .byte   11                      # DW_FORM_data1
98        .byte   0                       # EOM(1)
99        .byte   0                       # EOM(2)
100        .byte   0                       # EOM(3)
101
102        .section        .debug_info,"",@progbits
103.Lcu_begin0:
104        .long   .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
105.Ldebug_info_start0:
106        .short  5                       # DWARF version number
107        .byte   1                       # DWARF Unit Type
108        .byte   8                       # Address Size (in bytes)
109        .long   .debug_abbrev           # Offset Into Abbrev. Section
110        .byte   1                       # Abbrev [1] 0xb:0x50 DW_TAG_compile_unit
111        .asciz  "Hand-written DWARF"    # DW_AT_producer
112        .short  12                      # DW_AT_language
113        .long   .Lloclists_table_base   # DW_AT_loclists_base
114        .quad   loclists                # DW_AT_low_pc
115        .long   .Lloclists_end-loclists # DW_AT_high_pc
116        .byte   2                       # Abbrev [2] 0x2a:0x29 DW_TAG_subprogram
117        .quad   loclists                # DW_AT_low_pc
118        .long   .Lloclists_end-loclists # DW_AT_high_pc
119        .asciz  "loclists"              # DW_AT_name
120        .long   .Lint                   # DW_AT_type
121        .byte   3                       # Abbrev [3] DW_TAG_formal_parameter
122        .uleb128 0                      # DW_AT_location
123        .asciz  "x0"                    # DW_AT_name
124        .long   .Lint-.Lcu_begin0       # DW_AT_type
125        .byte   3                       # Abbrev [3] DW_TAG_formal_parameter
126        .uleb128 1                      # DW_AT_location
127        .asciz  "x1"                    # DW_AT_name
128        .long   .Lint-.Lcu_begin0       # DW_AT_type
129        .byte   0                       # End Of Children Mark
130.Lint:
131        .byte   4                       # Abbrev [4] 0x53:0x7 DW_TAG_base_type
132        .asciz  "int"                   # DW_AT_name
133        .byte   5                       # DW_AT_encoding
134        .byte   4                       # DW_AT_byte_size
135        .byte   0                       # End Of Children Mark
136.Ldebug_info_end0:
137