1 RUN: cat %p/../Inputs/basic.macho.x86_64 > %t1
2 RUN: dsymutil -f -oso-prepend-path=%p/.. %t1
3 RUN: llvm-dwarfdump -a %t1.dwarf | FileCheck %s
4 RUN: dsymutil -f -o %t2 -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64
5 RUN: llvm-dwarfdump -a %t2 | FileCheck %s
6 RUN: dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s --check-prefix=CHECK --check-prefix=BASIC
7 RUN: dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s --check-prefix=CHECK --check-prefix=ARCHIVE
8 RUN: dsymutil -dump-debug-map -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 | dsymutil -f -y -o - - | llvm-dwarfdump -a - | FileCheck %s --check-prefix=CHECK --check-prefix=BASIC
9 RUN: dsymutil -dump-debug-map -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 | dsymutil -f -o - -y - | llvm-dwarfdump -a - | FileCheck %s --check-prefix=CHECK --check-prefix=ARCHIVE
11 CHECK: file format Mach-O 64-bit x86-64
13 CHECK: debug_info contents
17 CHECK: DW_TAG_compile_unit
18 CHECK: DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
19 CHECK: DW_AT_language (DW_LANG_C99)
20 CHECK: DW_AT_name ("basic1.c")
21 CHECK: DW_AT_stmt_list (0x00000000)
22 CHECK: DW_AT_comp_dir ("/Inputs")
23 CHECK: DW_AT_low_pc (0x0000000100000ea0)
24 CHECK: DW_TAG_subprogram
25 CHECK: DW_AT_name ("main")
26 CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c")
27 CHECK: DW_AT_decl_line (23)
28 CHECK: DW_AT_prototyped (0x01)
29 CHECK: DW_AT_type (0x00000063
30 CHECK: DW_AT_external (0x01)
31 CHECK: DW_AT_accessibility (DW_ACCESS_public)
32 CHECK: DW_AT_low_pc (0x0000000100000ea0)
33 CHECK: DW_AT_high_pc (0x0000000100000ec4)
34 CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
35 CHECK: DW_TAG_formal_parameter
36 CHECK: DW_AT_name ("argc")
37 CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c")
38 CHECK: DW_AT_decl_line (23)
39 CHECK: DW_AT_type (0x00000063
40 CHECK: DW_AT_location (DW_OP_fbreg -8)
41 CHECK: DW_TAG_formal_parameter
42 CHECK: DW_AT_name ("argv")
43 CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c")
44 CHECK: DW_AT_decl_line (23)
45 CHECK: DW_AT_type (0x0000006a
46 CHECK: DW_AT_location (DW_OP_fbreg -16)
48 CHECK: DW_TAG_base_type
49 CHECK: DW_AT_name ("int")
50 CHECK: DW_AT_encoding (DW_ATE_signed)
51 CHECK: DW_AT_byte_size (0x04)
52 CHECK: DW_TAG_pointer_type
53 CHECK: DW_AT_type (0x0000006f
54 CHECK: DW_TAG_pointer_type
55 CHECK: DW_AT_type (0x00000074
56 CHECK: DW_TAG_const_type
57 CHECK: DW_AT_type (0x00000079
58 CHECK: DW_TAG_base_type
59 CHECK: DW_AT_name ("char")
60 CHECK: DW_AT_encoding (DW_ATE_signed_char)
61 CHECK: DW_AT_byte_size (0x01)
66 CHECK: DW_TAG_compile_unit
67 CHECK: DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
68 CHECK: DW_AT_name ("basic2.c")
69 CHECK: DW_AT_stmt_list (0x0000003f)
70 CHECK: DW_AT_comp_dir ("/Inputs")
71 CHECK: DW_AT_low_pc (0x0000000100000ed0)
72 CHECK: DW_TAG_base_type
73 CHECK: DW_AT_name ("int")
74 CHECK: DW_TAG_variable
75 CHECK: DW_AT_name ("private_int")
76 CHECK: DW_AT_type (0x000000a7
77 CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic2.c")
78 BASIC: DW_AT_location (DW_OP_addr 0x100001008)
79 ARCHIVE: DW_AT_location (DW_OP_addr 0x100001004)
80 CHECK: DW_TAG_variable
81 CHECK: DW_AT_name ("baz")
82 CHECK: DW_AT_type (0x000000a7
83 CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic2.c")
84 CHECK: DW_AT_location (DW_OP_addr 0x100001000)
85 CHECK: DW_TAG_subprogram
86 CHECK: DW_AT_name ("foo")
87 CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic2.c")
88 CHECK: DW_AT_type (0x000000a7
89 CHECK: DW_AT_low_pc (0x0000000100000ed0)
90 CHECK: DW_AT_high_pc (0x0000000100000f19)
91 CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
92 CHECK: DW_TAG_formal_parameter
93 CHECK: DW_AT_name ("arg")
94 CHECK: DW_AT_type (0x000000a7
95 CHECK: DW_AT_location (DW_OP_fbreg -4)
97 CHECK: DW_TAG_subprogram
98 CHECK: DW_AT_name ("inc")
99 CHECK: DW_AT_type (0x000000a7
100 CHECK: DW_AT_low_pc (0x0000000100000f20)
101 CHECK: DW_AT_high_pc (0x0000000100000f37)
102 CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
107 CHECK: DW_TAG_compile_unit
108 CHECK: DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
109 CHECK: DW_AT_name ("basic3.c")
110 CHECK: DW_AT_stmt_list (0x00000093)
111 CHECK: DW_AT_comp_dir ("/Inputs")
112 CHECK: DW_AT_low_pc (0x0000000100000f40)
113 CHECK: DW_TAG_variable
114 CHECK: DW_AT_name ("val")
115 CHECK: DW_AT_type (0x00000162
116 CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic3.c")
117 BASIC: DW_AT_location (DW_OP_addr 0x100001004)
118 ARCHIVE: DW_AT_location (DW_OP_addr 0x100001008)
119 CHECK: DW_TAG_volatile_type
120 CHECK: DW_AT_type (0x00000167
121 CHECK: DW_TAG_base_type
122 CHECK: DW_AT_name ("int")
123 CHECK: DW_TAG_subprogram
124 CHECK: DW_AT_name ("bar")
125 CHECK: DW_AT_type (0x00000167
126 CHECK: DW_AT_low_pc (0x0000000100000f40)
127 CHECK: DW_AT_high_pc (0x0000000100000f84)
128 CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
129 CHECK: DW_TAG_formal_parameter
130 CHECK: DW_AT_name ("arg")
131 CHECK: DW_AT_type (0x00000167
132 CHECK: DW_AT_location (DW_OP_fbreg -8)
134 CHECK: DW_TAG_subprogram
135 CHECK: DW_AT_name ("inc")
136 CHECK: DW_AT_type (0x00000167
137 CHECK: DW_AT_low_pc (0x0000000100000f90)
138 CHECK: DW_AT_high_pc (0x0000000100000fa9)
139 CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
143 CHECK-NOT: .debug_loc contents
145 CHECK:.debug_aranges contents:
146 CHECK-NEXT:Address Range Header: length = 0x0000002c, version = 0x0002, cu_offset = 0x00000000, addr_size = 0x08, seg_size = 0x00
147 CHECK-NEXT:[0x0000000100000ea0, 0x0000000100000ec4)
148 CHECK-NEXT:Address Range Header: length = 0x0000003c, version = 0x0002, cu_offset = 0x00000081, addr_size = 0x08, seg_size = 0x00
149 CHECK-NEXT:[0x0000000100000ed0, 0x0000000100000f19)
150 CHECK-NEXT:[0x0000000100000f20, 0x0000000100000f37)
151 CHECK-NEXT:Address Range Header: length = 0x0000003c, version = 0x0002, cu_offset = 0x00000126, addr_size = 0x08, seg_size = 0x00
152 CHECK-NEXT:[0x0000000100000f40, 0x0000000100000f84)
153 CHECK-NEXT:[0x0000000100000f90, 0x0000000100000fa9)
155 CHECK: .debug_line contents:
156 CHECK: file_names[ 1]:
157 CHECK-NEXT: name: "basic1.c"
158 CHECK-NEXT: dir_index: 0
159 CHECK: Address Line Column File ISA Discriminator Flags
160 CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
161 CHECK-NEXT: 0x0000000100000ea0 23 0 1 0 0 is_stmt
162 CHECK-NEXT: 0x0000000100000eb6 24 0 1 0 0 is_stmt prologue_end
163 CHECK-NEXT: 0x0000000100000ec4 24 0 1 0 0 is_stmt end_sequence
165 CHECK: file_names[ 1]:
166 CHECK-NEXT: name: "basic2.c"
167 CHECK-NEXT: dir_index: 0
168 CHECK: Address Line Column File ISA Discriminator Flags
169 CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
170 CHECK-NEXT: 0x0000000100000ed0 19 0 1 0 0 is_stmt
171 CHECK-NEXT: 0x0000000100000ee2 20 0 1 0 0 is_stmt prologue_end
172 CHECK-NEXT: 0x0000000100000f19 20 0 1 0 0 is_stmt end_sequence
173 CHECK-NEXT: 0x0000000100000f20 14 0 1 0 0 is_stmt
174 CHECK-NEXT: 0x0000000100000f24 15 0 1 0 0 is_stmt prologue_end
175 CHECK-NEXT: 0x0000000100000f37 15 0 1 0 0 is_stmt end_sequence
177 CHECK: file_names[ 1]:
178 CHECK-NEXT: name: "basic3.c"
179 CHECK-NEXT: dir_index: 0
180 CHECK: Address Line Column File ISA Discriminator Flags
181 CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
182 CHECK-NEXT: 0x0000000100000f40 16 0 1 0 0 is_stmt
183 CHECK-NEXT: 0x0000000100000f4b 17 0 1 0 0 is_stmt prologue_end
184 CHECK-NEXT: 0x0000000100000f58 18 0 1 0 0 is_stmt
185 CHECK-NEXT: 0x0000000100000f6c 19 0 1 0 0 is_stmt
186 CHECK-NEXT: 0x0000000100000f7b 20 0 1 0 0 is_stmt
187 CHECK-NEXT: 0x0000000100000f84 20 0 1 0 0 is_stmt end_sequence
188 CHECK-NEXT: 0x0000000100000f90 11 0 1 0 0 is_stmt
189 CHECK-NEXT: 0x0000000100000f9b 12 0 1 0 0 is_stmt prologue_end
190 CHECK-NEXT: 0x0000000100000fa9 12 0 1 0 0 is_stmt end_sequence
192 CHECK: .debug_pubnames contents:
193 CHECK-NEXT: length = 0x00000017 version = 0x0002 unit_offset = 0x00000000 unit_size = 0x00000081
194 CHECK-NEXT: Offset Name
195 CHECK-NEXT: 0x00000026 "main"
196 CHECK-NEXT: length = 0x00000036 version = 0x0002 unit_offset = 0x00000081 unit_size = 0x000000a5
197 CHECK-NEXT: Offset Name
198 CHECK-NEXT: 0x0000002d "private_int"
199 CHECK-NEXT: 0x00000042 "baz"
200 CHECK-NEXT: 0x00000057 "foo"
201 CHECK-NEXT: 0x00000086 "inc"
202 CHECK-NEXT: length = 0x00000026 version = 0x0002 unit_offset = 0x00000126 unit_size = 0x00000096
203 CHECK-NEXT: Offset Name
204 CHECK-NEXT: 0x00000026 "val"
205 CHECK-NEXT: 0x00000048 "bar"
206 CHECK-NEXT: 0x00000077 "inc"
208 CHECK: .debug_pubtypes contents:
209 CHECK-NEXT: length = 0x0000001f version = 0x0002 unit_offset = 0x00000000 unit_size = 0x00000081
210 CHECK-NEXT: Offset Name
211 CHECK-NEXT: 0x00000063 "int"
212 CHECK-NEXT: 0x00000079 "char"
213 CHECK-NEXT: length = 0x00000016 version = 0x0002 unit_offset = 0x00000081 unit_size = 0x000000a5
214 CHECK-NEXT: Offset Name
215 CHECK-NEXT: 0x00000026 "int"
216 CHECK-NEXT: length = 0x00000016 version = 0x0002 unit_offset = 0x00000126 unit_size = 0x00000096
217 CHECK-NEXT: Offset Name
218 CHECK-NEXT: 0x00000041 "int"