1 ## a) Test that obj2yaml is able to dump the __debug_str section.
3 # RUN: yaml2obj --docnum=1 %s | obj2yaml | FileCheck %s
18 uuid: 9304404B-E522-3BBA-A861-AF5938908725
50 addr: 0x0000000100000FA0
60 - sectname: __unwind_info
62 addr: 0x0000000100000FB8
95 - sectname: __debug_line
97 addr: 0x0000000100002000
104 reserved1: 0x00000000
105 reserved2: 0x00000000
106 reserved3: 0x00000000
107 - sectname: __debug_pubnames
109 addr: 0x0000000100002046
116 reserved1: 0x00000000
117 reserved2: 0x00000000
118 reserved3: 0x00000000
119 - sectname: __debug_pubtypes
121 addr: 0x0000000100002061
128 reserved1: 0x00000000
129 reserved2: 0x00000000
130 reserved3: 0x00000000
131 - sectname: __debug_info
133 addr: 0x00000001000020B4
140 reserved1: 0x00000000
141 reserved2: 0x00000000
142 reserved3: 0x00000000
143 - sectname: __debug_abbrev
145 addr: 0x000000010000212D
152 reserved1: 0x00000000
153 reserved2: 0x00000000
154 reserved3: 0x00000000
155 - sectname: __debug_str
157 addr: 0x0000000100002179
164 reserved1: 0x00000000
165 reserved2: 0x00000000
166 reserved3: 0x00000000
167 - sectname: __apple_names
169 addr: 0x0000000100002207
176 reserved1: 0x00000000
177 reserved2: 0x00000000
178 reserved3: 0x00000000
179 - sectname: __apple_namespac
181 addr: 0x0000000100002243
188 reserved1: 0x00000000
189 reserved2: 0x00000000
190 reserved3: 0x00000000
191 - sectname: __apple_types
193 addr: 0x0000000100002267
200 reserved1: 0x00000000
201 reserved2: 0x00000000
202 reserved3: 0x00000000
203 - sectname: __apple_objc
205 addr: 0x00000001000022D9
212 reserved1: 0x00000000
213 reserved2: 0x00000000
214 reserved3: 0x00000000
230 - __mh_execute_header
235 - 'clang version 4.0.0 (trunk 288677) (llvm/trunk 288676)'
237 - /Users/cbieneman/dev/open-source/llvm-build-rel
248 #CHECK: - 'clang version 4.0.0 (trunk 288677) (llvm/trunk 288676)'
249 #CHECK: - hello_world.c
250 #CHECK: - '/Users/cbieneman/dev/open-source/llvm-build-rel'
257 ## b) Test dumping an empty __debug_str section.
259 # RUN: yaml2obj --docnum=2 -DCONTENT='[]' %s | obj2yaml | FileCheck %s --check-prefix=EMPTY-CONTENT
261 # EMPTY-CONTENT: Sections:
262 # EMPTY-CONTENT-NEXT: - sectname: __debug_str
263 # EMPTY-CONTENT-NEXT: segname: __DWARF
264 # EMPTY-CONTENT-NEXT: addr: 0x0
265 # EMPTY-CONTENT-NEXT: size: 0
266 # EMPTY-CONTENT-NEXT: offset: 0x210
267 # EMPTY-CONTENT-NEXT: align: 0
268 # EMPTY-CONTENT-NEXT: reloff: 0x0
269 # EMPTY-CONTENT-NEXT: nreloc: 0
270 # EMPTY-CONTENT-NEXT: flags: 0x0
271 # EMPTY-CONTENT-NEXT: reserved1: 0x0
272 # EMPTY-CONTENT-NEXT: reserved2: 0x0
273 # EMPTY-CONTENT-NEXT: reserved3: 0x0
274 # EMPTY-CONTENT-NEXT: DWARF:
275 # EMPTY-CONTENT-NEXT: debug_str: []
281 cpusubtype: 0x00000003
300 - sectname: __debug_str
309 reserved1: 0x00000000
310 reserved2: 0x00000000
311 reserved3: 0x00000000
316 ## c) Test generating and dumping a __debug_str section who only has an empty string.
318 # RUN: yaml2obj --docnum=2 -DCONTENT='[ "" ]' -DSIZE=1 %s | obj2yaml | FileCheck %s --check-prefix=EMPTY-STRING
320 # EMPTY-STRING: DWARF:
321 # EMPTY-STRING-NEXT: debug_str:
322 # EMPTY-STRING-NEXT: - ''
323 # EMPTY-STRING-NEXT: ...
325 ## d) Test generating and dumping a __debug_str section which contains a string without a null terminator.
327 # RUN: yaml2obj --docnum=3 %s | obj2yaml | FileCheck %s --check-prefix=NO-TERMINATOR
329 # NO-TERMINATOR-NOT: DWARF:
330 # NO-TERMINATOR: Sections:
331 # NO-TERMINATOR-NEXT: - sectname: __debug_str
332 # NO-TERMINATOR-NEXT: segname: __DWARF
333 # NO-TERMINATOR-NEXT: addr: 0x0
334 # NO-TERMINATOR-NEXT: size: 7
335 # NO-TERMINATOR-NEXT: offset: 0x210
336 # NO-TERMINATOR-NEXT: align: 0
337 # NO-TERMINATOR-NEXT: reloff: 0x0
338 # NO-TERMINATOR-NEXT: nreloc: 0
339 # NO-TERMINATOR-NEXT: flags: 0x0
340 # NO-TERMINATOR-NEXT: reserved1: 0x0
341 # NO-TERMINATOR-NEXT: reserved2: 0x0
342 # NO-TERMINATOR-NEXT: reserved3: 0x0
343 # NO-TERMINATOR-NEXT: content: '61626300616263'
344 # NO-TERMINATOR-NEXT: ...
350 cpusubtype: 0x00000003
369 - sectname: __debug_str
378 reserved1: 0x00000000
379 reserved2: 0x00000000
380 reserved3: 0x00000000
381 content: '61626300616263' ## "abc\0abc"