1 REQUIRES: system-darwin
3 RUN: dsymutil --symbol-map %p/../Inputs/obfuscated.map %p/../Inputs/obfuscated.arm64 -f -o - \
4 RUN: | llvm-dwarfdump -v - \
7 RUN: dsymutil --accelerator=Pub --symbol-map %p/../Inputs/obfuscated.map %p/../Inputs/obfuscated.arm64 -f -o - \
8 RUN: | llvm-dwarfdump -v - \
9 RUN: | FileCheck --check-prefix=PUB %s
11 RUN: dsymutil --symbol-map %p/../Inputs/obfuscated.map %p/../Inputs/obfuscated.arm64 -f -o - \
12 RUN: | llvm-dwarfdump -v - \
13 RUN: | FileCheck --check-prefix=NOHIDDEN %s
15 RUN: dsymutil --symbol-map %p/../Inputs/obfuscated.2.map %p/../Inputs/obfuscated.2.arm64 -f -o - \
16 RUN: | llvm-dwarfdump -v - \
17 RUN: | FileCheck --check-prefix=NOHIDDEN %s
19 // Run with plist and make sure dsymutil finds it.
20 RUN: mkdir -p %t.dSYM/Contents/Resources/DWARF/
21 RUN: mkdir -p %t.mapdir
22 RUN: cp %p/../Inputs/obfuscated.arm64 %t.dSYM/Contents/Resources/DWARF/
23 RUN: cp %p/../Inputs/E828A486-8433-3A5E-B6DB-A6294D28133D.plist %t.dSYM/Contents/Resources/
24 RUN: cp %p/../Inputs/obfuscated.map %t.mapdir/506AA50A-6B26-3B37-86D2-DC6EBD57B720.bcsymbolmap
25 RUN: dsymutil --symbol-map %t.mapdir %t.dSYM 2>&1 | FileCheck --check-prefix=OBFUSCATING %s
27 // Run without plist and make sure dsymutil doesn't crash.
28 RUN: rm %t.dSYM/Contents/Resources/E828A486-8433-3A5E-B6DB-A6294D28133D.plist
29 RUN: dsymutil --symbol-map %t.mapdir %t.dSYM 2>&1 | FileCheck --check-prefix=NOTOBFUSCATING %s
31 OBFUSCATING-NOT: not unobfuscating
33 NOTOBFUSCATING: not unobfuscating
35 NOHIDDEN-NOT: __hidden#
37 CHECK: .debug_info contents:
39 CHECK: DW_TAG_compile_unit [1] *
40 CHECK: DW_AT_producer [DW_FORM_strp] ( {{.*}} "Apple LLVM version 7.0.0 (clang-700.2.38.2)")
41 CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "main.c")
42 CHECK: DW_AT_comp_dir [DW_FORM_strp] ( {{.*}} "/Users/steven/dev/alpena/tests/src")
43 CHECK: DW_TAG_subprogram [2]
44 CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "main")
46 CHECK: DW_TAG_compile_unit [1] *
47 CHECK: DW_AT_producer [DW_FORM_strp] ( {{.*}} "Apple LLVM version 7.0.0 (clang-700.2.38.2)")
48 CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "one.c")
49 CHECK: DW_AT_comp_dir [DW_FORM_strp] ( {{.*}} "/Users/steven/dev/alpena/tests/src")
50 CHECK: DW_TAG_subprogram [2]
51 CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "one")
53 CHECK: DW_TAG_compile_unit [1] *
54 CHECK: DW_AT_producer [DW_FORM_strp] ( {{.*}} "Apple LLVM version 7.0.0 (clang-700.2.38.2)")
55 CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "two.c")
56 CHECK: DW_AT_comp_dir [DW_FORM_strp] ( {{.*}} "/Users/steven/dev/alpena/tests/src")
57 CHECK: DW_TAG_subprogram [2]
58 CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "two")
60 CHECK: DW_TAG_compile_unit [1] *
61 CHECK: DW_AT_producer [DW_FORM_strp] ( {{.*}} "Apple LLVM version 7.0.0 (clang-700.2.38.2)")
62 CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "three.c")
63 CHECK: DW_AT_comp_dir [DW_FORM_strp] ( {{.*}} "/Users/steven/dev/alpena/tests/src")
64 CHECK: DW_TAG_subprogram [2]
65 CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "three")
67 CHECK: DW_TAG_compile_unit [1] *
68 CHECK: DW_AT_producer [DW_FORM_strp] ( {{.*}} "Apple LLVM version 7.0.0 (clang-700.2.38.2)")
69 CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "four.c")
70 CHECK: DW_AT_stmt_list [DW_FORM_data4] (0x0000011e)
71 CHECK: DW_AT_comp_dir [DW_FORM_strp] ( {{.*}} "/Users/steven/dev/alpena/tests/src")
72 CHECK: DW_TAG_subprogram [2]
73 CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "four")
75 CHECK: DW_TAG_compile_unit [1] *
76 CHECK: DW_AT_producer [DW_FORM_strp] ( {{.*}} "Apple LLVM version 7.0.0 (clang-700.2.38.2)")
77 CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "five.c")
78 CHECK: DW_AT_comp_dir [DW_FORM_strp] ( {{.*}} "/Users/steven/dev/alpena/tests/src")
79 CHECK: DW_TAG_subprogram [2]
80 CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "five")
82 CHECK: DW_TAG_compile_unit [1] *
83 CHECK: DW_AT_producer [DW_FORM_strp] ( {{.*}} "Apple LLVM version 7.0.0 (clang-700.2.38.2)")
84 CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "six.c")
85 CHECK: DW_AT_comp_dir [DW_FORM_strp] ( {{.*}} "/Users/steven/dev/alpena/tests/src")
86 CHECK: DW_TAG_subprogram [2]
87 CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "six")
89 CHECK: .debug_line contents:
90 CHECK: file_names[ 1]:
93 CHECK: mod_time: 0x00000000
94 CHECK: file_names[ 1]:
97 CHECK: mod_time: 0x00000000
98 CHECK: length: 0x00000000
99 CHECK: file_names[ 1]:
102 CHECK: mod_time: 0x00000000
103 CHECK: length: 0x00000000
104 CHECK: file_names[ 1]:
105 CHECK: name: "three.c"
107 CHECK: mod_time: 0x00000000
108 CHECK: length: 0x00000000
109 CHECK: file_names[ 1]:
110 CHECK: name: "four.c"
112 CHECK: mod_time: 0x00000000
113 CHECK: length: 0x00000000
114 CHECK: file_names[ 1]:
115 CHECK: name: "five.c"
117 CHECK: mod_time: 0x00000000
118 CHECK: length: 0x00000000
119 CHECK: file_names[ 1]:
122 CHECK: mod_time: 0x00000000
123 CHECK: length: 0x00000000
125 PUB: .debug_pubnames contents:
126 PUB: length = 0x00000017, format = DWARF32, version = 0x0002, unit_offset = 0x00000000, unit_size = 0x00000044
127 PUB: 0x0000002e "main"
128 PUB: length = 0x00000016, format = DWARF32, version = 0x0002, unit_offset = 0x00000044, unit_size = 0x00000044
129 PUB: 0x0000002e "one"
130 PUB: length = 0x00000016, format = DWARF32, version = 0x0002, unit_offset = 0x00000088, unit_size = 0x00000044
131 PUB: 0x0000002e "two"
132 PUB: length = 0x00000018, format = DWARF32, version = 0x0002, unit_offset = 0x000000cc, unit_size = 0x00000044
133 PUB: 0x0000002e "three"
134 PUB: length = 0x00000017, format = DWARF32, version = 0x0002, unit_offset = 0x00000110, unit_size = 0x00000044
135 PUB: 0x0000002e "four"
136 PUB: length = 0x00000017, format = DWARF32, version = 0x0002, unit_offset = 0x00000154, unit_size = 0x00000044
137 PUB: 0x0000002e "five"
138 PUB: length = 0x00000016, format = DWARF32, version = 0x0002, unit_offset = 0x00000198, unit_size = 0x00000044
139 PUB: 0x0000002e "six"
141 CHECK: .apple_names contents:
143 CHECK: String: 0x00000091 "five"
145 CHECK-NEXT: Atom[0]: 0x00000182
147 CHECK: String: 0x0000009c "six"
149 CHECK-NEXT: Atom[0]: 0x000001c6
151 CHECK: String: 0x00000078 "three"
153 CHECK-NEXT: Atom[0]: 0x000000fa
155 CHECK: String: 0x0000006c "two"
157 CHECK-NEXT: Atom[0]: 0x000000b6
159 CHECK: String: 0x00000057 "main"
161 CHECK-NEXT: Atom[0]: 0x0000002e
163 CHECK: String: 0x00000085 "four"
165 CHECK-NEXT: Atom[0]: 0x0000013e
167 CHECK: String: 0x00000062 "one"
169 CHECK-NEXT: Atom[0]: 0x00000072