dwarfdump-debug-names.s
9.36 KB
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj -o - | llvm-dwarfdump -debug-names - | FileCheck %s
.section .debug_str,"MS",@progbits,1
.Linfo_string0:
.asciz "foo"
.Linfo_string1:
.asciz "_Z3foov"
.Linfo_string2:
.asciz "bar"
# Fake .debug_info. We just need it for the offsets to two "compile units" and
# two "DIEs"
.section .debug_info,"",@progbits
.Lcu_begin0:
.byte 0
.Ldie0:
.byte 0
.Lcu_begin1:
.byte 0
.Ldie1:
.byte 0
.section .debug_names,"",@progbits
.long .Lnames_end0-.Lnames_start0 # Header: contribution length
.Lnames_start0:
.short 5 # Header: version
.short 0 # Header: padding
.long 1 # Header: compilation unit count
.long 0 # Header: local type unit count
.long 0 # Header: foreign type unit count
.long 2 # Header: bucket count
.long 2 # Header: name count
.long .Lnames_abbrev_end0-.Lnames_abbrev_start0 # Header: abbreviation table size
.long 0 # Header: augmentation length
.long .Lcu_begin0 # Compilation unit 0
.long 0 # Bucket 0
.long 1 # Bucket 1
.long 193491849 # Hash in Bucket 1
.long -1257882357 # Hash in Bucket 1
.long .Linfo_string0 # String in Bucket 1: foo
.long .Linfo_string1 # String in Bucket 1: _Z3foov
.long .Lnames0-.Lnames_entries0 # Offset in Bucket 1
.long .Lnames1-.Lnames_entries0 # Offset in Bucket 1
.Lnames_abbrev_start0:
.byte 46 # Abbrev code
.byte 46 # DW_TAG_subprogram
.byte 3 # DW_IDX_die_offset
.byte 19 # DW_FORM_ref4
.byte 0 # End of abbrev
.byte 0 # End of abbrev
.byte 0 # End of abbrev list
.Lnames_abbrev_end0:
.Lnames_entries0:
.Lnames0:
.byte 46 # Abbrev code
.long .Ldie0-.Lcu_begin0 # DW_IDX_die_offset
.long 0 # End of list: foo
.Lnames1:
.byte 46 # Abbrev code
.long .Ldie0-.Lcu_begin0 # DW_IDX_die_offset
.long 0 # End of list: _Z3foov
.p2align 2
.Lnames_end0:
.long .Lnames_end1-.Lnames_start1 # Header: contribution length
.Lnames_start1:
.short 5 # Header: version
.short 0 # Header: padding
.long 1 # Header: compilation unit count
.long 0 # Header: local type unit count
.long 0 # Header: foreign type unit count
.long 1 # Header: bucket count
.long 1 # Header: name count
.long .Lnames_abbrev_end1-.Lnames_abbrev_start1 # Header: abbreviation table size
.long 0 # Header: augmentation length
.long .Lcu_begin1 # Compilation unit 0
.long 1 # Bucket 0
.long 193487034 # Hash in Bucket 0
.long .Linfo_string2 # String in Bucket 0: bar
.long .Lnames2-.Lnames_entries1 # Offset in Bucket 0
.Lnames_abbrev_start1:
.byte 52 # Abbrev code
.byte 52 # DW_TAG_variable
.byte 3 # DW_IDX_die_offset
.byte 19 # DW_FORM_ref4
.byte 0 # End of abbrev
.byte 0 # End of abbrev
.byte 0 # End of abbrev list
.Lnames_abbrev_end1:
.Lnames_entries1:
.Lnames2:
.byte 52 # Abbrev code
.long .Ldie1-.Lcu_begin1 # DW_IDX_die_offset
.long 0 # End of list: bar
.p2align 2
.Lnames_end1:
.long 0xffffffff # DWARF64 mark
.quad .Lnames_end2-.Lnames_start2 # Length
.Lnames_start2:
.short 5 # Version
.space 2 # Padding
.long 1 # CU count
.long 1 # Local TU count
.long 1 # Foreign TU count
.long 1 # Bucket count
.long 1 # Name count
.long .Lnames_abbrev_end2-.Lnames_abbrev_start2 # Abbreviations table size
.long 0 # Augmentation string size
.quad 0xcc00cccccccc # CU0 offset
.quad 0xaa00aaaaaaaa # Local TU0 offset
.quad 0xffffff00ffffffff # Foreign TU2 signature
.long 1 # Bucket 0
.long 0xb887389 # Hash in Bucket 0
.quad .Linfo_string0 # String in Bucket 0: foo
.quad .Lnames3-.Lnames_entries2 # Offset in Bucket 0
.Lnames_abbrev_start2:
.byte 0x01 # Abbrev code
.byte 0x24 # DW_TAG_base_type
.byte 0x02 # DW_IDX_type_unit
.byte 0x06 # DW_FORM_data4
.byte 0x05 # DW_IDX_type_hash
.byte 0x07 # DW_FORM_data8
.byte 0x00 # End of abbrev
.byte 0x00 # End of abbrev
.byte 0x00 # End of abbrev list
.Lnames_abbrev_end2:
.Lnames_entries2:
.Lnames3:
.byte 0x01 # Abbrev code
.long 1 # DW_IDX_type_unit
.quad 0xff03ffffffff # DW_IDX_type_hash
.byte 0x00 # End of list: foo
.p2align 2
.Lnames_end2:
# CHECK: .debug_names contents:
# CHECK-NEXT: Name Index @ 0x0 {
# CHECK-NEXT: Header {
# CHECK-NEXT: Length: 0x60
# CHECK-NEXT: Format: DWARF32
# CHECK-NEXT: Version: 5
# CHECK-NEXT: CU count: 1
# CHECK-NEXT: Local TU count: 0
# CHECK-NEXT: Foreign TU count: 0
# CHECK-NEXT: Bucket count: 2
# CHECK-NEXT: Name count: 2
# CHECK-NEXT: Abbreviations table size: 0x7
# CHECK-NEXT: Augmentation: ''
# CHECK-NEXT: }
# CHECK-NEXT: Compilation Unit offsets [
# CHECK-NEXT: CU[0]: 0x00000000
# CHECK-NEXT: ]
# CHECK-NEXT: Abbreviations [
# CHECK-NEXT: Abbreviation 0x2e {
# CHECK-NEXT: Tag: DW_TAG_subprogram
# CHECK-NEXT: DW_IDX_die_offset: DW_FORM_ref4
# CHECK-NEXT: }
# CHECK-NEXT: ]
# CHECK-NEXT: Bucket 0 [
# CHECK-NEXT: EMPTY
# CHECK-NEXT: ]
# CHECK-NEXT: Bucket 1 [
# CHECK-NEXT: Name 1 {
# CHECK-NEXT: Hash: 0xB887389
# CHECK-NEXT: String: 0x00000000 "foo"
# CHECK-NEXT: Entry @ 0x4f {
# CHECK-NEXT: Abbrev: 0x2E
# CHECK-NEXT: Tag: DW_TAG_subprogram
# CHECK-NEXT: DW_IDX_die_offset: 0x00000001
# CHECK-NEXT: }
# CHECK-NEXT: }
# CHECK-NEXT: Name 2 {
# CHECK-NEXT: Hash: 0xB5063D0B
# CHECK-NEXT: String: 0x00000004 "_Z3foov"
# CHECK-NEXT: Entry @ 0x58 {
# CHECK-NEXT: Abbrev: 0x2E
# CHECK-NEXT: Tag: DW_TAG_subprogram
# CHECK-NEXT: DW_IDX_die_offset: 0x00000001
# CHECK-NEXT: }
# CHECK-NEXT: }
# CHECK-NEXT: ]
# CHECK-NEXT: }
# CHECK-NEXT: Name Index @ 0x64 {
# CHECK-NEXT: Header {
# CHECK-NEXT: Length: 0x44
# CHECK-NEXT: Format: DWARF32
# CHECK-NEXT: Version: 5
# CHECK-NEXT: CU count: 1
# CHECK-NEXT: Local TU count: 0
# CHECK-NEXT: Foreign TU count: 0
# CHECK-NEXT: Bucket count: 1
# CHECK-NEXT: Name count: 1
# CHECK-NEXT: Abbreviations table size: 0x7
# CHECK-NEXT: Augmentation: ''
# CHECK-NEXT: }
# CHECK-NEXT: Compilation Unit offsets [
# CHECK-NEXT: CU[0]: 0x00000002
# CHECK-NEXT: ]
# CHECK-NEXT: Abbreviations [
# CHECK-NEXT: Abbreviation 0x34 {
# CHECK-NEXT: Tag: DW_TAG_variable
# CHECK-NEXT: DW_IDX_die_offset: DW_FORM_ref4
# CHECK-NEXT: }
# CHECK-NEXT: ]
# CHECK-NEXT: Bucket 0 [
# CHECK-NEXT: Name 1 {
# CHECK-NEXT: Hash: 0xB8860BA
# CHECK-NEXT: String: 0x0000000c "bar"
# CHECK-NEXT: Entry @ 0xa3 {
# CHECK-NEXT: Abbrev: 0x34
# CHECK-NEXT: Tag: DW_TAG_variable
# CHECK-NEXT: DW_IDX_die_offset: 0x00000001
# CHECK-NEXT: }
# CHECK-NEXT: }
# CHECK-NEXT: ]
# CHECK-NEXT: }
# CHECK-NEXT: Name Index @ 0xac {
# CHECK-NEXT: Header {
# CHECK-NEXT: Length: 0x68
# CHECK-NEXT: Format: DWARF64
# CHECK-NEXT: Version: 5
# CHECK-NEXT: CU count: 1
# CHECK-NEXT: Local TU count: 1
# CHECK-NEXT: Foreign TU count: 1
# CHECK-NEXT: Bucket count: 1
# CHECK-NEXT: Name count: 1
# CHECK-NEXT: Abbreviations table size: 0x9
# CHECK-NEXT: Augmentation: ''
# CHECK-NEXT: }
# CHECK-NEXT: Compilation Unit offsets [
# CHECK-NEXT: CU[0]: 0xcc00cccccccc
# CHECK-NEXT: ]
# CHECK-NEXT: Local Type Unit offsets [
# CHECK-NEXT: LocalTU[0]: 0xaa00aaaaaaaa
# CHECK-NEXT: ]
# CHECK-NEXT: Foreign Type Unit signatures [
# CHECK-NEXT: ForeignTU[0]: 0xffffff00ffffffff
# CHECK-NEXT: ]
# CHECK-NEXT: Abbreviations [
# CHECK-NEXT: Abbreviation 0x1 {
# CHECK-NEXT: Tag: DW_TAG_base_type
# CHECK-NEXT: DW_IDX_type_unit: DW_FORM_data4
# CHECK-NEXT: DW_IDX_type_hash: DW_FORM_data8
# CHECK-NEXT: }
# CHECK-NEXT: ]
# CHECK-NEXT: Bucket 0 [
# CHECK-NEXT: Name 1 {
# CHECK-NEXT: Hash: 0xB887389
# CHECK-NEXT: String: 0x00000000 "foo"
# CHECK-NEXT: Entry @ 0x111 {
# CHECK-NEXT: Abbrev: 0x1
# CHECK-NEXT: Tag: DW_TAG_base_type
# CHECK-NEXT: DW_IDX_type_unit: 0x00000001
# CHECK-NEXT: DW_IDX_type_hash: 0x0000ff03ffffffff
# CHECK-NEXT: }
# CHECK-NEXT: }
# CHECK-NEXT: ]
# CHECK-NEXT: }