summaryrefslogtreecommitdiffstats
path: root/llvm/test/DebugInfo/X86/dwarfdump-debug-loclists.test
blob: 5b6b6b8d5ccc572e1d3a2010623d39e80dc7896d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux -o %t.o
# RUN: llvm-dwarfdump -v %t.o | FileCheck %s

# CHECK:      .debug_info
# CHECK:       DW_AT_name{{.*}}"stub"
# CHECK:       DW_AT_location [DW_FORM_sec_offset]   (0x0000000c
# CHECK-NEXT:    [0x0000000000000010, 0x0000000000000020): DW_OP_breg5 RDI+0
# CHECK-NEXT:    [0x0000000000000530, 0x0000000000000540): DW_OP_breg6 RBP-8, DW_OP_deref
# CHECK-NEXT:    [0x0000000000000700, 0x0000000000000710): DW_OP_breg5 RDI+0

# CHECK:      .debug_loclists contents:
# CHECK-NEXT: 0x00000000: locations list header: length = 0x0000002c, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
# CHECK-NEXT: 0x0000000c:
# CHECK-NEXT:   DW_LLE_offset_pair  (0x0000000000000000, 0x0000000000000010): DW_OP_breg5 RDI+0
# CHECK-NEXT:   DW_LLE_base_address (0x0000000000000500)
# CHECK-NEXT:   DW_LLE_offset_pair  (0x0000000000000030, 0x0000000000000040)
# CHECK-NEXT:                   => [0x0000000000000530, 0x0000000000000540): DW_OP_breg6 RBP-8, DW_OP_deref
# CHECK-NEXT:   DW_LLE_start_length (0x0000000000000700, 0x0000000000000010)
# CHECK-NEXT:                   => [0x0000000000000700, 0x0000000000000710): DW_OP_breg5 RDI+0
# CHECK-NEXT:   DW_LLE_end_of_list  ()

.section  .debug_str,"MS",@progbits,1
  .asciz  "stub"

.section  .debug_str_offsets,"",@progbits
  .long  68
  .short  5
  .short  0
.Lstr_offsets_base0:
  .zero 64

.section  .debug_loclists,"",@progbits
  .long  .Ldebug_loclist_table_end0-.Ldebug_loclist_table_start0
.Ldebug_loclist_table_start0:
 .short 5                        # Version.
 .byte 8                         # Address size.
 .byte 0                         # Segmen selector size.
 .long 0                         # Offset entry count.
.Lloclists_table_base0:
.Ldebug_loc0:
  .byte  4                       # DW_LLE_offset_pair
  .uleb128 0x0                   #   starting offset
  .uleb128 0x10                  #   ending offset
  .byte  2                       # Loc expr size
  .byte  117                     # DW_OP_breg5
  .byte  0                       # 0
  
  .byte  6                       # DW_LLE_base_address
  .quad  0x500                   # Some address
  
  .byte  4                       # DW_LLE_offset_pair
  .uleb128 0x30                  #   starting offset
  .uleb128 0x40                  #   ending offset
  .byte  3                       # Loc expr size
  .byte  118                     # DW_OP_breg6
  .byte  120                     # -8
  .byte  6                       # DW_OP_deref

  .byte  8                       # DW_LLE_start_length
  .quad  0x700                   # Some address
  .uleb128 0x10                  #   length
  .byte  2                       # Loc expr size
  .byte  117                     # DW_OP_breg5
  .byte  0                       # 0
  
  .byte  0                       # DW_LLE_end_of_list

.Ldebug_loclist_table_end0:

