• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1RUN: dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-lto.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s
2RUN: dsymutil -oso-prepend-path=%p/.. -dump-debug-map %p/../Inputs/basic-lto.macho.x86_64 | dsymutil -f -o - -y - | llvm-dwarfdump -a - | FileCheck %s
3
4CHECK: file format Mach-O 64-bit x86-64
5
6CHECK: debug_info contents
7
8CHECK:  Compile Unit:
9
10CHECK:  DW_TAG_compile_unit
11CHECK:    DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
12CHECK:    DW_AT_language (DW_LANG_C99)
13CHECK:    DW_AT_name ("basic1.c")
14CHECK:    DW_AT_stmt_list (0x00000000)
15CHECK:    DW_AT_comp_dir ("/Inputs")
16CHECK:    DW_AT_low_pc (0x0000000100000f40)
17CHECK:    DW_TAG_subprogram
18CHECK:      DW_AT_name ("main")
19CHECK:      DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c")
20CHECK:      DW_AT_decl_line (23)
21CHECK:      DW_AT_prototyped (0x01)
22CHECK:      DW_AT_type (0x00000063
23CHECK:      DW_AT_external (0x01)
24CHECK:      DW_AT_accessibility (DW_ACCESS_public)
25CHECK:      DW_AT_low_pc (0x0000000100000f40)
26CHECK:      DW_AT_high_pc (0x0000000100000f4b)
27CHECK:      DW_AT_frame_base (DW_OP_reg6 RBP)
28CHECK:      DW_TAG_formal_parameter
29CHECK:        DW_AT_name ("argc")
30CHECK:        DW_AT_type (0x00000063
31CHECK:        DW_AT_location (DW_OP_reg5 RDI, DW_OP_piece 0x4)
32CHECK:      DW_TAG_formal_parameter
33CHECK:        DW_AT_name ("argv")
34CHECK:        DW_AT_type (0x0000006a
35CHECK:        DW_AT_location (DW_OP_reg4 RSI)
36CHECK:      NULL
37CHECK:    DW_TAG_base_type
38CHECK:      DW_AT_name ("int")
39CHECK:      DW_AT_encoding (DW_ATE_signed)
40CHECK:      DW_AT_byte_size (0x04)
41CHECK:    DW_TAG_pointer_type
42CHECK:      DW_AT_type (0x0000006f
43CHECK:    DW_TAG_pointer_type
44CHECK:      DW_AT_type (0x00000074
45CHECK:    DW_TAG_const_type
46CHECK:      DW_AT_type (0x00000079
47CHECK:    DW_TAG_base_type
48CHECK:      DW_AT_name ("char")
49CHECK:      DW_AT_encoding (DW_ATE_signed_char)
50CHECK:      DW_AT_byte_size (0x01)
51CHECK:    NULL
52
53CHECK:  Compile Unit:
54
55CHECK:  DW_TAG_compile_unit
56CHECK:    DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
57CHECK:    DW_AT_name ("basic2.c")
58CHECK:    DW_AT_stmt_list (0x0000003e)
59CHECK:    DW_AT_comp_dir ("/Inputs")
60CHECK:   DW_AT_low_pc (0x0000000100000f50)
61CHECK:    DW_TAG_variable
62CHECK:      DW_AT_name ("private_int")
63CHECK:      DW_AT_type (0x0000000000000063
64CHECK:      DW_AT_decl_file ("/Inputs{{[/\\]}}basic2.c")
65CHECK:      DW_AT_location (DW_OP_addr 0x100001008)
66CHECK:    DW_TAG_variable
67CHECK:      DW_AT_name ("baz")
68CHECK:      DW_AT_type (0x0000000000000063
69CHECK:      DW_AT_location (DW_OP_addr 0x100001000)
70CHECK:    DW_TAG_subprogram
71CHECK:      DW_AT_name ("foo")
72CHECK:      DW_AT_type (0x0000000000000063
73CHECK:      DW_AT_low_pc (0x0000000100000f50)
74CHECK:      DW_AT_high_pc (0x0000000100000f89)
75CHECK:      DW_AT_frame_base (DW_OP_reg6 RBP)
76CHECK:      DW_TAG_formal_parameter
77CHECK:        DW_AT_name ("arg")
78CHECK:        DW_AT_type (0x0000000000000063
79CHECK:        DW_AT_location (0x00000000
80CHECK:          [0x0000000100000f50, 0x0000000100000f5e): DW_OP_reg5 RDI, DW_OP_piece 0x4)
81CHECK:[[INC1:0x[0-9a-f]*]]{{.*}}DW_TAG_inlined_subroutine
82CHECK:        DW_AT_abstract_origin (0x00000128 "inc")
83CHECK:        DW_AT_low_pc (0x0000000100000f63)
84CHECK:        DW_AT_high_pc (0x0000000100000f72)
85CHECK:        DW_AT_call_line (20)
86CHECK:      NULL
87CHECK:    DW_TAG_subprogram
88CHECK:      DW_AT_name ("inc")
89CHECK:      DW_AT_type (0x0000000000000063
90CHECK:      DW_AT_inline (DW_INL_inlined)
91CHECK:    NULL
92
93CHECK:  Compile Unit:
94
95CHECK:  DW_TAG_compile_unit
96CHECK:    DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
97CHECK:    DW_AT_name ("basic3.c")
98CHECK:    DW_AT_stmt_list (0x0000007e)
99CHECK:    DW_AT_comp_dir ("/Inputs")
100CHECK:    DW_AT_low_pc (0x0000000100000f90)
101CHECK:    DW_TAG_variable
102CHECK:      DW_AT_name ("val")
103CHECK:      DW_AT_type (0x00000176
104CHECK:      DW_AT_decl_file ("/Inputs{{[/\\]}}basic3.c")
105CHECK:      DW_AT_location (DW_OP_addr 0x100001004)
106CHECK:    DW_TAG_volatile_type
107CHECK:      DW_AT_type (0x0000000000000063
108CHECK:    DW_TAG_subprogram
109CHECK:      DW_AT_name ("bar")
110CHECK:      DW_AT_type (0x0000000000000063
111CHECK:      DW_AT_low_pc (0x0000000100000f90)
112CHECK:      DW_AT_high_pc (0x0000000100000fb4)
113CHECK:      DW_AT_frame_base (DW_OP_reg6 RBP)
114CHECK:      DW_TAG_formal_parameter
115CHECK:        DW_AT_name ("arg")
116CHECK:        DW_AT_type (0x0000000000000063
117CHECK:        DW_AT_location (0x00000025
118CHECK:          [0x0000000100000f90, 0x0000000100000f9f): DW_OP_reg5 RDI, DW_OP_piece 0x4
119CHECK:          [0x0000000100000fa9, 0x0000000100000fad): DW_OP_reg5 RDI, DW_OP_piece 0x4)
120CHECK:      DW_TAG_lexical_block
121CHECK:        DW_AT_low_pc (0x0000000100000f94)
122CHECK:        DW_AT_high_pc (0x0000000100000fa7)
123CHECK:[[INC2:0x[0-9a-f]*]]{{.*}}DW_TAG_inlined_subroutine
124CHECK:          DW_AT_abstract_origin (0x000001d4 "inc")
125CHECK:          DW_AT_ranges (0x00000000
126CHECK:             [0x0000000100000f94, 0x0000000100000f9a)
127CHECK:             [0x0000000100000f9f, 0x0000000100000fa7))
128CHECK:        NULL
129CHECK:      NULL
130CHECK:    DW_TAG_subprogram
131CHECK:      DW_AT_name ("inc")
132CHECK:      DW_AT_type (0x0000000000000063
133CHECK:    NULL
134
135CHECK: .debug_loc contents:
136CHECK-NEXT: 0x00000000:
137CHECK-NEXT:              (0x0000000000000000, 0x000000000000000e): DW_OP_reg5 RDI, DW_OP_piece 0x4
138CHECK-NOT: :
139CHECK:      0x00000025:
140CHECK-NEXT:              (0x0000000000000000, 0x000000000000000f): DW_OP_reg5 RDI, DW_OP_piece 0x4
141CHECK-NEXT:              (0x0000000000000019, 0x000000000000001d): DW_OP_reg5 RDI, DW_OP_piece 0x4
142
143CHECK: .debug_aranges contents:
144CHECK-NEXT: Address Range Header: length = 0x0000002c, format = DWARF32, version = 0x0002, cu_offset = 0x00000000, addr_size = 0x08, seg_size = 0x00
145CHECK-NEXT: [0x0000000100000f40, 0x0000000100000f4b)
146CHECK-NEXT: Address Range Header: length = 0x0000002c, format = DWARF32, version = 0x0002, cu_offset = 0x00000081, addr_size = 0x08, seg_size = 0x00
147CHECK-NEXT: [0x0000000100000f50, 0x0000000100000f89)
148CHECK-NEXT: Address Range Header: length = 0x0000002c, format = DWARF32, version = 0x0002, cu_offset = 0x0000013a, addr_size = 0x08, seg_size = 0x00
149CHECK-NEXT: [0x0000000100000f90, 0x0000000100000fb4)
150
151
152CHECK: .debug_line contents
153CHECK: file_names[  1]:
154CHECK-NEXT: name: "basic1.c"
155CHECK-NEXT: dir_index: 0
156CHECK: 0x0000000100000f40     23      0      1   0             0  is_stmt
157CHECK: 0x0000000100000f44     24      0      1   0             0  is_stmt prologue_end
158CHECK: 0x0000000100000f4b     24      0      1   0             0  is_stmt end_sequence
159
160CHECK: file_names[  1]:
161CHECK-NEXT: name: "basic2.c"
162CHECK-NEXT: dir_index: 0
163CHECK: 0x0000000100000f50     19      0      1   0             0  is_stmt
164CHECK: 0x0000000100000f54     20      0      1   0             0  is_stmt prologue_end
165CHECK: 0x0000000100000f63     15      0      1   0             0  is_stmt
166CHECK: 0x0000000100000f72     20      0      1   0             0  is_stmt
167CHECK: 0x0000000100000f89     20      0      1   0             0  is_stmt end_sequence
168
169CHECK: file_names[  1]:
170CHECK-NEXT: name: "basic3.c"
171CHECK-NEXT: dir_index: 0
172CHECK: 0x0000000100000f90     16      0      1   0             0  is_stmt
173CHECK: 0x0000000100000f94     12      0      1   0             0  is_stmt prologue_end
174CHECK: 0x0000000100000f9a     17      0      1   0             0  is_stmt
175CHECK: 0x0000000100000f9f     12      0      1   0             0  is_stmt
176CHECK: 0x0000000100000fa7     20      0      1   0             0  is_stmt
177CHECK: 0x0000000100000fa9     19      0      1   0             0  is_stmt
178CHECK: 0x0000000100000fb2     20      0      1   0             0  is_stmt
179CHECK: 0x0000000100000fb4     20      0      1   0             0  is_stmt end_sequence
180
181CHECK: .debug_pubnames contents:
182CHECK-NEXT: length = 0x00000017, format = DWARF32, version = 0x0002, unit_offset = 0x00000000, unit_size = 0x00000081
183CHECK-NEXT: Offset     Name
184CHECK-NEXT: 0x00000026 "main"
185CHECK-NEXT: length = 0x0000002e, format = DWARF32, version = 0x0002, unit_offset = 0x00000081, unit_size = 0x000000b9
186CHECK-NEXT: Offset     Name
187CHECK-NEXT: 0x00000026 "private_int"
188CHECK-NEXT: 0x0000003f "baz"
189CHECK-NEXT: 0x00000058 "foo"
190CHECK-NEXT: length = 0x0000001e, format = DWARF32, version = 0x0002, unit_offset = 0x0000013a, unit_size = 0x000000ac
191CHECK-NEXT: Offset     Name
192CHECK-NEXT: 0x00000026 "val"
193CHECK-NEXT: 0x00000045 "bar"
194
195CHECK: .debug_pubtypes contents:
196CHECK-NEXT: length = 0x0000001f, format = DWARF32, version = 0x0002, unit_offset = 0x00000000, unit_size = 0x00000081
197CHECK-NEXT: Offset     Name
198CHECK-NEXT: 0x00000063 "int"
199CHECK-NEXT: 0x00000079 "char"
200
201CHECK: .apple_names contents:
202CHECK-NEXT: Header {
203CHECK-NEXT:   Magic: 0x48415348
204CHECK-NEXT:   Version: 0x1
205CHECK-NEXT:   Hash function: 0x0
206CHECK-NEXT:   Bucket count: 7
207CHECK-NEXT:   Hashes count: 7
208CHECK-NEXT:   HeaderData length: 12
209CHECK-NEXT: }
210CHECK-NEXT: DIE offset base: 0
211CHECK-NEXT: Number of atoms: 1
212CHECK-NEXT: Atoms [
213CHECK-NEXT:   Atom 0 {
214CHECK-NEXT:     Type: DW_ATOM_die_offset
215CHECK-NEXT:     Form: DW_FORM_data4
216CHECK-NEXT:   }
217CHECK-NEXT: ]
218CHECK-NEXT: Bucket 0 [
219CHECK-NEXT:   Hash 0xb8860c2 [
220CHECK-NEXT:     Name@0x74 {
221CHECK-NEXT:       String: 0x0000007e "baz"
222CHECK-NEXT:       Data 0 [
223CHECK-NEXT:         Atom[0]: 0x000000c0
224CHECK-NEXT:       ]
225CHECK-NEXT:     }
226CHECK-NEXT:   ]
227CHECK-NEXT:   Hash 0xb88801f [
228CHECK-NEXT:     Name@0x84 {
229CHECK-NEXT:       String: 0x0000008a "inc"
230CHECK-NEXT:       Data 0 [
231CHECK-NEXT:         Atom[0]: 0x00000110
232CHECK-NEXT:       ]
233CHECK-NEXT:       Data 1 [
234CHECK-NEXT:         Atom[0]: 0x000001c7
235CHECK-NEXT:       ]
236CHECK-NEXT:     }
237CHECK-NEXT:   ]
238CHECK-NEXT: ]
239CHECK-NEXT: Bucket 1 [
240CHECK-NEXT:   EMPTY
241CHECK-NEXT: ]
242CHECK-NEXT: Bucket 2 [
243CHECK-NEXT:   Hash 0xfed12c6a [
244CHECK-NEXT:     Name@0x98 {
245CHECK-NEXT:       String: 0x00000072 "private_int"
246CHECK-NEXT:       Data 0 [
247CHECK-NEXT:         Atom[0]: 0x000000a7
248CHECK-NEXT:       ]
249CHECK-NEXT:     }
250CHECK-NEXT:   ]
251CHECK-NEXT: ]
252CHECK-NEXT: Bucket 3 [
253CHECK-NEXT:   Hash 0xb88b5c8 [
254CHECK-NEXT:     Name@0xa8 {
255CHECK-NEXT:       String: 0x00000097 "val"
256CHECK-NEXT:       Data 0 [
257CHECK-NEXT:         Atom[0]: 0x00000160
258CHECK-NEXT:       ]
259CHECK-NEXT:     }
260CHECK-NEXT:   ]
261CHECK-NEXT:   Hash 0x7c9a7f6a [
262CHECK-NEXT:     Name@0xb8 {
263CHECK-NEXT:       String: 0x00000051 "main"
264CHECK-NEXT:       Data 0 [
265CHECK-NEXT:         Atom[0]: 0x00000026
266CHECK-NEXT:       ]
267CHECK-NEXT:     }
268CHECK-NEXT:   ]
269CHECK-NEXT: ]
270CHECK-NEXT: Bucket 4 [
271CHECK-NEXT:   EMPTY
272CHECK-NEXT: ]
273CHECK-NEXT: Bucket 5 [
274CHECK-NEXT:   Hash 0xb887389 [
275CHECK-NEXT:     Name@0xc8 {
276CHECK-NEXT:       String: 0x00000082 "foo"
277CHECK-NEXT:       Data 0 [
278CHECK-NEXT:         Atom[0]: 0x000000d9
279CHECK-NEXT:       ]
280CHECK-NEXT:     }
281CHECK-NEXT:   ]
282CHECK-NEXT: ]
283CHECK-NEXT: Bucket 6 [
284CHECK-NEXT:   Hash 0xb8860ba [
285CHECK-NEXT:     Name@0xd8 {
286CHECK-NEXT:       String: 0x0000009b "bar"
287CHECK-NEXT:       Data 0 [
288CHECK-NEXT:         Atom[0]: 0x0000017f
289CHECK-NEXT:       ]
290CHECK-NEXT:     }
291CHECK-NEXT:   ]
292CHECK-NEXT: ]
293
294CHECK: apple_types contents:
295CHECK-NEXT: Header {
296CHECK-NEXT:   Magic: 0x48415348
297CHECK-NEXT:   Version: 0x1
298CHECK-NEXT:   Hash function: 0x0
299CHECK-NEXT:   Bucket count: 2
300CHECK-NEXT:   Hashes count: 2
301CHECK-NEXT:   HeaderData length: 24
302CHECK-NEXT: }
303CHECK-NEXT: DIE offset base: 0
304CHECK-NEXT: Number of atoms: 4
305CHECK-NEXT: Atoms [
306CHECK-NEXT:   Atom 0 {
307CHECK-NEXT:     Type: DW_ATOM_die_offset
308CHECK-NEXT:     Form: DW_FORM_data4
309CHECK-NEXT:   }
310CHECK-NEXT:   Atom 1 {
311CHECK-NEXT:     Type: DW_ATOM_die_tag
312CHECK-NEXT:     Form: DW_FORM_data2
313CHECK-NEXT:   }
314CHECK-NEXT:   Atom 2 {
315CHECK-NEXT:     Type: DW_ATOM_type_flags
316CHECK-NEXT:     Form: DW_FORM_data1
317CHECK-NEXT:   }
318CHECK-NEXT:   Atom 3 {
319CHECK-NEXT:     Type: DW_ATOM_qual_name_hash
320CHECK-NEXT:     Form: DW_FORM_data4
321CHECK-NEXT:   }
322CHECK-NEXT: ]
323CHECK-NEXT: Bucket 0 [
324CHECK-NEXT:   Hash 0xb888030 [
325CHECK-NEXT:     Name@0x44 {
326CHECK-NEXT:       String: 0x00000060 "int"
327CHECK-NEXT:       Data 0 [
328CHECK-NEXT:         Atom[0]: 0x00000063
329CHECK-NEXT:         Atom[1]: 0x0024
330CHECK-NEXT:         Atom[2]: 0x00
331CHECK-NEXT:         Atom[3]: 0x0c3a28a4
332CHECK-NEXT:       ]
333CHECK-NEXT:     }
334CHECK-NEXT:   ]
335CHECK-NEXT: ]
336CHECK-NEXT: Bucket 1 [
337CHECK-NEXT:   Hash 0x7c952063 [
338CHECK-NEXT:     Name@0x5b {
339CHECK-NEXT:       String: 0x00000064 "char"
340CHECK-NEXT:       Data 0 [
341CHECK-NEXT:         Atom[0]: 0x00000079
342CHECK-NEXT:         Atom[1]: 0x0024
343CHECK-NEXT:         Atom[2]: 0x00
344CHECK-NEXT:         Atom[3]: 0x937bd757
345CHECK-NEXT:       ]
346CHECK-NEXT:     }
347CHECK-NEXT:   ]
348CHECK-NEXT: ]
349
350CHECK: .apple_namespaces contents:
351CHECK-NEXT: Header {
352CHECK-NEXT:   Magic: 0x48415348
353CHECK-NEXT:   Version: 0x1
354CHECK-NEXT:   Hash function: 0x0
355CHECK-NEXT:   Bucket count: 1
356CHECK-NEXT:   Hashes count: 0
357CHECK-NEXT:   HeaderData length: 12
358CHECK-NEXT: }
359CHECK-NEXT: DIE offset base: 0
360CHECK-NEXT: Number of atoms: 1
361CHECK-NEXT: Atoms [
362CHECK-NEXT:   Atom 0 {
363CHECK-NEXT:     Type: DW_ATOM_die_offset
364CHECK-NEXT:     Form: DW_FORM_data4
365CHECK-NEXT:   }
366CHECK-NEXT: ]
367CHECK-NEXT: Bucket 0 [
368CHECK-NEXT:   EMPTY
369CHECK-NEXT: ]
370
371CHECK: .apple_objc contents:
372CHECK-NEXT: Header {
373CHECK-NEXT:   Magic: 0x48415348
374CHECK-NEXT:   Version: 0x1
375CHECK-NEXT:   Hash function: 0x0
376CHECK-NEXT:   Bucket count: 1
377CHECK-NEXT:   Hashes count: 0
378CHECK-NEXT:   HeaderData length: 12
379CHECK-NEXT: }
380CHECK-NEXT: DIE offset base: 0
381CHECK-NEXT: Number of atoms: 1
382CHECK-NEXT: Atoms [
383CHECK-NEXT:   Atom 0 {
384CHECK-NEXT:     Type: DW_ATOM_die_offset
385CHECK-NEXT:     Form: DW_FORM_data4
386CHECK-NEXT:   }
387CHECK-NEXT: ]
388CHECK-NEXT: Bucket 0 [
389CHECK-NEXT:   EMPTY
390CHECK-NEXT: ]
391