blob: 285fc9e2707d6d428e6446d12e599e7ece854b27 [file] [log] [blame]
Christopher Ferrisc3d79f72017-11-28 19:14:54 -08001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include <inttypes.h>
18#include <stdint.h>
19#include <stdio.h>
20#include <stdlib.h>
Yabin Cuid5b22c52018-02-22 17:11:31 -080021#include <sys/mman.h>
Christopher Ferrisc3d79f72017-11-28 19:14:54 -080022#include <unistd.h>
23
24#include <gtest/gtest.h>
25
26#include <string>
Christopher Ferrise37e2d02018-02-09 15:57:39 -080027#include <unordered_map>
Christopher Ferrisc3d79f72017-11-28 19:14:54 -080028#include <vector>
29
Christopher Ferrise37e2d02018-02-09 15:57:39 -080030#include <android-base/file.h>
31
Christopher Ferris150db122017-12-20 18:49:01 -080032#include <unwindstack/JitDebug.h>
Christopher Ferris53914162018-02-08 19:27:47 -080033#include <unwindstack/MachineArm.h>
34#include <unwindstack/MachineArm64.h>
35#include <unwindstack/MachineX86.h>
Christopher Ferrise37e2d02018-02-09 15:57:39 -080036#include <unwindstack/MachineX86_64.h>
Christopher Ferrisc3d79f72017-11-28 19:14:54 -080037#include <unwindstack/Maps.h>
38#include <unwindstack/Memory.h>
Christopher Ferrisd06001d2017-11-30 18:56:01 -080039#include <unwindstack/RegsArm.h>
40#include <unwindstack/RegsArm64.h>
Christopher Ferris150db122017-12-20 18:49:01 -080041#include <unwindstack/RegsX86.h>
Christopher Ferrise37e2d02018-02-09 15:57:39 -080042#include <unwindstack/RegsX86_64.h>
Christopher Ferrisc3d79f72017-11-28 19:14:54 -080043#include <unwindstack/Unwinder.h>
44
Christopher Ferrisc3d79f72017-11-28 19:14:54 -080045#include "ElfTestUtils.h"
46
47namespace unwindstack {
48
Christopher Ferris239425b2018-05-17 18:37:38 -070049static void AddMemory(std::string file_name, MemoryOfflineParts* parts) {
50 MemoryOffline* memory = new MemoryOffline;
51 ASSERT_TRUE(memory->Init(file_name.c_str(), 0));
52 parts->Add(memory);
53}
54
Christopher Ferrise37e2d02018-02-09 15:57:39 -080055class UnwindOfflineTest : public ::testing::Test {
56 protected:
57 void TearDown() override {
58 if (cwd_ != nullptr) {
59 ASSERT_EQ(0, chdir(cwd_));
60 }
61 free(cwd_);
62 }
63
64 void Init(const char* file_dir, ArchEnum arch) {
65 dir_ = TestGetFileDirectory() + "offline/" + file_dir;
66
67 std::string data;
68 ASSERT_TRUE(android::base::ReadFileToString((dir_ + "maps.txt"), &data));
69
70 maps_.reset(new BufferMaps(data.c_str()));
71 ASSERT_TRUE(maps_->Parse());
72
Christopher Ferris239425b2018-05-17 18:37:38 -070073 std::string stack_name(dir_ + "stack.data");
74 struct stat st;
75 if (stat(stack_name.c_str(), &st) == 0 && S_ISREG(st.st_mode)) {
76 std::unique_ptr<MemoryOffline> stack_memory(new MemoryOffline);
77 ASSERT_TRUE(stack_memory->Init((dir_ + "stack.data").c_str(), 0));
78 process_memory_.reset(stack_memory.release());
79 } else {
80 std::unique_ptr<MemoryOfflineParts> stack_memory(new MemoryOfflineParts);
81 for (size_t i = 0;; i++) {
82 stack_name = dir_ + "stack" + std::to_string(i) + ".data";
83 if (stat(stack_name.c_str(), &st) == -1 || !S_ISREG(st.st_mode)) {
84 ASSERT_TRUE(i != 0) << "No stack data files found.";
85 break;
86 }
87 AddMemory(stack_name, stack_memory.get());
88 }
89 process_memory_.reset(stack_memory.release());
90 }
Christopher Ferrise37e2d02018-02-09 15:57:39 -080091
92 switch (arch) {
93 case ARCH_ARM: {
94 RegsArm* regs = new RegsArm;
95 regs_.reset(regs);
96 ReadRegs<uint32_t>(regs, arm_regs_);
97 break;
98 }
99 case ARCH_ARM64: {
100 RegsArm64* regs = new RegsArm64;
101 regs_.reset(regs);
102 ReadRegs<uint64_t>(regs, arm64_regs_);
103 break;
104 }
105 case ARCH_X86: {
106 RegsX86* regs = new RegsX86;
107 regs_.reset(regs);
108 ReadRegs<uint32_t>(regs, x86_regs_);
109 break;
110 }
111 case ARCH_X86_64: {
112 RegsX86_64* regs = new RegsX86_64;
113 regs_.reset(regs);
114 ReadRegs<uint64_t>(regs, x86_64_regs_);
115 break;
116 }
117 default:
118 ASSERT_TRUE(false) << "Unknown arch " << std::to_string(arch);
119 }
120 cwd_ = getcwd(nullptr, 0);
121 // Make dir_ an absolute directory.
122 if (dir_.empty() || dir_[0] != '/') {
123 dir_ = std::string(cwd_) + '/' + dir_;
124 }
125 ASSERT_EQ(0, chdir(dir_.c_str()));
126 }
127
128 template <typename AddressType>
129 void ReadRegs(RegsImpl<AddressType>* regs,
130 const std::unordered_map<std::string, uint32_t>& name_to_reg) {
131 FILE* fp = fopen((dir_ + "regs.txt").c_str(), "r");
132 ASSERT_TRUE(fp != nullptr);
133 while (!feof(fp)) {
134 uint64_t value;
135 char reg_name[100];
136 ASSERT_EQ(2, fscanf(fp, "%s %" SCNx64 "\n", reg_name, &value));
137 std::string name(reg_name);
138 if (!name.empty()) {
139 // Remove the : from the end.
140 name.resize(name.size() - 1);
141 }
142 auto entry = name_to_reg.find(name);
143 ASSERT_TRUE(entry != name_to_reg.end()) << "Unknown register named " << name;
144 (*regs)[entry->second] = value;
145 }
146 fclose(fp);
Christopher Ferrise37e2d02018-02-09 15:57:39 -0800147 }
148
149 static std::unordered_map<std::string, uint32_t> arm_regs_;
150 static std::unordered_map<std::string, uint32_t> arm64_regs_;
151 static std::unordered_map<std::string, uint32_t> x86_regs_;
152 static std::unordered_map<std::string, uint32_t> x86_64_regs_;
153
154 char* cwd_ = nullptr;
155 std::string dir_;
156 std::unique_ptr<Regs> regs_;
157 std::unique_ptr<Maps> maps_;
158 std::shared_ptr<Memory> process_memory_;
159};
160
161std::unordered_map<std::string, uint32_t> UnwindOfflineTest::arm_regs_ = {
162 {"r0", ARM_REG_R0}, {"r1", ARM_REG_R1}, {"r2", ARM_REG_R2}, {"r3", ARM_REG_R3},
163 {"r4", ARM_REG_R4}, {"r5", ARM_REG_R5}, {"r6", ARM_REG_R6}, {"r7", ARM_REG_R7},
164 {"r8", ARM_REG_R8}, {"r9", ARM_REG_R9}, {"r10", ARM_REG_R10}, {"r11", ARM_REG_R11},
165 {"ip", ARM_REG_R12}, {"sp", ARM_REG_SP}, {"lr", ARM_REG_LR}, {"pc", ARM_REG_PC},
166};
167
168std::unordered_map<std::string, uint32_t> UnwindOfflineTest::arm64_regs_ = {
169 {"x0", ARM64_REG_R0}, {"x1", ARM64_REG_R1}, {"x2", ARM64_REG_R2}, {"x3", ARM64_REG_R3},
170 {"x4", ARM64_REG_R4}, {"x5", ARM64_REG_R5}, {"x6", ARM64_REG_R6}, {"x7", ARM64_REG_R7},
171 {"x8", ARM64_REG_R8}, {"x9", ARM64_REG_R9}, {"x10", ARM64_REG_R10}, {"x11", ARM64_REG_R11},
172 {"x12", ARM64_REG_R12}, {"x13", ARM64_REG_R13}, {"x14", ARM64_REG_R14}, {"x15", ARM64_REG_R15},
173 {"x16", ARM64_REG_R16}, {"x17", ARM64_REG_R17}, {"x18", ARM64_REG_R18}, {"x19", ARM64_REG_R19},
174 {"x20", ARM64_REG_R20}, {"x21", ARM64_REG_R21}, {"x22", ARM64_REG_R22}, {"x23", ARM64_REG_R23},
175 {"x24", ARM64_REG_R24}, {"x25", ARM64_REG_R25}, {"x26", ARM64_REG_R26}, {"x27", ARM64_REG_R27},
176 {"x28", ARM64_REG_R28}, {"x29", ARM64_REG_R29}, {"sp", ARM64_REG_SP}, {"lr", ARM64_REG_LR},
177 {"pc", ARM64_REG_PC},
178};
179
180std::unordered_map<std::string, uint32_t> UnwindOfflineTest::x86_regs_ = {
181 {"eax", X86_REG_EAX}, {"ebx", X86_REG_EBX}, {"ecx", X86_REG_ECX},
182 {"edx", X86_REG_EDX}, {"ebp", X86_REG_EBP}, {"edi", X86_REG_EDI},
183 {"esi", X86_REG_ESI}, {"esp", X86_REG_ESP}, {"eip", X86_REG_EIP},
184};
185
186std::unordered_map<std::string, uint32_t> UnwindOfflineTest::x86_64_regs_ = {
187 {"rax", X86_64_REG_RAX}, {"rbx", X86_64_REG_RBX}, {"rcx", X86_64_REG_RCX},
188 {"rdx", X86_64_REG_RDX}, {"r8", X86_64_REG_R8}, {"r9", X86_64_REG_R9},
189 {"r10", X86_64_REG_R10}, {"r11", X86_64_REG_R11}, {"r12", X86_64_REG_R12},
190 {"r13", X86_64_REG_R13}, {"r14", X86_64_REG_R14}, {"r15", X86_64_REG_R15},
191 {"rdi", X86_64_REG_RDI}, {"rsi", X86_64_REG_RSI}, {"rbp", X86_64_REG_RBP},
192 {"rsp", X86_64_REG_RSP}, {"rip", X86_64_REG_RIP},
193};
194
Christopher Ferrisc3d79f72017-11-28 19:14:54 -0800195static std::string DumpFrames(Unwinder& unwinder) {
196 std::string str;
197 for (size_t i = 0; i < unwinder.NumFrames(); i++) {
198 str += unwinder.FormatFrame(i) + "\n";
199 }
200 return str;
201}
202
Christopher Ferrise37e2d02018-02-09 15:57:39 -0800203TEST_F(UnwindOfflineTest, pc_straddle_arm) {
Christopher Ferris239425b2018-05-17 18:37:38 -0700204 ASSERT_NO_FATAL_FAILURE(Init("straddle_arm/", ARCH_ARM));
Christopher Ferrisc3d79f72017-11-28 19:14:54 -0800205
Christopher Ferrise37e2d02018-02-09 15:57:39 -0800206 Unwinder unwinder(128, maps_.get(), regs_.get(), process_memory_);
Christopher Ferrisc3d79f72017-11-28 19:14:54 -0800207 unwinder.Unwind();
Christopher Ferrisc3d79f72017-11-28 19:14:54 -0800208
209 std::string frame_info(DumpFrames(unwinder));
210 ASSERT_EQ(4U, unwinder.NumFrames()) << "Unwind:\n" << frame_info;
211 EXPECT_EQ(
Christopher Ferris704ec9a2018-03-15 14:35:01 -0700212 " #00 pc 0001a9f8 libc.so (abort+64)\n"
Christopher Ferrisc3d79f72017-11-28 19:14:54 -0800213 " #01 pc 00006a1b libbase.so (_ZN7android4base14DefaultAborterEPKc+6)\n"
214 " #02 pc 00007441 libbase.so (_ZN7android4base10LogMessageD2Ev+748)\n"
Christopher Ferris150db122017-12-20 18:49:01 -0800215 " #03 pc 00015147 /does/not/exist/libhidlbase.so\n",
Christopher Ferrisc3d79f72017-11-28 19:14:54 -0800216 frame_info);
Christopher Ferrisa2ec50b2018-02-21 15:39:07 -0800217 EXPECT_EQ(0xf31ea9f8U, unwinder.frames()[0].pc);
218 EXPECT_EQ(0xe9c866f8U, unwinder.frames()[0].sp);
219 EXPECT_EQ(0xf2da0a1bU, unwinder.frames()[1].pc);
220 EXPECT_EQ(0xe9c86728U, unwinder.frames()[1].sp);
221 EXPECT_EQ(0xf2da1441U, unwinder.frames()[2].pc);
222 EXPECT_EQ(0xe9c86730U, unwinder.frames()[2].sp);
223 EXPECT_EQ(0xf3367147U, unwinder.frames()[3].pc);
224 EXPECT_EQ(0xe9c86778U, unwinder.frames()[3].sp);
Christopher Ferrisc3d79f72017-11-28 19:14:54 -0800225}
226
Christopher Ferrise37e2d02018-02-09 15:57:39 -0800227TEST_F(UnwindOfflineTest, pc_in_gnu_debugdata_arm) {
Christopher Ferris239425b2018-05-17 18:37:38 -0700228 ASSERT_NO_FATAL_FAILURE(Init("gnu_debugdata_arm/", ARCH_ARM));
Christopher Ferrise7b66242017-12-15 11:17:45 -0800229
Christopher Ferrise37e2d02018-02-09 15:57:39 -0800230 Unwinder unwinder(128, maps_.get(), regs_.get(), process_memory_);
Christopher Ferrise7b66242017-12-15 11:17:45 -0800231 unwinder.Unwind();
Christopher Ferrise7b66242017-12-15 11:17:45 -0800232
233 std::string frame_info(DumpFrames(unwinder));
234 ASSERT_EQ(2U, unwinder.NumFrames()) << "Unwind:\n" << frame_info;
235 EXPECT_EQ(
236 " #00 pc 0006dc49 libandroid_runtime.so "
237 "(_ZN7android14AndroidRuntime15javaThreadShellEPv+80)\n"
238 " #01 pc 0006dce5 libandroid_runtime.so "
239 "(_ZN7android14AndroidRuntime19javaCreateThreadEtcEPFiPvES1_PKcijPS1_)\n",
240 frame_info);
Christopher Ferrisa2ec50b2018-02-21 15:39:07 -0800241 EXPECT_EQ(0xf1f6dc49U, unwinder.frames()[0].pc);
242 EXPECT_EQ(0xd8fe6930U, unwinder.frames()[0].sp);
243 EXPECT_EQ(0xf1f6dce5U, unwinder.frames()[1].pc);
244 EXPECT_EQ(0xd8fe6958U, unwinder.frames()[1].sp);
Christopher Ferrise7b66242017-12-15 11:17:45 -0800245}
246
Christopher Ferrise37e2d02018-02-09 15:57:39 -0800247TEST_F(UnwindOfflineTest, pc_straddle_arm64) {
Christopher Ferris239425b2018-05-17 18:37:38 -0700248 ASSERT_NO_FATAL_FAILURE(Init("straddle_arm64/", ARCH_ARM64));
Christopher Ferrisc3d79f72017-11-28 19:14:54 -0800249
Christopher Ferrise37e2d02018-02-09 15:57:39 -0800250 Unwinder unwinder(128, maps_.get(), regs_.get(), process_memory_);
Christopher Ferrisc3d79f72017-11-28 19:14:54 -0800251 unwinder.Unwind();
Christopher Ferrisc3d79f72017-11-28 19:14:54 -0800252
253 std::string frame_info(DumpFrames(unwinder));
254 ASSERT_EQ(6U, unwinder.NumFrames()) << "Unwind:\n" << frame_info;
255 EXPECT_EQ(
256 " #00 pc 0000000000429fd8 libunwindstack_test (SignalInnerFunction+24)\n"
257 " #01 pc 000000000042a078 libunwindstack_test (SignalMiddleFunction+8)\n"
258 " #02 pc 000000000042a08c libunwindstack_test (SignalOuterFunction+8)\n"
259 " #03 pc 000000000042d8fc libunwindstack_test "
260 "(_ZN11unwindstackL19RemoteThroughSignalEij+20)\n"
261 " #04 pc 000000000042d8d8 libunwindstack_test "
262 "(_ZN11unwindstack37UnwindTest_remote_through_signal_Test8TestBodyEv+32)\n"
263 " #05 pc 0000000000455d70 libunwindstack_test (_ZN7testing4Test3RunEv+392)\n",
264 frame_info);
Christopher Ferrisa2ec50b2018-02-21 15:39:07 -0800265 EXPECT_EQ(0x64d09d4fd8U, unwinder.frames()[0].pc);
266 EXPECT_EQ(0x7fe0d84040U, unwinder.frames()[0].sp);
267 EXPECT_EQ(0x64d09d5078U, unwinder.frames()[1].pc);
268 EXPECT_EQ(0x7fe0d84070U, unwinder.frames()[1].sp);
269 EXPECT_EQ(0x64d09d508cU, unwinder.frames()[2].pc);
270 EXPECT_EQ(0x7fe0d84080U, unwinder.frames()[2].sp);
271 EXPECT_EQ(0x64d09d88fcU, unwinder.frames()[3].pc);
272 EXPECT_EQ(0x7fe0d84090U, unwinder.frames()[3].sp);
273 EXPECT_EQ(0x64d09d88d8U, unwinder.frames()[4].pc);
274 EXPECT_EQ(0x7fe0d840f0U, unwinder.frames()[4].sp);
275 EXPECT_EQ(0x64d0a00d70U, unwinder.frames()[5].pc);
276 EXPECT_EQ(0x7fe0d84110U, unwinder.frames()[5].sp);
Christopher Ferrisc3d79f72017-11-28 19:14:54 -0800277}
278
Christopher Ferrise37e2d02018-02-09 15:57:39 -0800279TEST_F(UnwindOfflineTest, jit_debug_x86) {
Christopher Ferris239425b2018-05-17 18:37:38 -0700280 ASSERT_NO_FATAL_FAILURE(Init("jit_debug_x86/", ARCH_X86));
Christopher Ferris150db122017-12-20 18:49:01 -0800281
282 MemoryOfflineParts* memory = new MemoryOfflineParts;
Christopher Ferrise37e2d02018-02-09 15:57:39 -0800283 AddMemory(dir_ + "descriptor.data", memory);
284 AddMemory(dir_ + "stack.data", memory);
Christopher Ferris150db122017-12-20 18:49:01 -0800285 for (size_t i = 0; i < 7; i++) {
Christopher Ferrise37e2d02018-02-09 15:57:39 -0800286 AddMemory(dir_ + "entry" + std::to_string(i) + ".data", memory);
287 AddMemory(dir_ + "jit" + std::to_string(i) + ".data", memory);
Christopher Ferris150db122017-12-20 18:49:01 -0800288 }
Christopher Ferrise37e2d02018-02-09 15:57:39 -0800289 process_memory_.reset(memory);
Christopher Ferris150db122017-12-20 18:49:01 -0800290
Christopher Ferrise37e2d02018-02-09 15:57:39 -0800291 JitDebug jit_debug(process_memory_);
292 Unwinder unwinder(128, maps_.get(), regs_.get(), process_memory_);
293 unwinder.SetJitDebug(&jit_debug, regs_->Arch());
Christopher Ferris150db122017-12-20 18:49:01 -0800294 unwinder.Unwind();
Christopher Ferris150db122017-12-20 18:49:01 -0800295
296 std::string frame_info(DumpFrames(unwinder));
297 ASSERT_EQ(69U, unwinder.NumFrames()) << "Unwind:\n" << frame_info;
298 EXPECT_EQ(
299 " #00 pc 00068fb8 libarttestd.so (_ZN3artL13CauseSegfaultEv+72)\n"
300 " #01 pc 00067f00 libarttestd.so (Java_Main_unwindInProcess+10032)\n"
301 " #02 pc 000021a8 (offset 0x2000) 137-cfi.odex (boolean Main.unwindInProcess(boolean, int, "
302 "boolean)+136)\n"
Christopher Ferris6dbc28e2018-03-28 15:12:49 -0700303 " #03 pc 0000fe80 anonymous:ee74c000 (boolean Main.bar(boolean)+64)\n"
Christopher Ferris150db122017-12-20 18:49:01 -0800304 " #04 pc 006ad4d2 libartd.so (art_quick_invoke_stub+338)\n"
305 " #05 pc 00146ab5 libartd.so "
306 "(_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+885)\n"
307 " #06 pc 0039cf0d libartd.so "
308 "(_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPNS_"
309 "11ShadowFrameEtPNS_6JValueE+653)\n"
310 " #07 pc 00392552 libartd.so "
311 "(_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_"
312 "6JValueEb+354)\n"
313 " #08 pc 0039399a libartd.so "
314 "(_ZN3art11interpreter30EnterInterpreterFromEntryPointEPNS_6ThreadERKNS_"
315 "20CodeItemDataAccessorEPNS_11ShadowFrameE+234)\n"
316 " #09 pc 00684362 libartd.so (artQuickToInterpreterBridge+1058)\n"
317 " #10 pc 006b35bd libartd.so (art_quick_to_interpreter_bridge+77)\n"
Christopher Ferris6dbc28e2018-03-28 15:12:49 -0700318 " #11 pc 0000fe03 anonymous:ee74c000 (int Main.compare(Main, Main)+51)\n"
Christopher Ferris150db122017-12-20 18:49:01 -0800319 " #12 pc 006ad4d2 libartd.so (art_quick_invoke_stub+338)\n"
320 " #13 pc 00146ab5 libartd.so "
321 "(_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+885)\n"
322 " #14 pc 0039cf0d libartd.so "
323 "(_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPNS_"
324 "11ShadowFrameEtPNS_6JValueE+653)\n"
325 " #15 pc 00392552 libartd.so "
326 "(_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_"
327 "6JValueEb+354)\n"
328 " #16 pc 0039399a libartd.so "
329 "(_ZN3art11interpreter30EnterInterpreterFromEntryPointEPNS_6ThreadERKNS_"
330 "20CodeItemDataAccessorEPNS_11ShadowFrameE+234)\n"
331 " #17 pc 00684362 libartd.so (artQuickToInterpreterBridge+1058)\n"
332 " #18 pc 006b35bd libartd.so (art_quick_to_interpreter_bridge+77)\n"
Christopher Ferris6dbc28e2018-03-28 15:12:49 -0700333 " #19 pc 0000fd3b anonymous:ee74c000 (int Main.compare(java.lang.Object, "
334 "java.lang.Object)+107)\n"
Christopher Ferris150db122017-12-20 18:49:01 -0800335 " #20 pc 006ad4d2 libartd.so (art_quick_invoke_stub+338)\n"
336 " #21 pc 00146ab5 libartd.so "
337 "(_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+885)\n"
338 " #22 pc 0039cf0d libartd.so "
339 "(_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPNS_"
340 "11ShadowFrameEtPNS_6JValueE+653)\n"
341 " #23 pc 00392552 libartd.so "
342 "(_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_"
343 "6JValueEb+354)\n"
344 " #24 pc 0039399a libartd.so "
345 "(_ZN3art11interpreter30EnterInterpreterFromEntryPointEPNS_6ThreadERKNS_"
346 "20CodeItemDataAccessorEPNS_11ShadowFrameE+234)\n"
347 " #25 pc 00684362 libartd.so (artQuickToInterpreterBridge+1058)\n"
348 " #26 pc 006b35bd libartd.so (art_quick_to_interpreter_bridge+77)\n"
Christopher Ferris6dbc28e2018-03-28 15:12:49 -0700349 " #27 pc 0000fbdb anonymous:ee74c000 (int "
Christopher Ferris150db122017-12-20 18:49:01 -0800350 "java.util.Arrays.binarySearch0(java.lang.Object[], int, int, java.lang.Object, "
Christopher Ferris6dbc28e2018-03-28 15:12:49 -0700351 "java.util.Comparator)+331)\n"
Christopher Ferris150db122017-12-20 18:49:01 -0800352 " #28 pc 006ad6a2 libartd.so (art_quick_invoke_static_stub+418)\n"
353 " #29 pc 00146acb libartd.so "
354 "(_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+907)\n"
355 " #30 pc 0039cf0d libartd.so "
356 "(_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPNS_"
357 "11ShadowFrameEtPNS_6JValueE+653)\n"
358 " #31 pc 00392552 libartd.so "
359 "(_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_"
360 "6JValueEb+354)\n"
361 " #32 pc 0039399a libartd.so "
362 "(_ZN3art11interpreter30EnterInterpreterFromEntryPointEPNS_6ThreadERKNS_"
363 "20CodeItemDataAccessorEPNS_11ShadowFrameE+234)\n"
364 " #33 pc 00684362 libartd.so (artQuickToInterpreterBridge+1058)\n"
365 " #34 pc 006b35bd libartd.so (art_quick_to_interpreter_bridge+77)\n"
Christopher Ferris6dbc28e2018-03-28 15:12:49 -0700366 " #35 pc 0000f624 anonymous:ee74c000 (boolean Main.foo()+164)\n"
Christopher Ferris150db122017-12-20 18:49:01 -0800367 " #36 pc 006ad4d2 libartd.so (art_quick_invoke_stub+338)\n"
368 " #37 pc 00146ab5 libartd.so "
369 "(_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+885)\n"
370 " #38 pc 0039cf0d libartd.so "
371 "(_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPNS_"
372 "11ShadowFrameEtPNS_6JValueE+653)\n"
373 " #39 pc 00392552 libartd.so "
374 "(_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_"
375 "6JValueEb+354)\n"
376 " #40 pc 0039399a libartd.so "
377 "(_ZN3art11interpreter30EnterInterpreterFromEntryPointEPNS_6ThreadERKNS_"
378 "20CodeItemDataAccessorEPNS_11ShadowFrameE+234)\n"
379 " #41 pc 00684362 libartd.so (artQuickToInterpreterBridge+1058)\n"
380 " #42 pc 006b35bd libartd.so (art_quick_to_interpreter_bridge+77)\n"
Christopher Ferris6dbc28e2018-03-28 15:12:49 -0700381 " #43 pc 0000eedb anonymous:ee74c000 (void Main.runPrimary()+59)\n"
Christopher Ferris150db122017-12-20 18:49:01 -0800382 " #44 pc 006ad4d2 libartd.so (art_quick_invoke_stub+338)\n"
383 " #45 pc 00146ab5 libartd.so "
384 "(_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+885)\n"
385 " #46 pc 0039cf0d libartd.so "
386 "(_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPNS_"
387 "11ShadowFrameEtPNS_6JValueE+653)\n"
388 " #47 pc 00392552 libartd.so "
389 "(_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_"
390 "6JValueEb+354)\n"
391 " #48 pc 0039399a libartd.so "
392 "(_ZN3art11interpreter30EnterInterpreterFromEntryPointEPNS_6ThreadERKNS_"
393 "20CodeItemDataAccessorEPNS_11ShadowFrameE+234)\n"
394 " #49 pc 00684362 libartd.so (artQuickToInterpreterBridge+1058)\n"
395 " #50 pc 006b35bd libartd.so (art_quick_to_interpreter_bridge+77)\n"
Christopher Ferris6dbc28e2018-03-28 15:12:49 -0700396 " #51 pc 0000ac21 anonymous:ee74c000 (void Main.main(java.lang.String[])+97)\n"
Christopher Ferris150db122017-12-20 18:49:01 -0800397 " #52 pc 006ad6a2 libartd.so (art_quick_invoke_static_stub+418)\n"
398 " #53 pc 00146acb libartd.so "
399 "(_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+907)\n"
400 " #54 pc 0039cf0d libartd.so "
401 "(_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPNS_"
402 "11ShadowFrameEtPNS_6JValueE+653)\n"
403 " #55 pc 00392552 libartd.so "
404 "(_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_"
405 "6JValueEb+354)\n"
406 " #56 pc 0039399a libartd.so "
407 "(_ZN3art11interpreter30EnterInterpreterFromEntryPointEPNS_6ThreadERKNS_"
408 "20CodeItemDataAccessorEPNS_11ShadowFrameE+234)\n"
409 " #57 pc 00684362 libartd.so (artQuickToInterpreterBridge+1058)\n"
410 " #58 pc 006b35bd libartd.so (art_quick_to_interpreter_bridge+77)\n"
411 " #59 pc 006ad6a2 libartd.so (art_quick_invoke_static_stub+418)\n"
412 " #60 pc 00146acb libartd.so "
413 "(_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+907)\n"
414 " #61 pc 005aac95 libartd.so "
415 "(_ZN3artL18InvokeWithArgArrayERKNS_33ScopedObjectAccessAlreadyRunnableEPNS_9ArtMethodEPNS_"
416 "8ArgArrayEPNS_6JValueEPKc+85)\n"
417 " #62 pc 005aab5a libartd.so "
418 "(_ZN3art17InvokeWithVarArgsERKNS_33ScopedObjectAccessAlreadyRunnableEP8_jobjectP10_"
419 "jmethodIDPc+362)\n"
420 " #63 pc 0048a3dd libartd.so "
421 "(_ZN3art3JNI21CallStaticVoidMethodVEP7_JNIEnvP7_jclassP10_jmethodIDPc+125)\n"
422 " #64 pc 0018448c libartd.so "
423 "(_ZN3art8CheckJNI11CallMethodVEPKcP7_JNIEnvP8_jobjectP7_jclassP10_jmethodIDPcNS_"
424 "9Primitive4TypeENS_10InvokeTypeE+1964)\n"
425 " #65 pc 0017cf06 libartd.so "
426 "(_ZN3art8CheckJNI21CallStaticVoidMethodVEP7_JNIEnvP7_jclassP10_jmethodIDPc+70)\n"
427 " #66 pc 00001d8c dalvikvm32 "
428 "(_ZN7_JNIEnv20CallStaticVoidMethodEP7_jclassP10_jmethodIDz+60)\n"
429 " #67 pc 00001a80 dalvikvm32 (main+1312)\n"
430 " #68 pc 00018275 libc.so\n",
431 frame_info);
Christopher Ferrisa2ec50b2018-02-21 15:39:07 -0800432 EXPECT_EQ(0xeb89bfb8U, unwinder.frames()[0].pc);
433 EXPECT_EQ(0xffeb5280U, unwinder.frames()[0].sp);
434 EXPECT_EQ(0xeb89af00U, unwinder.frames()[1].pc);
435 EXPECT_EQ(0xffeb52a0U, unwinder.frames()[1].sp);
436 EXPECT_EQ(0xec6061a8U, unwinder.frames()[2].pc);
437 EXPECT_EQ(0xffeb5ce0U, unwinder.frames()[2].sp);
Christopher Ferris6dbc28e2018-03-28 15:12:49 -0700438 EXPECT_EQ(0xee75be80U, unwinder.frames()[3].pc);
Christopher Ferrisa2ec50b2018-02-21 15:39:07 -0800439 EXPECT_EQ(0xffeb5d30U, unwinder.frames()[3].sp);
440 EXPECT_EQ(0xf728e4d2U, unwinder.frames()[4].pc);
441 EXPECT_EQ(0xffeb5d60U, unwinder.frames()[4].sp);
442 EXPECT_EQ(0xf6d27ab5U, unwinder.frames()[5].pc);
443 EXPECT_EQ(0xffeb5d80U, unwinder.frames()[5].sp);
444 EXPECT_EQ(0xf6f7df0dU, unwinder.frames()[6].pc);
445 EXPECT_EQ(0xffeb5e20U, unwinder.frames()[6].sp);
446 EXPECT_EQ(0xf6f73552U, unwinder.frames()[7].pc);
447 EXPECT_EQ(0xffeb5ec0U, unwinder.frames()[7].sp);
448 EXPECT_EQ(0xf6f7499aU, unwinder.frames()[8].pc);
449 EXPECT_EQ(0xffeb5f40U, unwinder.frames()[8].sp);
450 EXPECT_EQ(0xf7265362U, unwinder.frames()[9].pc);
451 EXPECT_EQ(0xffeb5fb0U, unwinder.frames()[9].sp);
452 EXPECT_EQ(0xf72945bdU, unwinder.frames()[10].pc);
453 EXPECT_EQ(0xffeb6110U, unwinder.frames()[10].sp);
Christopher Ferris6dbc28e2018-03-28 15:12:49 -0700454 EXPECT_EQ(0xee75be03U, unwinder.frames()[11].pc);
Christopher Ferrisa2ec50b2018-02-21 15:39:07 -0800455 EXPECT_EQ(0xffeb6160U, unwinder.frames()[11].sp);
456 EXPECT_EQ(0xf728e4d2U, unwinder.frames()[12].pc);
457 EXPECT_EQ(0xffeb6180U, unwinder.frames()[12].sp);
458 EXPECT_EQ(0xf6d27ab5U, unwinder.frames()[13].pc);
459 EXPECT_EQ(0xffeb61b0U, unwinder.frames()[13].sp);
460 EXPECT_EQ(0xf6f7df0dU, unwinder.frames()[14].pc);
461 EXPECT_EQ(0xffeb6250U, unwinder.frames()[14].sp);
462 EXPECT_EQ(0xf6f73552U, unwinder.frames()[15].pc);
463 EXPECT_EQ(0xffeb62f0U, unwinder.frames()[15].sp);
464 EXPECT_EQ(0xf6f7499aU, unwinder.frames()[16].pc);
465 EXPECT_EQ(0xffeb6370U, unwinder.frames()[16].sp);
466 EXPECT_EQ(0xf7265362U, unwinder.frames()[17].pc);
467 EXPECT_EQ(0xffeb63e0U, unwinder.frames()[17].sp);
468 EXPECT_EQ(0xf72945bdU, unwinder.frames()[18].pc);
469 EXPECT_EQ(0xffeb6530U, unwinder.frames()[18].sp);
Christopher Ferris6dbc28e2018-03-28 15:12:49 -0700470 EXPECT_EQ(0xee75bd3bU, unwinder.frames()[19].pc);
Christopher Ferrisa2ec50b2018-02-21 15:39:07 -0800471 EXPECT_EQ(0xffeb6580U, unwinder.frames()[19].sp);
472 EXPECT_EQ(0xf728e4d2U, unwinder.frames()[20].pc);
473 EXPECT_EQ(0xffeb65b0U, unwinder.frames()[20].sp);
474 EXPECT_EQ(0xf6d27ab5U, unwinder.frames()[21].pc);
475 EXPECT_EQ(0xffeb65e0U, unwinder.frames()[21].sp);
476 EXPECT_EQ(0xf6f7df0dU, unwinder.frames()[22].pc);
477 EXPECT_EQ(0xffeb6680U, unwinder.frames()[22].sp);
478 EXPECT_EQ(0xf6f73552U, unwinder.frames()[23].pc);
479 EXPECT_EQ(0xffeb6720U, unwinder.frames()[23].sp);
480 EXPECT_EQ(0xf6f7499aU, unwinder.frames()[24].pc);
481 EXPECT_EQ(0xffeb67a0U, unwinder.frames()[24].sp);
482 EXPECT_EQ(0xf7265362U, unwinder.frames()[25].pc);
483 EXPECT_EQ(0xffeb6810U, unwinder.frames()[25].sp);
484 EXPECT_EQ(0xf72945bdU, unwinder.frames()[26].pc);
485 EXPECT_EQ(0xffeb6960U, unwinder.frames()[26].sp);
Christopher Ferris6dbc28e2018-03-28 15:12:49 -0700486 EXPECT_EQ(0xee75bbdbU, unwinder.frames()[27].pc);
Christopher Ferrisa2ec50b2018-02-21 15:39:07 -0800487 EXPECT_EQ(0xffeb69b0U, unwinder.frames()[27].sp);
488 EXPECT_EQ(0xf728e6a2U, unwinder.frames()[28].pc);
489 EXPECT_EQ(0xffeb69f0U, unwinder.frames()[28].sp);
490 EXPECT_EQ(0xf6d27acbU, unwinder.frames()[29].pc);
491 EXPECT_EQ(0xffeb6a20U, unwinder.frames()[29].sp);
492 EXPECT_EQ(0xf6f7df0dU, unwinder.frames()[30].pc);
493 EXPECT_EQ(0xffeb6ac0U, unwinder.frames()[30].sp);
494 EXPECT_EQ(0xf6f73552U, unwinder.frames()[31].pc);
495 EXPECT_EQ(0xffeb6b60U, unwinder.frames()[31].sp);
496 EXPECT_EQ(0xf6f7499aU, unwinder.frames()[32].pc);
497 EXPECT_EQ(0xffeb6be0U, unwinder.frames()[32].sp);
498 EXPECT_EQ(0xf7265362U, unwinder.frames()[33].pc);
499 EXPECT_EQ(0xffeb6c50U, unwinder.frames()[33].sp);
500 EXPECT_EQ(0xf72945bdU, unwinder.frames()[34].pc);
501 EXPECT_EQ(0xffeb6dd0U, unwinder.frames()[34].sp);
Christopher Ferris6dbc28e2018-03-28 15:12:49 -0700502 EXPECT_EQ(0xee75b624U, unwinder.frames()[35].pc);
Christopher Ferrisa2ec50b2018-02-21 15:39:07 -0800503 EXPECT_EQ(0xffeb6e20U, unwinder.frames()[35].sp);
504 EXPECT_EQ(0xf728e4d2U, unwinder.frames()[36].pc);
505 EXPECT_EQ(0xffeb6e50U, unwinder.frames()[36].sp);
506 EXPECT_EQ(0xf6d27ab5U, unwinder.frames()[37].pc);
507 EXPECT_EQ(0xffeb6e70U, unwinder.frames()[37].sp);
508 EXPECT_EQ(0xf6f7df0dU, unwinder.frames()[38].pc);
509 EXPECT_EQ(0xffeb6f10U, unwinder.frames()[38].sp);
510 EXPECT_EQ(0xf6f73552U, unwinder.frames()[39].pc);
511 EXPECT_EQ(0xffeb6fb0U, unwinder.frames()[39].sp);
512 EXPECT_EQ(0xf6f7499aU, unwinder.frames()[40].pc);
513 EXPECT_EQ(0xffeb7030U, unwinder.frames()[40].sp);
514 EXPECT_EQ(0xf7265362U, unwinder.frames()[41].pc);
515 EXPECT_EQ(0xffeb70a0U, unwinder.frames()[41].sp);
516 EXPECT_EQ(0xf72945bdU, unwinder.frames()[42].pc);
517 EXPECT_EQ(0xffeb71f0U, unwinder.frames()[42].sp);
Christopher Ferris6dbc28e2018-03-28 15:12:49 -0700518 EXPECT_EQ(0xee75aedbU, unwinder.frames()[43].pc);
Christopher Ferrisa2ec50b2018-02-21 15:39:07 -0800519 EXPECT_EQ(0xffeb7240U, unwinder.frames()[43].sp);
520 EXPECT_EQ(0xf728e4d2U, unwinder.frames()[44].pc);
521 EXPECT_EQ(0xffeb72a0U, unwinder.frames()[44].sp);
522 EXPECT_EQ(0xf6d27ab5U, unwinder.frames()[45].pc);
523 EXPECT_EQ(0xffeb72c0U, unwinder.frames()[45].sp);
524 EXPECT_EQ(0xf6f7df0dU, unwinder.frames()[46].pc);
525 EXPECT_EQ(0xffeb7360U, unwinder.frames()[46].sp);
526 EXPECT_EQ(0xf6f73552U, unwinder.frames()[47].pc);
527 EXPECT_EQ(0xffeb7400U, unwinder.frames()[47].sp);
528 EXPECT_EQ(0xf6f7499aU, unwinder.frames()[48].pc);
529 EXPECT_EQ(0xffeb7480U, unwinder.frames()[48].sp);
530 EXPECT_EQ(0xf7265362U, unwinder.frames()[49].pc);
531 EXPECT_EQ(0xffeb74f0U, unwinder.frames()[49].sp);
532 EXPECT_EQ(0xf72945bdU, unwinder.frames()[50].pc);
533 EXPECT_EQ(0xffeb7680U, unwinder.frames()[50].sp);
Christopher Ferris6dbc28e2018-03-28 15:12:49 -0700534 EXPECT_EQ(0xee756c21U, unwinder.frames()[51].pc);
Christopher Ferrisa2ec50b2018-02-21 15:39:07 -0800535 EXPECT_EQ(0xffeb76d0U, unwinder.frames()[51].sp);
536 EXPECT_EQ(0xf728e6a2U, unwinder.frames()[52].pc);
537 EXPECT_EQ(0xffeb76f0U, unwinder.frames()[52].sp);
538 EXPECT_EQ(0xf6d27acbU, unwinder.frames()[53].pc);
539 EXPECT_EQ(0xffeb7710U, unwinder.frames()[53].sp);
540 EXPECT_EQ(0xf6f7df0dU, unwinder.frames()[54].pc);
541 EXPECT_EQ(0xffeb77b0U, unwinder.frames()[54].sp);
542 EXPECT_EQ(0xf6f73552U, unwinder.frames()[55].pc);
543 EXPECT_EQ(0xffeb7850U, unwinder.frames()[55].sp);
544 EXPECT_EQ(0xf6f7499aU, unwinder.frames()[56].pc);
545 EXPECT_EQ(0xffeb78d0U, unwinder.frames()[56].sp);
546 EXPECT_EQ(0xf7265362U, unwinder.frames()[57].pc);
547 EXPECT_EQ(0xffeb7940U, unwinder.frames()[57].sp);
548 EXPECT_EQ(0xf72945bdU, unwinder.frames()[58].pc);
549 EXPECT_EQ(0xffeb7a80U, unwinder.frames()[58].sp);
550 EXPECT_EQ(0xf728e6a2U, unwinder.frames()[59].pc);
551 EXPECT_EQ(0xffeb7ad0U, unwinder.frames()[59].sp);
552 EXPECT_EQ(0xf6d27acbU, unwinder.frames()[60].pc);
553 EXPECT_EQ(0xffeb7af0U, unwinder.frames()[60].sp);
554 EXPECT_EQ(0xf718bc95U, unwinder.frames()[61].pc);
555 EXPECT_EQ(0xffeb7b90U, unwinder.frames()[61].sp);
556 EXPECT_EQ(0xf718bb5aU, unwinder.frames()[62].pc);
557 EXPECT_EQ(0xffeb7c50U, unwinder.frames()[62].sp);
558 EXPECT_EQ(0xf706b3ddU, unwinder.frames()[63].pc);
559 EXPECT_EQ(0xffeb7d10U, unwinder.frames()[63].sp);
560 EXPECT_EQ(0xf6d6548cU, unwinder.frames()[64].pc);
561 EXPECT_EQ(0xffeb7d70U, unwinder.frames()[64].sp);
562 EXPECT_EQ(0xf6d5df06U, unwinder.frames()[65].pc);
563 EXPECT_EQ(0xffeb7df0U, unwinder.frames()[65].sp);
564 EXPECT_EQ(0x56574d8cU, unwinder.frames()[66].pc);
565 EXPECT_EQ(0xffeb7e40U, unwinder.frames()[66].sp);
566 EXPECT_EQ(0x56574a80U, unwinder.frames()[67].pc);
567 EXPECT_EQ(0xffeb7e70U, unwinder.frames()[67].sp);
568 EXPECT_EQ(0xf7363275U, unwinder.frames()[68].pc);
569 EXPECT_EQ(0xffeb7ef0U, unwinder.frames()[68].sp);
Christopher Ferris150db122017-12-20 18:49:01 -0800570}
571
Christopher Ferrise37e2d02018-02-09 15:57:39 -0800572TEST_F(UnwindOfflineTest, jit_debug_arm) {
Christopher Ferris239425b2018-05-17 18:37:38 -0700573 ASSERT_NO_FATAL_FAILURE(Init("jit_debug_arm/", ARCH_ARM));
Christopher Ferrised37aca2018-01-12 15:53:19 -0800574
575 MemoryOfflineParts* memory = new MemoryOfflineParts;
Christopher Ferrise37e2d02018-02-09 15:57:39 -0800576 AddMemory(dir_ + "descriptor.data", memory);
577 AddMemory(dir_ + "descriptor1.data", memory);
578 AddMemory(dir_ + "stack.data", memory);
Christopher Ferrised37aca2018-01-12 15:53:19 -0800579 for (size_t i = 0; i < 7; i++) {
Christopher Ferrise37e2d02018-02-09 15:57:39 -0800580 AddMemory(dir_ + "entry" + std::to_string(i) + ".data", memory);
581 AddMemory(dir_ + "jit" + std::to_string(i) + ".data", memory);
Christopher Ferrised37aca2018-01-12 15:53:19 -0800582 }
Christopher Ferrise37e2d02018-02-09 15:57:39 -0800583 process_memory_.reset(memory);
Christopher Ferrised37aca2018-01-12 15:53:19 -0800584
Christopher Ferrise37e2d02018-02-09 15:57:39 -0800585 JitDebug jit_debug(process_memory_);
586 Unwinder unwinder(128, maps_.get(), regs_.get(), process_memory_);
587 unwinder.SetJitDebug(&jit_debug, regs_->Arch());
Christopher Ferrised37aca2018-01-12 15:53:19 -0800588 unwinder.Unwind();
Christopher Ferrised37aca2018-01-12 15:53:19 -0800589
590 std::string frame_info(DumpFrames(unwinder));
591 ASSERT_EQ(76U, unwinder.NumFrames()) << "Unwind:\n" << frame_info;
592 EXPECT_EQ(
Christopher Ferris704ec9a2018-03-15 14:35:01 -0700593 " #00 pc 00018a5e libarttestd.so (Java_Main_unwindInProcess+866)\n"
Christopher Ferrised37aca2018-01-12 15:53:19 -0800594 " #01 pc 0000212d (offset 0x2000) 137-cfi.odex (boolean Main.unwindInProcess(boolean, int, "
595 "boolean)+92)\n"
596 " #02 pc 00011cb1 anonymous:e2796000 (boolean Main.bar(boolean)+72)\n"
597 " #03 pc 00462175 libartd.so (art_quick_invoke_stub_internal+68)\n"
598 " #04 pc 00467129 libartd.so (art_quick_invoke_stub+228)\n"
599 " #05 pc 000bf7a9 libartd.so "
600 "(_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+864)\n"
601 " #06 pc 00247833 libartd.so "
602 "(_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPNS_"
603 "11ShadowFrameEtPNS_6JValueE+382)\n"
604 " #07 pc 0022e935 libartd.so "
605 "(_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_"
606 "6JValueEb+244)\n"
607 " #08 pc 0022f71d libartd.so "
608 "(_ZN3art11interpreter30EnterInterpreterFromEntryPointEPNS_6ThreadERKNS_"
609 "20CodeItemDataAccessorEPNS_11ShadowFrameE+128)\n"
610 " #09 pc 00442865 libartd.so (artQuickToInterpreterBridge+796)\n"
611 " #10 pc 004666ff libartd.so (art_quick_to_interpreter_bridge+30)\n"
612 " #11 pc 00011c31 anonymous:e2796000 (int Main.compare(Main, Main)+64)\n"
613 " #12 pc 00462175 libartd.so (art_quick_invoke_stub_internal+68)\n"
614 " #13 pc 00467129 libartd.so (art_quick_invoke_stub+228)\n"
615 " #14 pc 000bf7a9 libartd.so "
616 "(_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+864)\n"
617 " #15 pc 00247833 libartd.so "
618 "(_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPNS_"
619 "11ShadowFrameEtPNS_6JValueE+382)\n"
620 " #16 pc 0022e935 libartd.so "
621 "(_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_"
622 "6JValueEb+244)\n"
623 " #17 pc 0022f71d libartd.so "
624 "(_ZN3art11interpreter30EnterInterpreterFromEntryPointEPNS_6ThreadERKNS_"
625 "20CodeItemDataAccessorEPNS_11ShadowFrameE+128)\n"
626 " #18 pc 00442865 libartd.so (artQuickToInterpreterBridge+796)\n"
627 " #19 pc 004666ff libartd.so (art_quick_to_interpreter_bridge+30)\n"
628 " #20 pc 00011b77 anonymous:e2796000 (int Main.compare(java.lang.Object, "
629 "java.lang.Object)+118)\n"
630 " #21 pc 00462175 libartd.so (art_quick_invoke_stub_internal+68)\n"
631 " #22 pc 00467129 libartd.so (art_quick_invoke_stub+228)\n"
632 " #23 pc 000bf7a9 libartd.so "
633 "(_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+864)\n"
634 " #24 pc 00247833 libartd.so "
635 "(_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPNS_"
636 "11ShadowFrameEtPNS_6JValueE+382)\n"
637 " #25 pc 0022e935 libartd.so "
638 "(_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_"
639 "6JValueEb+244)\n"
640 " #26 pc 0022f71d libartd.so "
641 "(_ZN3art11interpreter30EnterInterpreterFromEntryPointEPNS_6ThreadERKNS_"
642 "20CodeItemDataAccessorEPNS_11ShadowFrameE+128)\n"
643 " #27 pc 00442865 libartd.so (artQuickToInterpreterBridge+796)\n"
644 " #28 pc 004666ff libartd.so (art_quick_to_interpreter_bridge+30)\n"
645 " #29 pc 00011a29 anonymous:e2796000 (int "
646 "java.util.Arrays.binarySearch0(java.lang.Object[], int, int, java.lang.Object, "
647 "java.util.Comparator)+304)\n"
648 " #30 pc 00462175 libartd.so (art_quick_invoke_stub_internal+68)\n"
649 " #31 pc 0046722f libartd.so (art_quick_invoke_static_stub+226)\n"
650 " #32 pc 000bf7bb libartd.so "
651 "(_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+882)\n"
652 " #33 pc 00247833 libartd.so "
653 "(_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPNS_"
654 "11ShadowFrameEtPNS_6JValueE+382)\n"
655 " #34 pc 0022e935 libartd.so "
656 "(_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_"
657 "6JValueEb+244)\n"
658 " #35 pc 0022f71d libartd.so "
659 "(_ZN3art11interpreter30EnterInterpreterFromEntryPointEPNS_6ThreadERKNS_"
660 "20CodeItemDataAccessorEPNS_11ShadowFrameE+128)\n"
661 " #36 pc 00442865 libartd.so (artQuickToInterpreterBridge+796)\n"
662 " #37 pc 004666ff libartd.so (art_quick_to_interpreter_bridge+30)\n"
663 " #38 pc 0001139b anonymous:e2796000 (boolean Main.foo()+178)\n"
664 " #39 pc 00462175 libartd.so (art_quick_invoke_stub_internal+68)\n"
665 " #40 pc 00467129 libartd.so (art_quick_invoke_stub+228)\n"
666 " #41 pc 000bf7a9 libartd.so "
667 "(_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+864)\n"
668 " #42 pc 00247833 libartd.so "
669 "(_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPNS_"
670 "11ShadowFrameEtPNS_6JValueE+382)\n"
671 " #43 pc 0022e935 libartd.so "
672 "(_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_"
673 "6JValueEb+244)\n"
674 " #44 pc 0022f71d libartd.so "
675 "(_ZN3art11interpreter30EnterInterpreterFromEntryPointEPNS_6ThreadERKNS_"
676 "20CodeItemDataAccessorEPNS_11ShadowFrameE+128)\n"
677 " #45 pc 00442865 libartd.so (artQuickToInterpreterBridge+796)\n"
678 " #46 pc 004666ff libartd.so (art_quick_to_interpreter_bridge+30)\n"
679 " #47 pc 00010aa7 anonymous:e2796000 (void Main.runPrimary()+70)\n"
680 " #48 pc 00462175 libartd.so (art_quick_invoke_stub_internal+68)\n"
681 " #49 pc 00467129 libartd.so (art_quick_invoke_stub+228)\n"
682 " #50 pc 000bf7a9 libartd.so "
683 "(_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+864)\n"
684 " #51 pc 00247833 libartd.so "
685 "(_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPNS_"
686 "11ShadowFrameEtPNS_6JValueE+382)\n"
687 " #52 pc 0022e935 libartd.so "
688 "(_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_"
689 "6JValueEb+244)\n"
690 " #53 pc 0022f71d libartd.so "
691 "(_ZN3art11interpreter30EnterInterpreterFromEntryPointEPNS_6ThreadERKNS_"
692 "20CodeItemDataAccessorEPNS_11ShadowFrameE+128)\n"
693 " #54 pc 00442865 libartd.so (artQuickToInterpreterBridge+796)\n"
694 " #55 pc 004666ff libartd.so (art_quick_to_interpreter_bridge+30)\n"
695 " #56 pc 0000ba99 anonymous:e2796000 (void Main.main(java.lang.String[])+144)\n"
696 " #57 pc 00462175 libartd.so (art_quick_invoke_stub_internal+68)\n"
697 " #58 pc 0046722f libartd.so (art_quick_invoke_static_stub+226)\n"
698 " #59 pc 000bf7bb libartd.so "
699 "(_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+882)\n"
700 " #60 pc 00247833 libartd.so "
701 "(_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPNS_"
702 "11ShadowFrameEtPNS_6JValueE+382)\n"
703 " #61 pc 0022e935 libartd.so "
704 "(_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_"
705 "6JValueEb+244)\n"
706 " #62 pc 0022f71d libartd.so "
707 "(_ZN3art11interpreter30EnterInterpreterFromEntryPointEPNS_6ThreadERKNS_"
708 "20CodeItemDataAccessorEPNS_11ShadowFrameE+128)\n"
709 " #63 pc 00442865 libartd.so (artQuickToInterpreterBridge+796)\n"
710 " #64 pc 004666ff libartd.so (art_quick_to_interpreter_bridge+30)\n"
711 " #65 pc 00462175 libartd.so (art_quick_invoke_stub_internal+68)\n"
712 " #66 pc 0046722f libartd.so (art_quick_invoke_static_stub+226)\n"
713 " #67 pc 000bf7bb libartd.so "
714 "(_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+882)\n"
715 " #68 pc 003b292d libartd.so "
716 "(_ZN3artL18InvokeWithArgArrayERKNS_33ScopedObjectAccessAlreadyRunnableEPNS_9ArtMethodEPNS_"
717 "8ArgArrayEPNS_6JValueEPKc+52)\n"
718 " #69 pc 003b26c3 libartd.so "
719 "(_ZN3art17InvokeWithVarArgsERKNS_33ScopedObjectAccessAlreadyRunnableEP8_jobjectP10_"
720 "jmethodIDSt9__va_list+210)\n"
721 " #70 pc 00308411 libartd.so "
722 "(_ZN3art3JNI21CallStaticVoidMethodVEP7_JNIEnvP7_jclassP10_jmethodIDSt9__va_list+76)\n"
723 " #71 pc 000e6a9f libartd.so "
724 "(_ZN3art8CheckJNI11CallMethodVEPKcP7_JNIEnvP8_jobjectP7_jclassP10_jmethodIDSt9__va_listNS_"
725 "9Primitive4TypeENS_10InvokeTypeE+1486)\n"
726 " #72 pc 000e19b9 libartd.so "
727 "(_ZN3art8CheckJNI21CallStaticVoidMethodVEP7_JNIEnvP7_jclassP10_jmethodIDSt9__va_list+40)\n"
728 " #73 pc 0000159f dalvikvm32 "
729 "(_ZN7_JNIEnv20CallStaticVoidMethodEP7_jclassP10_jmethodIDz+30)\n"
730 " #74 pc 00001349 dalvikvm32 (main+896)\n"
731 " #75 pc 000850c9 libc.so\n",
732 frame_info);
Christopher Ferrisa2ec50b2018-02-21 15:39:07 -0800733 EXPECT_EQ(0xdfe66a5eU, unwinder.frames()[0].pc);
734 EXPECT_EQ(0xff85d180U, unwinder.frames()[0].sp);
735 EXPECT_EQ(0xe044712dU, unwinder.frames()[1].pc);
736 EXPECT_EQ(0xff85d200U, unwinder.frames()[1].sp);
737 EXPECT_EQ(0xe27a7cb1U, unwinder.frames()[2].pc);
738 EXPECT_EQ(0xff85d290U, unwinder.frames()[2].sp);
739 EXPECT_EQ(0xed75c175U, unwinder.frames()[3].pc);
740 EXPECT_EQ(0xff85d2b0U, unwinder.frames()[3].sp);
741 EXPECT_EQ(0xed761129U, unwinder.frames()[4].pc);
742 EXPECT_EQ(0xff85d2e8U, unwinder.frames()[4].sp);
743 EXPECT_EQ(0xed3b97a9U, unwinder.frames()[5].pc);
744 EXPECT_EQ(0xff85d370U, unwinder.frames()[5].sp);
745 EXPECT_EQ(0xed541833U, unwinder.frames()[6].pc);
746 EXPECT_EQ(0xff85d3d8U, unwinder.frames()[6].sp);
747 EXPECT_EQ(0xed528935U, unwinder.frames()[7].pc);
748 EXPECT_EQ(0xff85d428U, unwinder.frames()[7].sp);
749 EXPECT_EQ(0xed52971dU, unwinder.frames()[8].pc);
750 EXPECT_EQ(0xff85d470U, unwinder.frames()[8].sp);
751 EXPECT_EQ(0xed73c865U, unwinder.frames()[9].pc);
752 EXPECT_EQ(0xff85d4b0U, unwinder.frames()[9].sp);
753 EXPECT_EQ(0xed7606ffU, unwinder.frames()[10].pc);
754 EXPECT_EQ(0xff85d5d0U, unwinder.frames()[10].sp);
755 EXPECT_EQ(0xe27a7c31U, unwinder.frames()[11].pc);
756 EXPECT_EQ(0xff85d640U, unwinder.frames()[11].sp);
757 EXPECT_EQ(0xed75c175U, unwinder.frames()[12].pc);
758 EXPECT_EQ(0xff85d660U, unwinder.frames()[12].sp);
759 EXPECT_EQ(0xed761129U, unwinder.frames()[13].pc);
760 EXPECT_EQ(0xff85d698U, unwinder.frames()[13].sp);
761 EXPECT_EQ(0xed3b97a9U, unwinder.frames()[14].pc);
762 EXPECT_EQ(0xff85d720U, unwinder.frames()[14].sp);
763 EXPECT_EQ(0xed541833U, unwinder.frames()[15].pc);
764 EXPECT_EQ(0xff85d788U, unwinder.frames()[15].sp);
765 EXPECT_EQ(0xed528935U, unwinder.frames()[16].pc);
766 EXPECT_EQ(0xff85d7d8U, unwinder.frames()[16].sp);
767 EXPECT_EQ(0xed52971dU, unwinder.frames()[17].pc);
768 EXPECT_EQ(0xff85d820U, unwinder.frames()[17].sp);
769 EXPECT_EQ(0xed73c865U, unwinder.frames()[18].pc);
770 EXPECT_EQ(0xff85d860U, unwinder.frames()[18].sp);
771 EXPECT_EQ(0xed7606ffU, unwinder.frames()[19].pc);
772 EXPECT_EQ(0xff85d970U, unwinder.frames()[19].sp);
773 EXPECT_EQ(0xe27a7b77U, unwinder.frames()[20].pc);
774 EXPECT_EQ(0xff85d9e0U, unwinder.frames()[20].sp);
775 EXPECT_EQ(0xed75c175U, unwinder.frames()[21].pc);
776 EXPECT_EQ(0xff85da10U, unwinder.frames()[21].sp);
777 EXPECT_EQ(0xed761129U, unwinder.frames()[22].pc);
778 EXPECT_EQ(0xff85da48U, unwinder.frames()[22].sp);
779 EXPECT_EQ(0xed3b97a9U, unwinder.frames()[23].pc);
780 EXPECT_EQ(0xff85dad0U, unwinder.frames()[23].sp);
781 EXPECT_EQ(0xed541833U, unwinder.frames()[24].pc);
782 EXPECT_EQ(0xff85db38U, unwinder.frames()[24].sp);
783 EXPECT_EQ(0xed528935U, unwinder.frames()[25].pc);
784 EXPECT_EQ(0xff85db88U, unwinder.frames()[25].sp);
785 EXPECT_EQ(0xed52971dU, unwinder.frames()[26].pc);
786 EXPECT_EQ(0xff85dbd0U, unwinder.frames()[26].sp);
787 EXPECT_EQ(0xed73c865U, unwinder.frames()[27].pc);
788 EXPECT_EQ(0xff85dc10U, unwinder.frames()[27].sp);
789 EXPECT_EQ(0xed7606ffU, unwinder.frames()[28].pc);
790 EXPECT_EQ(0xff85dd20U, unwinder.frames()[28].sp);
791 EXPECT_EQ(0xe27a7a29U, unwinder.frames()[29].pc);
792 EXPECT_EQ(0xff85dd90U, unwinder.frames()[29].sp);
793 EXPECT_EQ(0xed75c175U, unwinder.frames()[30].pc);
794 EXPECT_EQ(0xff85ddc0U, unwinder.frames()[30].sp);
795 EXPECT_EQ(0xed76122fU, unwinder.frames()[31].pc);
796 EXPECT_EQ(0xff85de08U, unwinder.frames()[31].sp);
797 EXPECT_EQ(0xed3b97bbU, unwinder.frames()[32].pc);
798 EXPECT_EQ(0xff85de90U, unwinder.frames()[32].sp);
799 EXPECT_EQ(0xed541833U, unwinder.frames()[33].pc);
800 EXPECT_EQ(0xff85def8U, unwinder.frames()[33].sp);
801 EXPECT_EQ(0xed528935U, unwinder.frames()[34].pc);
802 EXPECT_EQ(0xff85df48U, unwinder.frames()[34].sp);
803 EXPECT_EQ(0xed52971dU, unwinder.frames()[35].pc);
804 EXPECT_EQ(0xff85df90U, unwinder.frames()[35].sp);
805 EXPECT_EQ(0xed73c865U, unwinder.frames()[36].pc);
806 EXPECT_EQ(0xff85dfd0U, unwinder.frames()[36].sp);
807 EXPECT_EQ(0xed7606ffU, unwinder.frames()[37].pc);
808 EXPECT_EQ(0xff85e110U, unwinder.frames()[37].sp);
809 EXPECT_EQ(0xe27a739bU, unwinder.frames()[38].pc);
810 EXPECT_EQ(0xff85e180U, unwinder.frames()[38].sp);
811 EXPECT_EQ(0xed75c175U, unwinder.frames()[39].pc);
812 EXPECT_EQ(0xff85e1b0U, unwinder.frames()[39].sp);
813 EXPECT_EQ(0xed761129U, unwinder.frames()[40].pc);
814 EXPECT_EQ(0xff85e1e0U, unwinder.frames()[40].sp);
815 EXPECT_EQ(0xed3b97a9U, unwinder.frames()[41].pc);
816 EXPECT_EQ(0xff85e268U, unwinder.frames()[41].sp);
817 EXPECT_EQ(0xed541833U, unwinder.frames()[42].pc);
818 EXPECT_EQ(0xff85e2d0U, unwinder.frames()[42].sp);
819 EXPECT_EQ(0xed528935U, unwinder.frames()[43].pc);
820 EXPECT_EQ(0xff85e320U, unwinder.frames()[43].sp);
821 EXPECT_EQ(0xed52971dU, unwinder.frames()[44].pc);
822 EXPECT_EQ(0xff85e368U, unwinder.frames()[44].sp);
823 EXPECT_EQ(0xed73c865U, unwinder.frames()[45].pc);
824 EXPECT_EQ(0xff85e3a8U, unwinder.frames()[45].sp);
825 EXPECT_EQ(0xed7606ffU, unwinder.frames()[46].pc);
826 EXPECT_EQ(0xff85e4c0U, unwinder.frames()[46].sp);
827 EXPECT_EQ(0xe27a6aa7U, unwinder.frames()[47].pc);
828 EXPECT_EQ(0xff85e530U, unwinder.frames()[47].sp);
829 EXPECT_EQ(0xed75c175U, unwinder.frames()[48].pc);
830 EXPECT_EQ(0xff85e5a0U, unwinder.frames()[48].sp);
831 EXPECT_EQ(0xed761129U, unwinder.frames()[49].pc);
832 EXPECT_EQ(0xff85e5d8U, unwinder.frames()[49].sp);
833 EXPECT_EQ(0xed3b97a9U, unwinder.frames()[50].pc);
834 EXPECT_EQ(0xff85e660U, unwinder.frames()[50].sp);
835 EXPECT_EQ(0xed541833U, unwinder.frames()[51].pc);
836 EXPECT_EQ(0xff85e6c8U, unwinder.frames()[51].sp);
837 EXPECT_EQ(0xed528935U, unwinder.frames()[52].pc);
838 EXPECT_EQ(0xff85e718U, unwinder.frames()[52].sp);
839 EXPECT_EQ(0xed52971dU, unwinder.frames()[53].pc);
840 EXPECT_EQ(0xff85e760U, unwinder.frames()[53].sp);
841 EXPECT_EQ(0xed73c865U, unwinder.frames()[54].pc);
842 EXPECT_EQ(0xff85e7a0U, unwinder.frames()[54].sp);
843 EXPECT_EQ(0xed7606ffU, unwinder.frames()[55].pc);
844 EXPECT_EQ(0xff85e8f0U, unwinder.frames()[55].sp);
845 EXPECT_EQ(0xe27a1a99U, unwinder.frames()[56].pc);
846 EXPECT_EQ(0xff85e960U, unwinder.frames()[56].sp);
847 EXPECT_EQ(0xed75c175U, unwinder.frames()[57].pc);
848 EXPECT_EQ(0xff85e990U, unwinder.frames()[57].sp);
849 EXPECT_EQ(0xed76122fU, unwinder.frames()[58].pc);
850 EXPECT_EQ(0xff85e9c8U, unwinder.frames()[58].sp);
851 EXPECT_EQ(0xed3b97bbU, unwinder.frames()[59].pc);
852 EXPECT_EQ(0xff85ea50U, unwinder.frames()[59].sp);
853 EXPECT_EQ(0xed541833U, unwinder.frames()[60].pc);
854 EXPECT_EQ(0xff85eab8U, unwinder.frames()[60].sp);
855 EXPECT_EQ(0xed528935U, unwinder.frames()[61].pc);
856 EXPECT_EQ(0xff85eb08U, unwinder.frames()[61].sp);
857 EXPECT_EQ(0xed52971dU, unwinder.frames()[62].pc);
858 EXPECT_EQ(0xff85eb50U, unwinder.frames()[62].sp);
859 EXPECT_EQ(0xed73c865U, unwinder.frames()[63].pc);
860 EXPECT_EQ(0xff85eb90U, unwinder.frames()[63].sp);
861 EXPECT_EQ(0xed7606ffU, unwinder.frames()[64].pc);
862 EXPECT_EQ(0xff85ec90U, unwinder.frames()[64].sp);
863 EXPECT_EQ(0xed75c175U, unwinder.frames()[65].pc);
864 EXPECT_EQ(0xff85ed00U, unwinder.frames()[65].sp);
865 EXPECT_EQ(0xed76122fU, unwinder.frames()[66].pc);
866 EXPECT_EQ(0xff85ed38U, unwinder.frames()[66].sp);
867 EXPECT_EQ(0xed3b97bbU, unwinder.frames()[67].pc);
868 EXPECT_EQ(0xff85edc0U, unwinder.frames()[67].sp);
869 EXPECT_EQ(0xed6ac92dU, unwinder.frames()[68].pc);
870 EXPECT_EQ(0xff85ee28U, unwinder.frames()[68].sp);
871 EXPECT_EQ(0xed6ac6c3U, unwinder.frames()[69].pc);
872 EXPECT_EQ(0xff85eeb8U, unwinder.frames()[69].sp);
873 EXPECT_EQ(0xed602411U, unwinder.frames()[70].pc);
874 EXPECT_EQ(0xff85ef48U, unwinder.frames()[70].sp);
875 EXPECT_EQ(0xed3e0a9fU, unwinder.frames()[71].pc);
876 EXPECT_EQ(0xff85ef90U, unwinder.frames()[71].sp);
877 EXPECT_EQ(0xed3db9b9U, unwinder.frames()[72].pc);
878 EXPECT_EQ(0xff85f008U, unwinder.frames()[72].sp);
879 EXPECT_EQ(0xab0d459fU, unwinder.frames()[73].pc);
880 EXPECT_EQ(0xff85f038U, unwinder.frames()[73].sp);
881 EXPECT_EQ(0xab0d4349U, unwinder.frames()[74].pc);
882 EXPECT_EQ(0xff85f050U, unwinder.frames()[74].sp);
883 EXPECT_EQ(0xedb0d0c9U, unwinder.frames()[75].pc);
884 EXPECT_EQ(0xff85f0c0U, unwinder.frames()[75].sp);
Christopher Ferrised37aca2018-01-12 15:53:19 -0800885}
886
Christopher Ferris1a141a02018-01-24 08:52:47 -0800887// The eh_frame_hdr data is present but set to zero fdes. This should
888// fallback to iterating over the cies/fdes and ignore the eh_frame_hdr.
889// No .gnu_debugdata section in the elf file, so no symbols.
Christopher Ferrise37e2d02018-02-09 15:57:39 -0800890TEST_F(UnwindOfflineTest, bad_eh_frame_hdr_arm64) {
Christopher Ferris239425b2018-05-17 18:37:38 -0700891 ASSERT_NO_FATAL_FAILURE(Init("bad_eh_frame_hdr_arm64/", ARCH_ARM64));
Christopher Ferris1a141a02018-01-24 08:52:47 -0800892
Christopher Ferrise37e2d02018-02-09 15:57:39 -0800893 Unwinder unwinder(128, maps_.get(), regs_.get(), process_memory_);
Christopher Ferris1a141a02018-01-24 08:52:47 -0800894 unwinder.Unwind();
Christopher Ferris1a141a02018-01-24 08:52:47 -0800895
896 std::string frame_info(DumpFrames(unwinder));
897 ASSERT_EQ(5U, unwinder.NumFrames()) << "Unwind:\n" << frame_info;
898 EXPECT_EQ(
899 " #00 pc 0000000000000550 waiter64\n"
900 " #01 pc 0000000000000568 waiter64\n"
901 " #02 pc 000000000000057c waiter64\n"
902 " #03 pc 0000000000000590 waiter64\n"
903 " #04 pc 00000000000a8e98 libc.so (__libc_init+88)\n",
904 frame_info);
Christopher Ferrisa2ec50b2018-02-21 15:39:07 -0800905 EXPECT_EQ(0x60a9fdf550U, unwinder.frames()[0].pc);
906 EXPECT_EQ(0x7fdd141990U, unwinder.frames()[0].sp);
907 EXPECT_EQ(0x60a9fdf568U, unwinder.frames()[1].pc);
908 EXPECT_EQ(0x7fdd1419a0U, unwinder.frames()[1].sp);
909 EXPECT_EQ(0x60a9fdf57cU, unwinder.frames()[2].pc);
910 EXPECT_EQ(0x7fdd1419b0U, unwinder.frames()[2].sp);
911 EXPECT_EQ(0x60a9fdf590U, unwinder.frames()[3].pc);
912 EXPECT_EQ(0x7fdd1419c0U, unwinder.frames()[3].sp);
913 EXPECT_EQ(0x7542d68e98U, unwinder.frames()[4].pc);
914 EXPECT_EQ(0x7fdd1419d0U, unwinder.frames()[4].sp);
Christopher Ferris1a141a02018-01-24 08:52:47 -0800915}
916
917// The elf has bad eh_frame unwind information for the pcs. If eh_frame
918// is used first, the unwind will not match the expected output.
Christopher Ferrise37e2d02018-02-09 15:57:39 -0800919TEST_F(UnwindOfflineTest, debug_frame_first_x86) {
Christopher Ferris239425b2018-05-17 18:37:38 -0700920 ASSERT_NO_FATAL_FAILURE(Init("debug_frame_first_x86/", ARCH_X86));
Christopher Ferris1a141a02018-01-24 08:52:47 -0800921
Christopher Ferrise37e2d02018-02-09 15:57:39 -0800922 Unwinder unwinder(128, maps_.get(), regs_.get(), process_memory_);
Christopher Ferris1a141a02018-01-24 08:52:47 -0800923 unwinder.Unwind();
Christopher Ferris1a141a02018-01-24 08:52:47 -0800924
925 std::string frame_info(DumpFrames(unwinder));
926 ASSERT_EQ(5U, unwinder.NumFrames()) << "Unwind:\n" << frame_info;
927 EXPECT_EQ(
928 " #00 pc 00000685 waiter (call_level3+53)\n"
929 " #01 pc 000006b7 waiter (call_level2+23)\n"
930 " #02 pc 000006d7 waiter (call_level1+23)\n"
931 " #03 pc 000006f7 waiter (main+23)\n"
932 " #04 pc 00018275 libc.so\n",
933 frame_info);
Christopher Ferrisa2ec50b2018-02-21 15:39:07 -0800934 EXPECT_EQ(0x56598685U, unwinder.frames()[0].pc);
935 EXPECT_EQ(0xffcf9e38U, unwinder.frames()[0].sp);
936 EXPECT_EQ(0x565986b7U, unwinder.frames()[1].pc);
937 EXPECT_EQ(0xffcf9e50U, unwinder.frames()[1].sp);
938 EXPECT_EQ(0x565986d7U, unwinder.frames()[2].pc);
939 EXPECT_EQ(0xffcf9e60U, unwinder.frames()[2].sp);
940 EXPECT_EQ(0x565986f7U, unwinder.frames()[3].pc);
941 EXPECT_EQ(0xffcf9e70U, unwinder.frames()[3].sp);
942 EXPECT_EQ(0xf744a275U, unwinder.frames()[4].pc);
943 EXPECT_EQ(0xffcf9e80U, unwinder.frames()[4].sp);
Christopher Ferris1a141a02018-01-24 08:52:47 -0800944}
945
Christopher Ferrise37e2d02018-02-09 15:57:39 -0800946// Make sure that a pc that is at the beginning of an fde unwinds correctly.
947TEST_F(UnwindOfflineTest, eh_frame_hdr_begin_x86_64) {
Christopher Ferris239425b2018-05-17 18:37:38 -0700948 ASSERT_NO_FATAL_FAILURE(Init("eh_frame_hdr_begin_x86_64/", ARCH_X86_64));
Christopher Ferrise37e2d02018-02-09 15:57:39 -0800949
950 Unwinder unwinder(128, maps_.get(), regs_.get(), process_memory_);
951 unwinder.Unwind();
952
953 std::string frame_info(DumpFrames(unwinder));
954 ASSERT_EQ(5U, unwinder.NumFrames()) << "Unwind:\n" << frame_info;
955 EXPECT_EQ(
956 " #00 pc 0000000000000a80 unwind_test64 (calling3)\n"
957 " #01 pc 0000000000000dd9 unwind_test64 (calling2+633)\n"
958 " #02 pc 000000000000121e unwind_test64 (calling1+638)\n"
959 " #03 pc 00000000000013ed unwind_test64 (main+13)\n"
960 " #04 pc 00000000000202b0 libc.so\n",
961 frame_info);
Christopher Ferrisa2ec50b2018-02-21 15:39:07 -0800962 EXPECT_EQ(0x561550b17a80U, unwinder.frames()[0].pc);
963 EXPECT_EQ(0x7ffcc8596ce8U, unwinder.frames()[0].sp);
964 EXPECT_EQ(0x561550b17dd9U, unwinder.frames()[1].pc);
965 EXPECT_EQ(0x7ffcc8596cf0U, unwinder.frames()[1].sp);
966 EXPECT_EQ(0x561550b1821eU, unwinder.frames()[2].pc);
967 EXPECT_EQ(0x7ffcc8596f40U, unwinder.frames()[2].sp);
968 EXPECT_EQ(0x561550b183edU, unwinder.frames()[3].pc);
969 EXPECT_EQ(0x7ffcc8597190U, unwinder.frames()[3].sp);
970 EXPECT_EQ(0x7f4de62162b0U, unwinder.frames()[4].pc);
971 EXPECT_EQ(0x7ffcc85971a0U, unwinder.frames()[4].sp);
Christopher Ferrise37e2d02018-02-09 15:57:39 -0800972}
973
Yabin Cui11e96fe2018-03-14 18:16:22 -0700974TEST_F(UnwindOfflineTest, art_quick_osr_stub_arm) {
Christopher Ferris239425b2018-05-17 18:37:38 -0700975 ASSERT_NO_FATAL_FAILURE(Init("art_quick_osr_stub_arm/", ARCH_ARM));
Yabin Cui11e96fe2018-03-14 18:16:22 -0700976
977 MemoryOfflineParts* memory = new MemoryOfflineParts;
978 AddMemory(dir_ + "descriptor.data", memory);
979 AddMemory(dir_ + "stack.data", memory);
980 for (size_t i = 0; i < 2; i++) {
981 AddMemory(dir_ + "entry" + std::to_string(i) + ".data", memory);
982 AddMemory(dir_ + "jit" + std::to_string(i) + ".data", memory);
983 }
984 process_memory_.reset(memory);
985
986 JitDebug jit_debug(process_memory_);
987 Unwinder unwinder(128, maps_.get(), regs_.get(), process_memory_);
988 unwinder.SetJitDebug(&jit_debug, regs_->Arch());
989 unwinder.Unwind();
990
991 std::string frame_info(DumpFrames(unwinder));
992 ASSERT_EQ(25U, unwinder.NumFrames()) << "Unwind:\n" << frame_info;
993 EXPECT_EQ(
994 " #00 pc 0000c788 <anonymous:d0250000> "
995 "(com.example.simpleperf.simpleperfexamplewithnative.MixActivity.access$000)\n"
996 " #01 pc 0000cdd5 <anonymous:d0250000> "
997 "(com.example.simpleperf.simpleperfexamplewithnative.MixActivity$1.run+60)\n"
998 " #02 pc 004135bb libart.so (art_quick_osr_stub+42)\n"
999 " #03 pc 002657a5 libart.so "
1000 "(_ZN3art3jit3Jit25MaybeDoOnStackReplacementEPNS_6ThreadEPNS_9ArtMethodEjiPNS_6JValueE+876)\n"
1001 " #04 pc 004021a7 libart.so (MterpMaybeDoOnStackReplacement+86)\n"
1002 " #05 pc 00412474 libart.so (ExecuteMterpImpl+66164)\n"
1003 " #06 pc cd8365b0 <unknown>\n" // symbol in dex file
1004 " #07 pc 001d7f1b libart.so "
1005 "(_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_"
1006 "6JValueEb+374)\n"
1007 " #08 pc 001dc593 libart.so "
1008 "(_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadERKNS_"
1009 "20CodeItemDataAccessorEPNS_11ShadowFrameEPNS_6JValueE+154)\n"
1010 " #09 pc 001f4d01 libart.so "
1011 "(_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_"
1012 "11InstructionEtPNS_6JValueE+732)\n"
1013 " #10 pc 003fe427 libart.so (MterpInvokeInterface+1354)\n"
1014 " #11 pc 00405b94 libart.so (ExecuteMterpImpl+14740)\n"
1015 " #12 pc 7004873e <unknown>\n" // symbol in dex file
1016 " #13 pc 001d7f1b libart.so "
1017 "(_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_"
1018 "6JValueEb+374)\n"
1019 " #14 pc 001dc4d5 libart.so "
1020 "(_ZN3art11interpreter30EnterInterpreterFromEntryPointEPNS_6ThreadERKNS_"
1021 "20CodeItemDataAccessorEPNS_11ShadowFrameE+92)\n"
1022 " #15 pc 003f25ab libart.so (artQuickToInterpreterBridge+970)\n"
1023 " #16 pc 00417aff libart.so (art_quick_to_interpreter_bridge+30)\n"
1024 " #17 pc 00413575 libart.so (art_quick_invoke_stub_internal+68)\n"
1025 " #18 pc 00418531 libart.so (art_quick_invoke_stub+236)\n"
1026 " #19 pc 000b468d libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+136)\n"
1027 " #20 pc 00362f49 libart.so "
1028 "(_ZN3art12_GLOBAL__N_118InvokeWithArgArrayERKNS_33ScopedObjectAccessAlreadyRunnableEPNS_"
1029 "9ArtMethodEPNS0_8ArgArrayEPNS_6JValueEPKc+52)\n"
1030 " #21 pc 00363cd9 libart.so "
1031 "(_ZN3art35InvokeVirtualOrInterfaceWithJValuesERKNS_33ScopedObjectAccessAlreadyRunnableEP8_"
1032 "jobjectP10_jmethodIDP6jvalue+332)\n"
1033 " #22 pc 003851dd libart.so (_ZN3art6Thread14CreateCallbackEPv+868)\n"
1034 " #23 pc 00062925 libc.so (_ZL15__pthread_startPv+22)\n"
1035 " #24 pc 0001de39 libc.so (__start_thread+24)\n",
1036 frame_info);
1037 EXPECT_EQ(0xd025c788U, unwinder.frames()[0].pc);
1038 EXPECT_EQ(0xcd4ff140U, unwinder.frames()[0].sp);
1039 EXPECT_EQ(0xd025cdd5U, unwinder.frames()[1].pc);
1040 EXPECT_EQ(0xcd4ff140U, unwinder.frames()[1].sp);
1041 EXPECT_EQ(0xe4a755bbU, unwinder.frames()[2].pc);
1042 EXPECT_EQ(0xcd4ff160U, unwinder.frames()[2].sp);
1043 EXPECT_EQ(0xe48c77a5U, unwinder.frames()[3].pc);
1044 EXPECT_EQ(0xcd4ff190U, unwinder.frames()[3].sp);
1045 EXPECT_EQ(0xe4a641a7U, unwinder.frames()[4].pc);
1046 EXPECT_EQ(0xcd4ff298U, unwinder.frames()[4].sp);
1047 EXPECT_EQ(0xe4a74474U, unwinder.frames()[5].pc);
1048 EXPECT_EQ(0xcd4ff2b8U, unwinder.frames()[5].sp);
1049 EXPECT_EQ(0xcd8365b0U, unwinder.frames()[6].pc);
1050 EXPECT_EQ(0xcd4ff2e0U, unwinder.frames()[6].sp);
1051 EXPECT_EQ(0xe4839f1bU, unwinder.frames()[7].pc);
1052 EXPECT_EQ(0xcd4ff2e0U, unwinder.frames()[7].sp);
1053 EXPECT_EQ(0xe483e593U, unwinder.frames()[8].pc);
1054 EXPECT_EQ(0xcd4ff330U, unwinder.frames()[8].sp);
1055 EXPECT_EQ(0xe4856d01U, unwinder.frames()[9].pc);
1056 EXPECT_EQ(0xcd4ff380U, unwinder.frames()[9].sp);
1057 EXPECT_EQ(0xe4a60427U, unwinder.frames()[10].pc);
1058 EXPECT_EQ(0xcd4ff430U, unwinder.frames()[10].sp);
1059 EXPECT_EQ(0xe4a67b94U, unwinder.frames()[11].pc);
1060 EXPECT_EQ(0xcd4ff498U, unwinder.frames()[11].sp);
1061 EXPECT_EQ(0x7004873eU, unwinder.frames()[12].pc);
1062 EXPECT_EQ(0xcd4ff4c0U, unwinder.frames()[12].sp);
1063 EXPECT_EQ(0xe4839f1bU, unwinder.frames()[13].pc);
1064 EXPECT_EQ(0xcd4ff4c0U, unwinder.frames()[13].sp);
1065 EXPECT_EQ(0xe483e4d5U, unwinder.frames()[14].pc);
1066 EXPECT_EQ(0xcd4ff510U, unwinder.frames()[14].sp);
1067 EXPECT_EQ(0xe4a545abU, unwinder.frames()[15].pc);
1068 EXPECT_EQ(0xcd4ff538U, unwinder.frames()[15].sp);
1069 EXPECT_EQ(0xe4a79affU, unwinder.frames()[16].pc);
1070 EXPECT_EQ(0xcd4ff640U, unwinder.frames()[16].sp);
1071 EXPECT_EQ(0xe4a75575U, unwinder.frames()[17].pc);
1072 EXPECT_EQ(0xcd4ff6b0U, unwinder.frames()[17].sp);
1073 EXPECT_EQ(0xe4a7a531U, unwinder.frames()[18].pc);
1074 EXPECT_EQ(0xcd4ff6e8U, unwinder.frames()[18].sp);
1075 EXPECT_EQ(0xe471668dU, unwinder.frames()[19].pc);
1076 EXPECT_EQ(0xcd4ff770U, unwinder.frames()[19].sp);
1077 EXPECT_EQ(0xe49c4f49U, unwinder.frames()[20].pc);
1078 EXPECT_EQ(0xcd4ff7c8U, unwinder.frames()[20].sp);
1079 EXPECT_EQ(0xe49c5cd9U, unwinder.frames()[21].pc);
1080 EXPECT_EQ(0xcd4ff850U, unwinder.frames()[21].sp);
1081 EXPECT_EQ(0xe49e71ddU, unwinder.frames()[22].pc);
1082 EXPECT_EQ(0xcd4ff8e8U, unwinder.frames()[22].sp);
1083 EXPECT_EQ(0xe7df3925U, unwinder.frames()[23].pc);
1084 EXPECT_EQ(0xcd4ff958U, unwinder.frames()[23].sp);
1085 EXPECT_EQ(0xe7daee39U, unwinder.frames()[24].pc);
1086 EXPECT_EQ(0xcd4ff960U, unwinder.frames()[24].sp);
1087}
1088
Yabin Cuid5b22c52018-02-22 17:11:31 -08001089TEST_F(UnwindOfflineTest, jit_map_arm) {
Christopher Ferris239425b2018-05-17 18:37:38 -07001090 ASSERT_NO_FATAL_FAILURE(Init("jit_map_arm/", ARCH_ARM));
Yabin Cuid5b22c52018-02-22 17:11:31 -08001091
1092 maps_->Add(0xd025c788, 0xd025c9f0, 0, PROT_READ | PROT_EXEC | MAPS_FLAGS_JIT_SYMFILE_MAP,
1093 "jit_map0.so", 0);
1094 maps_->Add(0xd025cd98, 0xd025cff4, 0, PROT_READ | PROT_EXEC | MAPS_FLAGS_JIT_SYMFILE_MAP,
1095 "jit_map1.so", 0);
1096 maps_->Sort();
1097
1098 Unwinder unwinder(128, maps_.get(), regs_.get(), process_memory_);
1099 unwinder.Unwind();
1100
1101 std::string frame_info(DumpFrames(unwinder));
1102 ASSERT_EQ(6U, unwinder.NumFrames()) << "Unwind:\n" << frame_info;
1103 EXPECT_EQ(
1104 " #00 pc 00000000 jit_map0.so "
1105 "(com.example.simpleperf.simpleperfexamplewithnative.MixActivity.access$000)\n"
1106 " #01 pc 0000003d jit_map1.so "
1107 "(com.example.simpleperf.simpleperfexamplewithnative.MixActivity$1.run+60)\n"
1108 " #02 pc 004135bb libart.so (art_quick_osr_stub+42)\n"
1109
1110 " #03 pc 003851dd libart.so (_ZN3art6Thread14CreateCallbackEPv+868)\n"
1111 " #04 pc 00062925 libc.so (_ZL15__pthread_startPv+22)\n"
1112 " #05 pc 0001de39 libc.so (__start_thread+24)\n",
1113 frame_info);
1114
1115 EXPECT_EQ(0xd025c788U, unwinder.frames()[0].pc);
1116 EXPECT_EQ(0xcd4ff140U, unwinder.frames()[0].sp);
1117 EXPECT_EQ(0xd025cdd5U, unwinder.frames()[1].pc);
1118 EXPECT_EQ(0xcd4ff140U, unwinder.frames()[1].sp);
1119 EXPECT_EQ(0xe4a755bbU, unwinder.frames()[2].pc);
1120 EXPECT_EQ(0xcd4ff160U, unwinder.frames()[2].sp);
1121 EXPECT_EQ(0xe49e71ddU, unwinder.frames()[3].pc);
1122 EXPECT_EQ(0xcd4ff8e8U, unwinder.frames()[3].sp);
1123 EXPECT_EQ(0xe7df3925U, unwinder.frames()[4].pc);
1124 EXPECT_EQ(0xcd4ff958U, unwinder.frames()[4].sp);
1125 EXPECT_EQ(0xe7daee39U, unwinder.frames()[5].pc);
1126 EXPECT_EQ(0xcd4ff960U, unwinder.frames()[5].sp);
1127}
1128
Christopher Ferris239425b2018-05-17 18:37:38 -07001129TEST_F(UnwindOfflineTest, offset_arm) {
1130 ASSERT_NO_FATAL_FAILURE(Init("offset_arm/", ARCH_ARM));
1131
1132 Unwinder unwinder(128, maps_.get(), regs_.get(), process_memory_);
1133 unwinder.Unwind();
1134
1135 std::string frame_info(DumpFrames(unwinder));
1136 ASSERT_EQ(19U, unwinder.NumFrames()) << "Unwind:\n" << frame_info;
1137 EXPECT_EQ(
1138 " #00 pc 0032bfa0 (offset 0x42000) libunwindstack_test (SignalInnerFunction+40)\n"
1139 " #01 pc 0032bfeb (offset 0x42000) libunwindstack_test (SignalMiddleFunction+2)\n"
1140 " #02 pc 0032bff3 (offset 0x42000) libunwindstack_test (SignalOuterFunction+2)\n"
1141 " #03 pc 0032fed3 (offset 0x42000) libunwindstack_test "
1142 "(_ZN11unwindstackL19SignalCallerHandlerEiP7siginfoPv+26)\n"
1143 " #04 pc 00026528 (offset 0x25000) libc.so\n"
1144 " #05 pc 00000000 <unknown>\n"
1145 " #06 pc 0032c2d9 (offset 0x42000) libunwindstack_test (InnerFunction+736)\n"
1146 " #07 pc 0032cc4f (offset 0x42000) libunwindstack_test (MiddleFunction+42)\n"
1147 " #08 pc 0032cc81 (offset 0x42000) libunwindstack_test (OuterFunction+42)\n"
1148 " #09 pc 0032e547 (offset 0x42000) libunwindstack_test "
1149 "(_ZN11unwindstackL19RemoteThroughSignalEij+270)\n"
1150 " #10 pc 0032ed99 (offset 0x42000) libunwindstack_test "
1151 "(_ZN11unwindstack55UnwindTest_remote_through_signal_with_invalid_func_Test8TestBodyEv+16)\n"
1152 " #11 pc 00354453 (offset 0x42000) libunwindstack_test (_ZN7testing4Test3RunEv+154)\n"
1153 " #12 pc 00354de7 (offset 0x42000) libunwindstack_test (_ZN7testing8TestInfo3RunEv+194)\n"
1154 " #13 pc 00355105 (offset 0x42000) libunwindstack_test (_ZN7testing8TestCase3RunEv+180)\n"
1155 " #14 pc 0035a215 (offset 0x42000) libunwindstack_test "
1156 "(_ZN7testing8internal12UnitTestImpl11RunAllTestsEv+664)\n"
1157 " #15 pc 00359f4f (offset 0x42000) libunwindstack_test (_ZN7testing8UnitTest3RunEv+110)\n"
1158 " #16 pc 0034d3db (offset 0x42000) libunwindstack_test (main+38)\n"
1159 " #17 pc 00092c0d (offset 0x25000) libc.so (__libc_init+48)\n"
1160 " #18 pc 0004202f (offset 0x42000) libunwindstack_test (_start_main+38)\n",
1161 frame_info);
1162
1163 EXPECT_EQ(0x2e55fa0U, unwinder.frames()[0].pc);
1164 EXPECT_EQ(0xf43d2cccU, unwinder.frames()[0].sp);
1165 EXPECT_EQ(0x2e55febU, unwinder.frames()[1].pc);
1166 EXPECT_EQ(0xf43d2ce0U, unwinder.frames()[1].sp);
1167 EXPECT_EQ(0x2e55ff3U, unwinder.frames()[2].pc);
1168 EXPECT_EQ(0xf43d2ce8U, unwinder.frames()[2].sp);
1169 EXPECT_EQ(0x2e59ed3U, unwinder.frames()[3].pc);
1170 EXPECT_EQ(0xf43d2cf0U, unwinder.frames()[3].sp);
1171 EXPECT_EQ(0xf4136528U, unwinder.frames()[4].pc);
1172 EXPECT_EQ(0xf43d2d10U, unwinder.frames()[4].sp);
1173 EXPECT_EQ(0U, unwinder.frames()[5].pc);
1174 EXPECT_EQ(0xffcc0ee0U, unwinder.frames()[5].sp);
1175 EXPECT_EQ(0x2e562d9U, unwinder.frames()[6].pc);
1176 EXPECT_EQ(0xffcc0ee0U, unwinder.frames()[6].sp);
1177 EXPECT_EQ(0x2e56c4fU, unwinder.frames()[7].pc);
1178 EXPECT_EQ(0xffcc1060U, unwinder.frames()[7].sp);
1179 EXPECT_EQ(0x2e56c81U, unwinder.frames()[8].pc);
1180 EXPECT_EQ(0xffcc1078U, unwinder.frames()[8].sp);
1181 EXPECT_EQ(0x2e58547U, unwinder.frames()[9].pc);
1182 EXPECT_EQ(0xffcc1090U, unwinder.frames()[9].sp);
1183 EXPECT_EQ(0x2e58d99U, unwinder.frames()[10].pc);
1184 EXPECT_EQ(0xffcc1438U, unwinder.frames()[10].sp);
1185 EXPECT_EQ(0x2e7e453U, unwinder.frames()[11].pc);
1186 EXPECT_EQ(0xffcc1448U, unwinder.frames()[11].sp);
1187 EXPECT_EQ(0x2e7ede7U, unwinder.frames()[12].pc);
1188 EXPECT_EQ(0xffcc1458U, unwinder.frames()[12].sp);
1189 EXPECT_EQ(0x2e7f105U, unwinder.frames()[13].pc);
1190 EXPECT_EQ(0xffcc1490U, unwinder.frames()[13].sp);
1191 EXPECT_EQ(0x2e84215U, unwinder.frames()[14].pc);
1192 EXPECT_EQ(0xffcc14c0U, unwinder.frames()[14].sp);
1193 EXPECT_EQ(0x2e83f4fU, unwinder.frames()[15].pc);
1194 EXPECT_EQ(0xffcc1510U, unwinder.frames()[15].sp);
1195 EXPECT_EQ(0x2e773dbU, unwinder.frames()[16].pc);
1196 EXPECT_EQ(0xffcc1528U, unwinder.frames()[16].sp);
1197 EXPECT_EQ(0xf41a2c0dU, unwinder.frames()[17].pc);
1198 EXPECT_EQ(0xffcc1540U, unwinder.frames()[17].sp);
1199 EXPECT_EQ(0x2b6c02fU, unwinder.frames()[18].pc);
1200 EXPECT_EQ(0xffcc1558U, unwinder.frames()[18].sp);
1201}
1202
Christopher Ferrisc3d79f72017-11-28 19:14:54 -08001203} // namespace unwindstack