.section  .debug_abbrev,"",@progbits
  .byte  1                       # Abbreviation Code
  .byte  17                      # DW_TAG_compile_unit
  .byte  1                       # DW_CHILDREN_yes
  .byte  37                      # DW_AT_producer
  .byte  37                      # DW_FORM_strx1
  .byte  19                      # DW_AT_language
  .byte  5                       # DW_FORM_data2
  .byte  3                       # DW_AT_name
  .byte  37                      # DW_FORM_strx1
  .byte  114                     # DW_AT_str_offsets_base
  .byte  23                      # DW_FORM_sec_offset
  .byte  16                      # DW_AT_stmt_list
  .byte  23                      # DW_FORM_sec_offset
  .byte  27                      # DW_AT_comp_dir
  .byte  37                      # DW_FORM_strx1
  .byte  17                      # DW_AT_low_pc
  .byte  1                       # DW_FORM_addr
  .byte  18                      # DW_AT_high_pc
  .byte  6                       # DW_FORM_data4
  .ascii  "\214\001"             # DW_AT_loclists_base
  .byte  23                      # DW_FORM_sec_offset
  .byte  0                       # EOM(1)
  .byte  0                       # EOM(2)
  .byte  2                       # Abbreviation Code
  .byte  46                      # DW_TAG_subprogram
  .byte  1                       # DW_CHILDREN_yes
  .byte  17                      # DW_AT_low_pc
  .byte  1                       # DW_FORM_addr
  .byte  18                      # DW_AT_high_pc
  .byte  6                       # DW_FORM_data4
  .byte  64                      # DW_AT_frame_base
  .byte  24                      # DW_FORM_exprloc
  .byte  110                     # DW_AT_linkage_name
  .byte  37                      # DW_FORM_strx1
  .byte  3                       # DW_AT_name
  .byte  37                      # DW_FORM_strx1
  .byte  58                      # DW_AT_decl_file
  .byte  11                      # DW_FORM_data1
  .byte  59                      # DW_AT_decl_line
  .byte  11                      # DW_FORM_data1
  .byte  63                      # DW_AT_external
  .byte  25                      # DW_FORM_flag_present
  .byte  0                       # EOM(1)
  .byte  0                       # EOM(2)
  .byte  3                       # Abbreviation Code
  .byte  52                      # DW_TAG_variable
  .byte  0                       # DW_CHILDREN_no
  .byte  2                       # DW_AT_location
  .byte  23                      # DW_FORM_sec_offset
  .byte  3                       # DW_AT_name
  .byte  37                      # DW_FORM_strx1
  .byte  58                      # DW_AT_decl_file
  .byte  11                      # DW_FORM_data1
  .byte  59                      # DW_AT_decl_line
  .byte  11                      # DW_FORM_data1
  .byte  73                      # DW_AT_type
  .byte  19                      # DW_FORM_ref4
  .byte  0                       # EOM(1)
  .byte  0                       # EOM(2)
  .byte  0                       # EOM(3)

.section  .debug_info,"",@progbits
.Lcu_begin0:
  .long  70                      # Length of Unit
  .short  5                      # DWARF version number
  .byte  1                       # DWARF Unit Type
  .byte  8                       # Address Size (in bytes)
  .long  .debug_abbrev           # Offset Into Abbrev. Section
  .byte  1                       # Abbrev [1] 0xc:0xef DW_TAG_compile_unit
  .byte  0                       # DW_AT_producer
  .short  4                      # DW_AT_language
  .byte  1                       # DW_AT_name
  .long  .Lstr_offsets_base0     # DW_AT_str_offsets_base
  .long  .Lline_table_start0     # DW_AT_stmt_list
  .byte  2                       # DW_AT_comp_dir
  .quad  0x10                    # DW_AT_low_pc
  .long  0                       # DW_AT_high_pc
  .long  .Lloclists_table_base0  # DW_AT_loclists_base
  .byte  2                       # Abbrev [2] 0x2a:0x20 DW_TAG_subprogram
  .quad  0                       # DW_AT_low_pc
  .long  0                       # DW_AT_high_pc
  .byte  1                       # DW_AT_frame_base
  .byte  86
  .byte  11                      # DW_AT_linkage_name
  .byte  12                      # DW_AT_name
  .byte  1                       # DW_AT_decl_file
  .byte  6                       # DW_AT_decl_line
                                 # DW_AT_external
  .byte 3                        # Abbrev [3] 0x40:0xb DW_TAG_variable
  .long .Ldebug_loc0             # DW_AT_location
  .byte 7                        # DW_AT_name
  .byte 1                        # DW_AT_decl_file
  .byte 6                        # DW_AT_decl_line
  .long 76                       # DW_AT_type
  .byte 0                        # End Of Children Mark
  .byte 0                        # End Of Children Mark
  .byte  0                       # End Of Children Mark

.section .debug_line,"",@progbits
.Lline_table_start0:

OpenPOWER on IntegriCloud