1 ## For mach-o files we might have a universal (fat) mach-o file which
2 ## complicates the GSYM creation process as we need to be prepared to parse
3 ## more than one architecture. If no architectures are specified or more than
4 ## one architectures are specified on the command line, then all architectures
5 ## will be parsed and each GSYM file will have the architecture name appended
6 ## as an extension (.armv7 or .arm64). If a single architecture is specified,
7 ## then the GSYM file will be created in the normal location.
9 # RUN: yaml2obj %s -o %t
10 # RUN: llvm-gsymutil --convert %t --arch armv7 -o %t.armv7.gsym 2>&1 | FileCheck %s --check-prefix=ARMV7
11 # RUN: llvm-gsymutil --convert %t --arch arm64 -o %t.arm64.gsym 2>&1 | FileCheck %s --check-prefix=ARM64
12 # RUN: llvm-gsymutil --convert %t -o %t.gsym 2>&1 | FileCheck %s --check-prefix=FAT
14 # ARMV7: Input file: {{.*\.yaml\.tmp}}
15 # ARMV7-NEXT: Output file (armv7): {{.*\.yaml\.tmp\.armv7\.gsym}}
16 # ARMV7-NEXT: Loaded 1 functions from DWARF.
17 # ARMV7-NEXT: Loaded 1 functions from symbol table.
18 # ARMV7: Pruned 1 functions, ended with 1 total
20 # ARM64: Input file: {{.*\.yaml\.tmp}}
21 # ARM64-NEXT: Output file (arm64): {{.*\.yaml\.tmp\.arm64\.gsym}}
22 # ARM64-NEXT: Loaded 1 functions from DWARF.
23 # ARM64-NEXT: Loaded 1 functions from symbol table.
24 # ARM64: Pruned 1 functions, ended with 1 total
26 # FAT: Input file: {{.*\.yaml\.tmp}}
27 # FAT-NEXT: Output file (armv7): {{.*\.yaml\.tmp\.gsym\.armv7}}
28 # FAT-NEXT: Loaded 1 functions from DWARF.
29 # FAT-NEXT: Loaded 1 functions from symbol table.
30 # FAT: Pruned 1 functions, ended with 1 total
31 # FAT-NEXT: Output file (arm64): {{.*\.yaml\.tmp\.gsym\.arm64}}
32 # FAT-NEXT: Loaded 1 functions from DWARF.
33 # FAT-NEXT: Loaded 1 functions from symbol table.
34 # FAT: Pruned 1 functions, ended with 1 total
42 cpusubtype: 0x00000009
43 offset: 0x0000000000000040
47 cpusubtype: 0x00000000
48 offset: 0x0000000000002300
56 cpusubtype: 0x00000009
64 uuid: 7B08A997-C561-3D42-B774-0C3CD02345C7
96 addr: 0x000000000000BFF0
103 reserved1: 0x00000000
104 reserved2: 0x00000000
105 reserved3: 0x00000000
106 content: CEFAEDFE0C000000090000000A000000
130 - sectname: __debug_line
132 addr: 0x000000000000D000
139 reserved1: 0x00000000
140 reserved2: 0x00000000
141 reserved3: 0x00000000
142 - sectname: __debug_pubnames
144 addr: 0x000000000000D03B
151 reserved1: 0x00000000
152 reserved2: 0x00000000
153 reserved3: 0x00000000
154 - sectname: __debug_pubtypes
156 addr: 0x000000000000D056
163 reserved1: 0x00000000
164 reserved2: 0x00000000
165 reserved3: 0x00000000
166 - sectname: __debug_aranges
168 addr: 0x000000000000D079
175 reserved1: 0x00000000
176 reserved2: 0x00000000
177 reserved3: 0x00000000
178 - sectname: __debug_info
180 addr: 0x000000000000D099
187 reserved1: 0x00000000
188 reserved2: 0x00000000
189 reserved3: 0x00000000
190 - sectname: __debug_abbrev
192 addr: 0x000000000000D110
199 reserved1: 0x00000000
200 reserved2: 0x00000000
201 reserved3: 0x00000000
202 - sectname: __debug_str
204 addr: 0x000000000000D167
211 reserved1: 0x00000000
212 reserved2: 0x00000000
213 reserved3: 0x00000000
214 - sectname: __apple_names
216 addr: 0x000000000000D1BE
223 reserved1: 0x00000000
224 reserved2: 0x00000000
225 reserved3: 0x00000000
226 content: 485341480100000001000000010000000C000000000000000100000001000600000000006A7F9A7C2C0000003F000000010000002600000000000000
227 - sectname: __apple_namespac
229 addr: 0x000000000000D1FA
236 reserved1: 0x00000000
237 reserved2: 0x00000000
238 reserved3: 0x00000000
239 content: 485341480100000001000000000000000C000000000000000100000001000600FFFFFFFF
240 - sectname: __apple_types
242 addr: 0x000000000000D21E
249 reserved1: 0x00000000
250 reserved2: 0x00000000
251 reserved3: 0x00000000
252 content: 48534148010000000200000002000000180000000000000004000000010006000300050005000B000600060000000000010000003080880B6320957C440000005B0000004E0000000100000059000000240000A4283A0C0000000052000000010000006F00000024000057D77B9300000000
253 - sectname: __apple_objc
255 addr: 0x000000000000D290
262 reserved1: 0x00000000
263 reserved2: 0x00000000
264 reserved3: 0x00000000
265 content: 485341480100000001000000000000000C000000000000000100000001000600FFFFFFFF
281 - __mh_execute_header
286 - 'Apple clang version 11.0.0 (clang-1100.0.33.17)'
297 Tag: DW_TAG_compile_unit
298 Children: DW_CHILDREN_yes
300 - Attribute: DW_AT_producer
302 - Attribute: DW_AT_language
304 - Attribute: DW_AT_name
306 - Attribute: DW_AT_stmt_list
307 Form: DW_FORM_sec_offset
308 - Attribute: DW_AT_comp_dir
310 - Attribute: DW_AT_GNU_pubnames
311 Form: DW_FORM_flag_present
312 - Attribute: DW_AT_low_pc
314 - Attribute: DW_AT_high_pc
317 Tag: DW_TAG_subprogram
318 Children: DW_CHILDREN_yes
320 - Attribute: DW_AT_low_pc
322 - Attribute: DW_AT_high_pc
324 - Attribute: DW_AT_frame_base
325 Form: DW_FORM_exprloc
326 - Attribute: DW_AT_name
328 - Attribute: DW_AT_decl_file
330 - Attribute: DW_AT_decl_line
332 - Attribute: DW_AT_type
333 Form: DW_FORM_ref_addr
334 - Attribute: DW_AT_external
335 Form: DW_FORM_flag_present
336 - Attribute: DW_AT_APPLE_isa
339 Tag: DW_TAG_formal_parameter
340 Children: DW_CHILDREN_no
342 - Attribute: DW_AT_location
343 Form: DW_FORM_exprloc
344 - Attribute: DW_AT_name
346 - Attribute: DW_AT_decl_file
348 - Attribute: DW_AT_decl_line
350 - Attribute: DW_AT_type
351 Form: DW_FORM_ref_addr
353 Tag: DW_TAG_base_type
354 Children: DW_CHILDREN_no
356 - Attribute: DW_AT_name
358 - Attribute: DW_AT_encoding
360 - Attribute: DW_AT_byte_size
363 Tag: DW_TAG_pointer_type
364 Children: DW_CHILDREN_no
366 - Attribute: DW_AT_type
367 Form: DW_FORM_ref_addr
369 Tag: DW_TAG_const_type
370 Children: DW_CHILDREN_no
372 - Attribute: DW_AT_type
373 Form: DW_FORM_ref_addr
379 SegmentSelectorSize: 0
381 - Address: 0x000000000000BFF0
389 - DieOffset: 0x00000026
397 - DieOffset: 0x00000059
399 - DieOffset: 0x0000006F
405 - AbbrCode: 0x00000001
407 - Value: 0x0000000000000001
408 - Value: 0x0000000000000004
409 - Value: 0x0000000000000031
410 - Value: 0x0000000000000000
411 - Value: 0x000000000000003A
412 - Value: 0x0000000000000001
413 - Value: 0x000000000000BFF0
414 - Value: 0x0000000000000010
415 - AbbrCode: 0x00000002
417 - Value: 0x000000000000BFF0
418 - Value: 0x0000000000000010
419 - Value: 0x0000000000000001
421 - Value: 0x000000000000003F
422 - Value: 0x0000000000000001
423 - Value: 0x0000000000000001
424 - Value: 0x0000000000000059
425 - Value: 0x0000000000000001
426 - Value: 0x0000000000000001
427 - AbbrCode: 0x00000003
429 - Value: 0x0000000000000002
430 BlockData: [ 0x7D, 0x04 ]
431 - Value: 0x0000000000000044
432 - Value: 0x0000000000000001
433 - Value: 0x0000000000000001
434 - Value: 0x0000000000000059
435 - AbbrCode: 0x00000003
437 - Value: 0x0000000000000002
438 BlockData: [ 0x7D, 0x00 ]
439 - Value: 0x0000000000000049
440 - Value: 0x0000000000000001
441 - Value: 0x0000000000000001
442 - Value: 0x0000000000000060
443 - AbbrCode: 0x00000000
444 - AbbrCode: 0x00000004
446 - Value: 0x000000000000004E
447 - Value: 0x0000000000000005
448 - Value: 0x0000000000000004
449 - AbbrCode: 0x00000005
451 - Value: 0x0000000000000065
452 - AbbrCode: 0x00000005
454 - Value: 0x000000000000006A
455 - AbbrCode: 0x00000006
457 - Value: 0x000000000000006F
458 - AbbrCode: 0x00000004
460 - Value: 0x0000000000000052
461 - Value: 0x0000000000000006
462 - Value: 0x0000000000000001
463 - AbbrCode: 0x00000000
474 StandardOpcodeLengths: [ 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 ]
481 - Opcode: DW_LNS_extended_op
483 SubOpcode: DW_LNE_set_address
485 - Opcode: DW_LNS_copy
487 - Opcode: DW_LNS_set_column
489 - Opcode: DW_LNS_set_prologue_end
493 - Opcode: DW_LNS_advance_pc
495 - Opcode: DW_LNS_extended_op
497 SubOpcode: DW_LNE_end_sequence
503 cpusubtype: 0x00000000
512 uuid: E74896D8-32D6-3EB2-BB23-4AA9A0F54CB2
513 - cmd: LC_BUILD_VERSION
550 addr: 0x0000000100007F9C
557 reserved1: 0x00000000
558 reserved2: 0x00000000
559 reserved3: 0x00000000
560 content: CFFAEDFE0C000001000000000A000000070000007805000000000000
561 - sectname: __unwind_info
563 addr: 0x0000000100007FB8
570 reserved1: 0x00000000
571 reserved2: 0x00000000
572 reserved3: 0x00000000
573 content: CFFAEDFE0C000001000000000A000000070000007805000000000000000000001B00000018000000E74896D832D63EB2BB234AA9A0F54CB232000000180000000200000000020D00
597 - sectname: __debug_line
599 addr: 0x0000000100009000
606 reserved1: 0x00000000
607 reserved2: 0x00000000
608 reserved3: 0x00000000
609 - sectname: __debug_pubnames
611 addr: 0x000000010000903F
618 reserved1: 0x00000000
619 reserved2: 0x00000000
620 reserved3: 0x00000000
621 - sectname: __debug_pubtypes
623 addr: 0x000000010000905A
630 reserved1: 0x00000000
631 reserved2: 0x00000000
632 reserved3: 0x00000000
633 - sectname: __debug_aranges
635 addr: 0x000000010000907D
642 reserved1: 0x00000000
643 reserved2: 0x00000000
644 reserved3: 0x00000000
645 - sectname: __debug_info
647 addr: 0x00000001000090AD
654 reserved1: 0x00000000
655 reserved2: 0x00000000
656 reserved3: 0x00000000
657 - sectname: __debug_abbrev
659 addr: 0x000000010000912B
666 reserved1: 0x00000000
667 reserved2: 0x00000000
668 reserved3: 0x00000000
669 - sectname: __debug_str
671 addr: 0x000000010000917F
678 reserved1: 0x00000000
679 reserved2: 0x00000000
680 reserved3: 0x00000000
681 - sectname: __apple_names
683 addr: 0x00000001000091D6
690 reserved1: 0x00000000
691 reserved2: 0x00000000
692 reserved3: 0x00000000
693 content: 485341480100000001000000010000000C000000000000000100000001000600000000006A7F9A7C2C0000003F000000010000002A00000000000000
694 - sectname: __apple_namespac
696 addr: 0x0000000100009212
703 reserved1: 0x00000000
704 reserved2: 0x00000000
705 reserved3: 0x00000000
706 content: 485341480100000001000000000000000C000000000000000100000001000600FFFFFFFF
707 - sectname: __apple_types
709 addr: 0x0000000100009236
716 reserved1: 0x00000000
717 reserved2: 0x00000000
718 reserved3: 0x00000000
719 content: 48534148010000000200000002000000180000000000000004000000010006000300050005000B000600060000000000010000003080880B6320957C440000005B0000004E0000000100000060000000240000A4283A0C0000000052000000010000007600000024000057D77B9300000000
720 - sectname: __apple_objc
722 addr: 0x00000001000092A8
729 reserved1: 0x00000000
730 reserved2: 0x00000000
731 reserved3: 0x00000000
732 content: 485341480100000001000000000000000C000000000000000100000001000600FFFFFFFF
748 - __mh_execute_header
753 - 'Apple clang version 11.0.0 (clang-1100.0.33.17)'
764 Tag: DW_TAG_compile_unit
765 Children: DW_CHILDREN_yes
767 - Attribute: DW_AT_producer
769 - Attribute: DW_AT_language
771 - Attribute: DW_AT_name
773 - Attribute: DW_AT_stmt_list
774 Form: DW_FORM_sec_offset
775 - Attribute: DW_AT_comp_dir
777 - Attribute: DW_AT_GNU_pubnames
778 Form: DW_FORM_flag_present
779 - Attribute: DW_AT_low_pc
781 - Attribute: DW_AT_high_pc
784 Tag: DW_TAG_subprogram
785 Children: DW_CHILDREN_yes
787 - Attribute: DW_AT_low_pc
789 - Attribute: DW_AT_high_pc
791 - Attribute: DW_AT_frame_base
792 Form: DW_FORM_exprloc
793 - Attribute: DW_AT_name
795 - Attribute: DW_AT_decl_file
797 - Attribute: DW_AT_decl_line
799 - Attribute: DW_AT_type
800 Form: DW_FORM_ref_addr
801 - Attribute: DW_AT_external
802 Form: DW_FORM_flag_present
804 Tag: DW_TAG_formal_parameter
805 Children: DW_CHILDREN_no
807 - Attribute: DW_AT_location
808 Form: DW_FORM_exprloc
809 - Attribute: DW_AT_name
811 - Attribute: DW_AT_decl_file
813 - Attribute: DW_AT_decl_line
815 - Attribute: DW_AT_type
816 Form: DW_FORM_ref_addr
818 Tag: DW_TAG_base_type
819 Children: DW_CHILDREN_no
821 - Attribute: DW_AT_name
823 - Attribute: DW_AT_encoding
825 - Attribute: DW_AT_byte_size
828 Tag: DW_TAG_pointer_type
829 Children: DW_CHILDREN_no
831 - Attribute: DW_AT_type
832 Form: DW_FORM_ref_addr
834 Tag: DW_TAG_const_type
835 Children: DW_CHILDREN_no
837 - Attribute: DW_AT_type
838 Form: DW_FORM_ref_addr
844 SegmentSelectorSize: 0
846 - Address: 0x0000000100007F9C
854 - DieOffset: 0x0000002A
862 - DieOffset: 0x00000060
864 - DieOffset: 0x00000076
872 - AbbrCode: 0x00000001
874 - Value: 0x0000000000000001
875 - Value: 0x0000000000000004
876 - Value: 0x0000000000000031
877 - Value: 0x0000000000000000
878 - Value: 0x000000000000003A
879 - Value: 0x0000000000000001
880 - Value: 0x0000000100007F9C
881 - Value: 0x000000000000001C
882 - AbbrCode: 0x00000002
884 - Value: 0x0000000100007F9C
885 - Value: 0x000000000000001C
886 - Value: 0x0000000000000001
888 - Value: 0x000000000000003F
889 - Value: 0x0000000000000001
890 - Value: 0x0000000000000001
891 - Value: 0x0000000000000060
892 - Value: 0x0000000000000001
893 - AbbrCode: 0x00000003
895 - Value: 0x0000000000000002
896 BlockData: [ 0x91, 0x08 ]
897 - Value: 0x0000000000000044
898 - Value: 0x0000000000000001
899 - Value: 0x0000000000000001
900 - Value: 0x0000000000000060
901 - AbbrCode: 0x00000003
903 - Value: 0x0000000000000002
904 BlockData: [ 0x91, 0x00 ]
905 - Value: 0x0000000000000049
906 - Value: 0x0000000000000001
907 - Value: 0x0000000000000001
908 - Value: 0x0000000000000067
909 - AbbrCode: 0x00000000
911 - AbbrCode: 0x00000004
913 - Value: 0x000000000000004E
914 - Value: 0x0000000000000005
915 - Value: 0x0000000000000004
916 - AbbrCode: 0x00000005
918 - Value: 0x000000000000006C
919 - AbbrCode: 0x00000005
921 - Value: 0x0000000000000071
922 - AbbrCode: 0x00000006
924 - Value: 0x0000000000000076
925 - AbbrCode: 0x00000004
927 - Value: 0x0000000000000052
928 - Value: 0x0000000000000006
929 - Value: 0x0000000000000001
930 - AbbrCode: 0x00000000
942 StandardOpcodeLengths: [ 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 ]
949 - Opcode: DW_LNS_extended_op
951 SubOpcode: DW_LNE_set_address
953 - Opcode: DW_LNS_copy
955 - Opcode: DW_LNS_set_column
957 - Opcode: DW_LNS_set_prologue_end
961 - Opcode: DW_LNS_advance_pc
963 - Opcode: DW_LNS_extended_op
965 SubOpcode: DW_LNE_end_sequence