OSDN Git Service

DebugInfo: Provide option for explicitly specifying the name of the DWP file
[android-x86/external-llvm.git] / test / DebugInfo / llvm-symbolizer.test
1 RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400559" > %t.input
2 RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64.debuglink 0x400559" >> %t.input
3 RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400436" >> %t.input
4 RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400528" >> %t.input
5 RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400586" >> %t.input
6 RUN: echo "%p/Inputs/dwarfdump-test2.elf-x86-64 0x4004e8" >> %t.input
7 RUN: echo "%p/Inputs/dwarfdump-test2.elf-x86-64 0x4004f4" >> %t.input
8 RUN: echo "%p/Inputs/dwarfdump-test4.elf-x86-64 0x62c" >> %t.input
9 RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0x8dc" >> %t.input
10 RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0xa05" >> %t.input
11 RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0x987" >> %t.input
12 RUN: echo "%p/Inputs/dwarfdump-inl-test.high_pc.elf-x86-64 0x568" >> %t.input
13 RUN: cp "%p/Inputs/dwarfdump-test3.elf-x86-64-space" "%T/dwarfdump-test3.elf-x86-64 space"
14 RUN: echo "\"%T/dwarfdump-test3.elf-x86-64 space\" 0x640" >> %t.input
15 RUN: echo "\"%T/dwarfdump-test3.elf-x86-64 space\" 0x633" >> %t.input
16 RUN: echo "\"%T/dwarfdump-test3.elf-x86-64 space\" 0x62d" >> %t.input
17 RUN: echo "%p/Inputs/macho-universal 0x1f84" >> %t.input
18 RUN: echo "%p/Inputs/macho-universal:i386 0x1f67" >> %t.input
19 RUN: echo "%p/Inputs/macho-universal:x86_64 0x100000f05" >> %t.input
20 RUN: echo "%p/Inputs/llvm-symbolizer-dwo-test 0x400514" >> %t.input
21 RUN: echo "%p/Inputs/fission-ranges.elf-x86_64 0x720" >> %t.input
22 RUN: echo "%p/Inputs/arange-overlap.elf-x86_64 0x714" >> %t.input
23 RUN: cp %p/Inputs/split-dwarf-test.dwo %T
24 RUN: echo "%p/Inputs/split-dwarf-test 0x4005d4" >> %t.input
25 RUN: echo "%p/Inputs/split-dwarf-test 0x4005c4" >> %t.input
26 RUN: echo "%p/Inputs/cross-cu-inlining.x86_64-macho.o 0x17" >> %t.input
27 RUN: cp %p/Inputs/split-dwarf-multiple-cu.dwo %T
28 RUN: echo "%p/Inputs/split-dwarf-multiple-cu.o 0x4" >> %t.input
29 RUN: cp %p/Inputs/split-dwarf-addr-object-relocation.dwo %T
30 RUN: echo "%p/Inputs/split-dwarf-addr-object-relocation.o 0x14" >> %t.input
31 RUN: cp %p/Inputs/split-dwarf-dwp.o %T
32 RUN: cp %p/Inputs/split-dwarf-dwp.o.dwp %T
33 RUN: echo "%T/split-dwarf-dwp.o 0x4" >> %t.input
34
35 RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
36 RUN:    --default-arch=i386 < %t.input | FileCheck --check-prefix=CHECK --check-prefix=SPLIT --check-prefix=DWO %s
37
38 Ensure we get the same results in the absence of gmlt-like data in the executable but the presence of a .dwo file
39
40 RUN: echo "%p/Inputs/split-dwarf-test-nogmlt 0x4005d4" >> %t.input
41 RUN: echo "%p/Inputs/split-dwarf-test-nogmlt 0x4005c4" >> %t.input
42 RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
43 RUN:    --default-arch=i386 < %t.input | FileCheck --check-prefix=SPLIT --check-prefix=DWO %s
44
45 Ensure we get gmlt like results in the absence of a .dwo file but the presence of gmlt-like data in the executable
46
47 RUN: rm %T/split-dwarf-test.dwo
48 RUN: echo "%p/Inputs/split-dwarf-test 0x4005d4" >> %t.input
49 RUN: echo "%p/Inputs/split-dwarf-test 0x4005c4" >> %t.input
50 RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
51 RUN:    --default-arch=i386 < %t.input | FileCheck --check-prefix=SPLIT --check-prefix=NODWO %s
52
53 RUN: cp %p/Inputs/split-dwarf-dwp.o %T/split-dwarf-dwp-different-name.o
54 RUN: echo "%T/split-dwarf-dwp-different-name.o 0x4" > %t.input
55 RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
56 RUN:    --default-arch=i386 --dwp=%p/Inputs/split-dwarf-dwp.o.dwp < %t.input | FileCheck --check-prefix=DWP %s
57
58 CHECK:       main
59 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
60
61 CHECK:       main
62 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
63
64 CHECK:      _start
65
66 CHECK: _Z1fii
67 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:11
68
69 CHECK: DummyClass
70 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:4
71
72 CHECK: a
73 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test2-helper.cc:2
74
75 CHECK: main
76 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test2-main.cc:4
77
78 CHECK:      _Z1cv
79 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test4-part1.cc:2
80
81 CHECK:      inlined_h
82 CHECK-NEXT: dwarfdump-inl-test.h:2
83 CHECK-NEXT: inlined_g
84 CHECK-NEXT: dwarfdump-inl-test.h:7
85 CHECK-NEXT: inlined_f
86 CHECK-NEXT: dwarfdump-inl-test.cc:3
87 CHECK-NEXT: main
88 CHECK-NEXT: dwarfdump-inl-test.cc:8
89
90 CHECK:      inlined_g
91 CHECK-NEXT: dwarfdump-inl-test.h:7
92 CHECK-NEXT: inlined_f
93 CHECK-NEXT: dwarfdump-inl-test.cc:3
94 CHECK-NEXT: main
95 CHECK-NEXT: dwarfdump-inl-test.cc:8
96
97 CHECK:      inlined_f
98 CHECK-NEXT: dwarfdump-inl-test.cc:3
99 CHECK-NEXT: main
100 CHECK-NEXT: dwarfdump-inl-test.cc:8
101
102 CHECK:      inlined_h
103 CHECK-NEXT: dwarfdump-inl-test.h:3
104 CHECK-NEXT: inlined_g
105 CHECK-NEXT: dwarfdump-inl-test.h:7
106 CHECK-NEXT: inlined_f
107 CHECK-NEXT: dwarfdump-inl-test.cc:3
108 CHECK-NEXT: main
109 CHECK-NEXT: dwarfdump-inl-test.cc:8
110
111 CHECK: C
112 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test3.cc:3
113
114 CHECK: _Z3do1v
115 CHECK-NEXT: /tmp/include{{[/\\]}}dwarfdump-test3-decl.h:7
116
117 CHECK: _Z3do2v
118 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}include{{[/\\]}}dwarfdump-test3-decl2.h:1
119
120 CHECK:      main
121 CHECK:      _Z3inci
122 CHECK:      _Z3inci
123
124 CHECK: main
125 CHECK-NEXT: llvm-symbolizer-dwo-test.cc:11
126
127 CHECK: main
128 CHECK-NEXT: {{.*}}fission-ranges.cc:6
129
130 CHECK: _ZN1S3bazEv
131 CHECK-NEXT: {{.*}}arange-overlap.cc:6
132
133 DWO: _Z2f2v
134 NODWO: {{^f2$}}
135 SPLIT-NEXT: {{.*}}split-dwarf-test.cc
136 SPLIT-NEXT: main
137 SPLIT-NEXT: {{.*}}split-dwarf-test.cc
138
139 SPLIT: _Z2f1v
140 SPLIT-NEXT: {{.*}}split-dwarf-test.cc
141
142 ; func has been inlined into main by LTO. Check that the symbolizer is able
143 ; to resolve the cross-cu reference and retrieve func's name
144 CHECK: func
145 CHECK-NEXT: /tmp{{[/\\]}}cross-cu-inlining.c:16:3
146 CHECK-NEXT: main
147 CHECK-NEXT: /tmp{{[/\\]}}cross-cu-inlining.c:11:0
148
149 CHECK:      f2
150 CHECK-NEXT: b.cpp:3:3
151 CHECK-NEXT: f3
152 CHECK-NEXT: b.cpp:6:0
153
154 CHECK:      f2
155 CHECK-NEXT: split-dwarf-addr-object-relocation.cpp:3:3
156 CHECK-NEXT: f3
157 CHECK-NEXT: split-dwarf-addr-object-relocation.cpp:6:0
158
159 DWP:      f2
160 DWP-NEXT: split-dwarf-dwp.cpp:3:3
161 DWP-NEXT: f3
162 DWP-NEXT: split-dwarf-dwp.cpp:6:0
163
164 RUN: echo "unexisting-file 0x1234" > %t.input2
165 RUN: llvm-symbolizer < %t.input2 2>&1 | FileCheck %s --check-prefix=MISSING-FILE
166
167 MISSING-FILE: LLVMSymbolizer: error reading file: {{[Nn]}}o such file or directory
168
169 RUN: echo "%p/Inputs/macho-universal 0x1f84" > %t.input3
170 RUN: llvm-symbolizer < %t.input3 | FileCheck %s --check-prefix=UNKNOWN-ARCH
171
172 UNKNOWN-ARCH-NOT: main
173 UNKNOWN-ARCH: ??
174 UNKNOWN-ARCH-NOT: main
175
176 RUN: echo "0x400559" > %t.input4
177 RUN: echo "0x400436" >> %t.input4
178 RUN: llvm-symbolizer --obj %p/Inputs/dwarfdump-test.elf-x86-64 < %t.input4 \
179 RUN:   | FileCheck %s --check-prefix=BINARY
180
181 BINARY:       main
182 BINARY-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
183 BINARY:      _start
184
185 RUN: echo "0x400720" > %t.input5
186 RUN: echo "0x4004a0" >> %t.input5
187 RUN: echo "0x4006f0" >> %t.input5
188 RUN: llvm-symbolizer --obj %p/Inputs/llvm-symbolizer-test.elf-x86-64 < %t.input5 \
189 RUN:   | FileCheck %s --check-prefix=BINARY_C
190
191 BINARY_C:       main
192 BINARY_C-NEXT: /tmp/dbginfo{{[/\\]}}llvm-symbolizer-test.c:10
193 BINARY_C:      _start
194 BINARY_C:      {{g$}}
195
196 RUN: echo "0x1f1" > %t.input6
197 RUN: llvm-symbolizer --obj %p/Inputs/shared-object-stripped.elf-i386 < %t.input6 \
198 RUN:   | FileCheck %s --check-prefix=STRIPPED
199
200 STRIPPED:  global_func
201
202 RUN: echo "%p/Inputs/dwarfdump-test4.elf-x86-64 0x62c" > %t.input7
203 RUN: llvm-symbolizer --functions=short --demangle=false < %t.input7 \
204 RUN:    | FileCheck %s --check-prefix=SHORT_FUNCTION_NAME
205
206 SHORT_FUNCTION_NAME-NOT: _Z1cv