summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libunwindstack/RegsArm.cpp13
-rw-r--r--libunwindstack/RegsArm64.cpp12
-rw-r--r--libunwindstack/RegsMips.cpp14
-rw-r--r--libunwindstack/RegsMips64.cpp14
-rw-r--r--libunwindstack/RegsX86.cpp10
-rw-r--r--libunwindstack/RegsX86_64.cpp11
-rw-r--r--libunwindstack/Unwinder.cpp32
-rw-r--r--libunwindstack/include/unwindstack/Regs.h2
-rw-r--r--libunwindstack/include/unwindstack/RegsArm.h2
-rw-r--r--libunwindstack/include/unwindstack/RegsArm64.h2
-rw-r--r--libunwindstack/include/unwindstack/RegsMips.h2
-rw-r--r--libunwindstack/include/unwindstack/RegsMips64.h2
-rw-r--r--libunwindstack/include/unwindstack/RegsX86.h2
-rw-r--r--libunwindstack/include/unwindstack/RegsX86_64.h2
-rw-r--r--libunwindstack/include/unwindstack/Unwinder.h3
-rw-r--r--libunwindstack/tests/RegsFake.h4
-rw-r--r--libunwindstack/tests/RegsTest.cpp114
-rw-r--r--libunwindstack/tests/UnwindOfflineTest.cpp344
18 files changed, 453 insertions, 132 deletions
diff --git a/libunwindstack/RegsArm.cpp b/libunwindstack/RegsArm.cpp
index 7f1614690..5502ce1fe 100644
--- a/libunwindstack/RegsArm.cpp
+++ b/libunwindstack/RegsArm.cpp
@@ -35,26 +35,25 @@ ArchEnum RegsArm::Arch() {
35 return ARCH_ARM; 35 return ARCH_ARM;
36} 36}
37 37
38uint64_t RegsArm::GetAdjustedPc(uint64_t rel_pc, Elf* elf) { 38uint64_t RegsArm::GetPcAdjustment(uint64_t rel_pc, Elf* elf) {
39 uint64_t load_bias = elf->GetLoadBias(); 39 uint64_t load_bias = elf->GetLoadBias();
40 if (rel_pc < load_bias) { 40 if (rel_pc < load_bias) {
41 return rel_pc; 41 return 0;
42 } 42 }
43 uint64_t adjusted_rel_pc = rel_pc - load_bias; 43 uint64_t adjusted_rel_pc = rel_pc - load_bias;
44
45 if (adjusted_rel_pc < 5) { 44 if (adjusted_rel_pc < 5) {
46 return rel_pc; 45 return 0;
47 } 46 }
48 47
49 if (adjusted_rel_pc & 1) { 48 if (adjusted_rel_pc & 1) {
50 // This is a thumb instruction, it could be 2 or 4 bytes. 49 // This is a thumb instruction, it could be 2 or 4 bytes.
51 uint32_t value; 50 uint32_t value;
52 if (rel_pc < 5 || !elf->memory()->ReadFully(adjusted_rel_pc - 5, &value, sizeof(value)) || 51 if (!elf->memory()->ReadFully(adjusted_rel_pc - 5, &value, sizeof(value)) ||
53 (value & 0xe000f000) != 0xe000f000) { 52 (value & 0xe000f000) != 0xe000f000) {
54 return rel_pc - 2; 53 return 2;
55 } 54 }
56 } 55 }
57 return rel_pc - 4; 56 return 4;
58} 57}
59 58
60void RegsArm::SetFromRaw() { 59void RegsArm::SetFromRaw() {
diff --git a/libunwindstack/RegsArm64.cpp b/libunwindstack/RegsArm64.cpp
index d6b467ade..cc6f5ce87 100644
--- a/libunwindstack/RegsArm64.cpp
+++ b/libunwindstack/RegsArm64.cpp
@@ -35,15 +35,11 @@ ArchEnum RegsArm64::Arch() {
35 return ARCH_ARM64; 35 return ARCH_ARM64;
36} 36}
37 37
38uint64_t RegsArm64::GetAdjustedPc(uint64_t rel_pc, Elf* elf) { 38uint64_t RegsArm64::GetPcAdjustment(uint64_t rel_pc, Elf* elf) {
39 if (!elf->valid()) { 39 if (!elf->valid() || rel_pc < 4) {
40 return rel_pc; 40 return 0;
41 } 41 }
42 42 return 4;
43 if (rel_pc < 4) {
44 return rel_pc;
45 }
46 return rel_pc - 4;
47} 43}
48 44
49void RegsArm64::SetFromRaw() { 45void RegsArm64::SetFromRaw() {
diff --git a/libunwindstack/RegsMips.cpp b/libunwindstack/RegsMips.cpp
index 6751f52dd..5d20bef4a 100644
--- a/libunwindstack/RegsMips.cpp
+++ b/libunwindstack/RegsMips.cpp
@@ -35,16 +35,12 @@ ArchEnum RegsMips::Arch() {
35 return ARCH_MIPS; 35 return ARCH_MIPS;
36} 36}
37 37
38uint64_t RegsMips::GetAdjustedPc(uint64_t rel_pc, Elf* elf) { 38uint64_t RegsMips::GetPcAdjustment(uint64_t rel_pc, Elf* elf) {
39 if (!elf->valid()) { 39 if (!elf->valid() || rel_pc < 8) {
40 return rel_pc; 40 return 0;
41 } 41 }
42 42 // For now, just assume no compact branches
43 // For now, just assuming no compact branches 43 return 8;
44 if (rel_pc < 8) {
45 return rel_pc;
46 }
47 return rel_pc - 8;
48} 44}
49 45
50void RegsMips::SetFromRaw() { 46void RegsMips::SetFromRaw() {
diff --git a/libunwindstack/RegsMips64.cpp b/libunwindstack/RegsMips64.cpp
index 97082bd9d..4a03538e2 100644
--- a/libunwindstack/RegsMips64.cpp
+++ b/libunwindstack/RegsMips64.cpp
@@ -36,16 +36,12 @@ ArchEnum RegsMips64::Arch() {
36 return ARCH_MIPS64; 36 return ARCH_MIPS64;
37} 37}
38 38
39uint64_t RegsMips64::GetAdjustedPc(uint64_t rel_pc, Elf* elf) { 39uint64_t RegsMips64::GetPcAdjustment(uint64_t rel_pc, Elf* elf) {
40 if (!elf->valid()) { 40 if (!elf->valid() || rel_pc < 8) {
41 return rel_pc; 41 return 0;
42 } 42 }
43 43 // For now, just assume no compact branches
44 // For now, just assuming no compact branches 44 return 8;
45 if (rel_pc < 8) {
46 return rel_pc;
47 }
48 return rel_pc - 8;
49} 45}
50 46
51void RegsMips64::SetFromRaw() { 47void RegsMips64::SetFromRaw() {
diff --git a/libunwindstack/RegsX86.cpp b/libunwindstack/RegsX86.cpp
index 27476b7cb..573cb2382 100644
--- a/libunwindstack/RegsX86.cpp
+++ b/libunwindstack/RegsX86.cpp
@@ -35,15 +35,11 @@ ArchEnum RegsX86::Arch() {
35 return ARCH_X86; 35 return ARCH_X86;
36} 36}
37 37
38uint64_t RegsX86::GetAdjustedPc(uint64_t rel_pc, Elf* elf) { 38uint64_t RegsX86::GetPcAdjustment(uint64_t rel_pc, Elf* elf) {
39 if (!elf->valid()) { 39 if (!elf->valid() || rel_pc == 0) {
40 return rel_pc;
41 }
42
43 if (rel_pc == 0) {
44 return 0; 40 return 0;
45 } 41 }
46 return rel_pc - 1; 42 return 1;
47} 43}
48 44
49void RegsX86::SetFromRaw() { 45void RegsX86::SetFromRaw() {
diff --git a/libunwindstack/RegsX86_64.cpp b/libunwindstack/RegsX86_64.cpp
index 0f66943aa..3175a90c2 100644
--- a/libunwindstack/RegsX86_64.cpp
+++ b/libunwindstack/RegsX86_64.cpp
@@ -35,16 +35,11 @@ ArchEnum RegsX86_64::Arch() {
35 return ARCH_X86_64; 35 return ARCH_X86_64;
36} 36}
37 37
38uint64_t RegsX86_64::GetAdjustedPc(uint64_t rel_pc, Elf* elf) { 38uint64_t RegsX86_64::GetPcAdjustment(uint64_t rel_pc, Elf* elf) {
39 if (!elf->valid()) { 39 if (!elf->valid() || rel_pc == 0) {
40 return rel_pc;
41 }
42
43 if (rel_pc == 0) {
44 return 0; 40 return 0;
45 } 41 }
46 42 return 1;
47 return rel_pc - 1;
48} 43}
49 44
50void RegsX86_64::SetFromRaw() { 45void RegsX86_64::SetFromRaw() {
diff --git a/libunwindstack/Unwinder.cpp b/libunwindstack/Unwinder.cpp
index 5a4f5e04c..7da699441 100644
--- a/libunwindstack/Unwinder.cpp
+++ b/libunwindstack/Unwinder.cpp
@@ -83,20 +83,20 @@ void Unwinder::FillInDexFrame() {
83#endif 83#endif
84} 84}
85 85
86void Unwinder::FillInFrame(MapInfo* map_info, Elf* elf, uint64_t adjusted_rel_pc, uint64_t func_pc) { 86void Unwinder::FillInFrame(MapInfo* map_info, Elf* elf, uint64_t rel_pc, uint64_t func_pc,
87 uint64_t pc_adjustment) {
87 size_t frame_num = frames_.size(); 88 size_t frame_num = frames_.size();
88 frames_.resize(frame_num + 1); 89 frames_.resize(frame_num + 1);
89 FrameData* frame = &frames_.at(frame_num); 90 FrameData* frame = &frames_.at(frame_num);
90 frame->num = frame_num; 91 frame->num = frame_num;
91 frame->sp = regs_->sp(); 92 frame->sp = regs_->sp();
92 frame->rel_pc = adjusted_rel_pc; 93 frame->rel_pc = rel_pc - pc_adjustment;
94 frame->pc = regs_->pc() - pc_adjustment;
93 95
94 if (map_info == nullptr) { 96 if (map_info == nullptr) {
95 frame->pc = regs_->pc();
96 return; 97 return;
97 } 98 }
98 99
99 frame->pc = map_info->start + adjusted_rel_pc - elf->GetLoadBias() - map_info->elf_offset;
100 frame->map_name = map_info->name; 100 frame->map_name = map_info->name;
101 frame->map_offset = map_info->offset; 101 frame->map_offset = map_info->offset;
102 frame->map_start = map_info->start; 102 frame->map_start = map_info->start;
@@ -140,13 +140,12 @@ void Unwinder::Unwind(const std::vector<std::string>* initial_map_names_to_skip,
140 140
141 MapInfo* map_info = maps_->Find(regs_->pc()); 141 MapInfo* map_info = maps_->Find(regs_->pc());
142 uint64_t rel_pc; 142 uint64_t rel_pc;
143 uint64_t adjusted_pc; 143 uint64_t pc_adjustment = 0;
144 uint64_t adjusted_rel_pc; 144 uint64_t step_pc;
145 Elf* elf; 145 Elf* elf;
146 if (map_info == nullptr) { 146 if (map_info == nullptr) {
147 rel_pc = regs_->pc(); 147 rel_pc = regs_->pc();
148 adjusted_rel_pc = rel_pc; 148 step_pc = rel_pc;
149 adjusted_pc = rel_pc;
150 last_error_.code = ERROR_INVALID_MAP; 149 last_error_.code = ERROR_INVALID_MAP;
151 } else { 150 } else {
152 if (ShouldStop(map_suffixes_to_ignore, map_info->name)) { 151 if (ShouldStop(map_suffixes_to_ignore, map_info->name)) {
@@ -155,21 +154,20 @@ void Unwinder::Unwind(const std::vector<std::string>* initial_map_names_to_skip,
155 elf = map_info->GetElf(process_memory_, true); 154 elf = map_info->GetElf(process_memory_, true);
156 rel_pc = elf->GetRelPc(regs_->pc(), map_info); 155 rel_pc = elf->GetRelPc(regs_->pc(), map_info);
157 if (adjust_pc) { 156 if (adjust_pc) {
158 adjusted_pc = regs_->GetAdjustedPc(rel_pc, elf); 157 pc_adjustment = regs_->GetPcAdjustment(rel_pc, elf);
159 } else { 158 } else {
160 adjusted_pc = rel_pc; 159 pc_adjustment = 0;
161 } 160 }
162 adjusted_rel_pc = adjusted_pc; 161 step_pc = rel_pc - pc_adjustment;
163 162
164 // If the pc is in an invalid elf file, try and get an Elf object 163 // If the pc is in an invalid elf file, try and get an Elf object
165 // using the jit debug information. 164 // using the jit debug information.
166 if (!elf->valid() && jit_debug_ != nullptr) { 165 if (!elf->valid() && jit_debug_ != nullptr) {
167 uint64_t adjusted_jit_pc = regs_->pc() - (rel_pc - adjusted_pc); 166 uint64_t adjusted_jit_pc = regs_->pc() - pc_adjustment;
168 Elf* jit_elf = jit_debug_->GetElf(maps_, adjusted_jit_pc); 167 Elf* jit_elf = jit_debug_->GetElf(maps_, adjusted_jit_pc);
169 if (jit_elf != nullptr) { 168 if (jit_elf != nullptr) {
170 // The jit debug information requires a non relative adjusted pc. 169 // The jit debug information requires a non relative adjusted pc.
171 adjusted_pc = adjusted_jit_pc; 170 step_pc = adjusted_jit_pc;
172 adjusted_rel_pc = adjusted_pc - map_info->start;
173 elf = jit_elf; 171 elf = jit_elf;
174 } 172 }
175 } 173 }
@@ -185,7 +183,7 @@ void Unwinder::Unwind(const std::vector<std::string>* initial_map_names_to_skip,
185 regs_->set_dex_pc(0); 183 regs_->set_dex_pc(0);
186 } 184 }
187 185
188 FillInFrame(map_info, elf, adjusted_rel_pc, adjusted_pc); 186 FillInFrame(map_info, elf, rel_pc, step_pc, pc_adjustment);
189 187
190 // Once a frame is added, stop skipping frames. 188 // Once a frame is added, stop skipping frames.
191 initial_map_names_to_skip = nullptr; 189 initial_map_names_to_skip = nullptr;
@@ -213,8 +211,8 @@ void Unwinder::Unwind(const std::vector<std::string>* initial_map_names_to_skip,
213 in_device_map = true; 211 in_device_map = true;
214 } else { 212 } else {
215 bool finished; 213 bool finished;
216 stepped = elf->Step(rel_pc, adjusted_pc, map_info->elf_offset, regs_, 214 stepped = elf->Step(rel_pc, step_pc, map_info->elf_offset, regs_, process_memory_.get(),
217 process_memory_.get(), &finished); 215 &finished);
218 elf->GetLastError(&last_error_); 216 elf->GetLastError(&last_error_);
219 if (stepped && finished) { 217 if (stepped && finished) {
220 break; 218 break;
diff --git a/libunwindstack/include/unwindstack/Regs.h b/libunwindstack/include/unwindstack/Regs.h
index a5ba7a078..b0e7ea152 100644
--- a/libunwindstack/include/unwindstack/Regs.h
+++ b/libunwindstack/include/unwindstack/Regs.h
@@ -60,7 +60,7 @@ class Regs {
60 uint64_t dex_pc() { return dex_pc_; } 60 uint64_t dex_pc() { return dex_pc_; }
61 void set_dex_pc(uint64_t dex_pc) { dex_pc_ = dex_pc; } 61 void set_dex_pc(uint64_t dex_pc) { dex_pc_ = dex_pc; }
62 62
63 virtual uint64_t GetAdjustedPc(uint64_t rel_pc, Elf* elf) = 0; 63 virtual uint64_t GetPcAdjustment(uint64_t rel_pc, Elf* elf) = 0;
64 64
65 virtual bool StepIfSignalHandler(uint64_t rel_pc, Elf* elf, Memory* process_memory) = 0; 65 virtual bool StepIfSignalHandler(uint64_t rel_pc, Elf* elf, Memory* process_memory) = 0;
66 66
diff --git a/libunwindstack/include/unwindstack/RegsArm.h b/libunwindstack/include/unwindstack/RegsArm.h
index b5d344be6..5af90d3f5 100644
--- a/libunwindstack/include/unwindstack/RegsArm.h
+++ b/libunwindstack/include/unwindstack/RegsArm.h
@@ -36,7 +36,7 @@ class RegsArm : public RegsImpl<uint32_t> {
36 36
37 virtual ArchEnum Arch() override final; 37 virtual ArchEnum Arch() override final;
38 38
39 uint64_t GetAdjustedPc(uint64_t rel_pc, Elf* elf) override; 39 uint64_t GetPcAdjustment(uint64_t rel_pc, Elf* elf) override;
40 40
41 void SetFromRaw() override; 41 void SetFromRaw() override;
42 42
diff --git a/libunwindstack/include/unwindstack/RegsArm64.h b/libunwindstack/include/unwindstack/RegsArm64.h
index 30e626ccf..cb05732ee 100644
--- a/libunwindstack/include/unwindstack/RegsArm64.h
+++ b/libunwindstack/include/unwindstack/RegsArm64.h
@@ -36,7 +36,7 @@ class RegsArm64 : public RegsImpl<uint64_t> {
36 36
37 virtual ArchEnum Arch() override final; 37 virtual ArchEnum Arch() override final;
38 38
39 uint64_t GetAdjustedPc(uint64_t rel_pc, Elf* elf) override; 39 uint64_t GetPcAdjustment(uint64_t rel_pc, Elf* elf) override;
40 40
41 void SetFromRaw() override; 41 void SetFromRaw() override;
42 42
diff --git a/libunwindstack/include/unwindstack/RegsMips.h b/libunwindstack/include/unwindstack/RegsMips.h
index 3fe6a9f7f..8e3c01f20 100644
--- a/libunwindstack/include/unwindstack/RegsMips.h
+++ b/libunwindstack/include/unwindstack/RegsMips.h
@@ -36,7 +36,7 @@ class RegsMips : public RegsImpl<uint32_t> {
36 36
37 virtual ArchEnum Arch() override final; 37 virtual ArchEnum Arch() override final;
38 38
39 uint64_t GetAdjustedPc(uint64_t rel_pc, Elf* elf) override; 39 uint64_t GetPcAdjustment(uint64_t rel_pc, Elf* elf) override;
40 40
41 void SetFromRaw() override; 41 void SetFromRaw() override;
42 42
diff --git a/libunwindstack/include/unwindstack/RegsMips64.h b/libunwindstack/include/unwindstack/RegsMips64.h
index 6b4bcdf92..8c2d4437f 100644
--- a/libunwindstack/include/unwindstack/RegsMips64.h
+++ b/libunwindstack/include/unwindstack/RegsMips64.h
@@ -36,7 +36,7 @@ class RegsMips64 : public RegsImpl<uint64_t> {
36 36
37 virtual ArchEnum Arch() override final; 37 virtual ArchEnum Arch() override final;
38 38
39 uint64_t GetAdjustedPc(uint64_t rel_pc, Elf* elf) override; 39 uint64_t GetPcAdjustment(uint64_t rel_pc, Elf* elf) override;
40 40
41 void SetFromRaw() override; 41 void SetFromRaw() override;
42 42
diff --git a/libunwindstack/include/unwindstack/RegsX86.h b/libunwindstack/include/unwindstack/RegsX86.h
index a695bbfbb..1bc145d97 100644
--- a/libunwindstack/include/unwindstack/RegsX86.h
+++ b/libunwindstack/include/unwindstack/RegsX86.h
@@ -37,7 +37,7 @@ class RegsX86 : public RegsImpl<uint32_t> {
37 37
38 virtual ArchEnum Arch() override final; 38 virtual ArchEnum Arch() override final;
39 39
40 uint64_t GetAdjustedPc(uint64_t rel_pc, Elf* elf) override; 40 uint64_t GetPcAdjustment(uint64_t rel_pc, Elf* elf) override;
41 41
42 void SetFromRaw() override; 42 void SetFromRaw() override;
43 43
diff --git a/libunwindstack/include/unwindstack/RegsX86_64.h b/libunwindstack/include/unwindstack/RegsX86_64.h
index 23a3f2077..4cd45d4b9 100644
--- a/libunwindstack/include/unwindstack/RegsX86_64.h
+++ b/libunwindstack/include/unwindstack/RegsX86_64.h
@@ -37,7 +37,7 @@ class RegsX86_64 : public RegsImpl<uint64_t> {
37 37
38 virtual ArchEnum Arch() override final; 38 virtual ArchEnum Arch() override final;
39 39
40 uint64_t GetAdjustedPc(uint64_t rel_pc, Elf* elf) override; 40 uint64_t GetPcAdjustment(uint64_t rel_pc, Elf* elf) override;
41 41
42 void SetFromRaw() override; 42 void SetFromRaw() override;
43 43
diff --git a/libunwindstack/include/unwindstack/Unwinder.h b/libunwindstack/include/unwindstack/Unwinder.h
index 5770c1a97..56b058156 100644
--- a/libunwindstack/include/unwindstack/Unwinder.h
+++ b/libunwindstack/include/unwindstack/Unwinder.h
@@ -88,7 +88,8 @@ class Unwinder {
88 88
89 private: 89 private:
90 void FillInDexFrame(); 90 void FillInDexFrame();
91 void FillInFrame(MapInfo* map_info, Elf* elf, uint64_t adjusted_rel_pc, uint64_t adjusted_pc); 91 void FillInFrame(MapInfo* map_info, Elf* elf, uint64_t rel_pc, uint64_t func_pc,
92 uint64_t pc_adjustment);
92 93
93 size_t max_frames_; 94 size_t max_frames_;
94 Maps* maps_; 95 Maps* maps_;
diff --git a/libunwindstack/tests/RegsFake.h b/libunwindstack/tests/RegsFake.h
index cd7f2ff2b..ab23194e5 100644
--- a/libunwindstack/tests/RegsFake.h
+++ b/libunwindstack/tests/RegsFake.h
@@ -47,7 +47,7 @@ class RegsFake : public Regs {
47 47
48 bool Is32Bit() { return false; } 48 bool Is32Bit() { return false; }
49 49
50 uint64_t GetAdjustedPc(uint64_t rel_pc, Elf*) override { return rel_pc - 2; } 50 uint64_t GetPcAdjustment(uint64_t, Elf*) override { return 2; }
51 51
52 bool StepIfSignalHandler(uint64_t, Elf*, Memory*) override { return false; } 52 bool StepIfSignalHandler(uint64_t, Elf*, Memory*) override { return false; }
53 53
@@ -77,7 +77,7 @@ class RegsImplFake : public RegsImpl<TypeParam> {
77 77
78 ArchEnum Arch() override { return ARCH_UNKNOWN; } 78 ArchEnum Arch() override { return ARCH_UNKNOWN; }
79 79
80 uint64_t GetAdjustedPc(uint64_t, Elf*) override { return 0; } 80 uint64_t GetPcAdjustment(uint64_t, Elf*) override { return 0; }
81 void SetFromRaw() override {} 81 void SetFromRaw() override {}
82 bool SetPcFromReturnAddress(Memory*) override { return false; } 82 bool SetPcFromReturnAddress(Memory*) override { return false; }
83 bool StepIfSignalHandler(uint64_t, Elf*, Memory*) override { return false; } 83 bool StepIfSignalHandler(uint64_t, Elf*, Memory*) override { return false; }
diff --git a/libunwindstack/tests/RegsTest.cpp b/libunwindstack/tests/RegsTest.cpp
index 7c063739d..8b2f6c83f 100644
--- a/libunwindstack/tests/RegsTest.cpp
+++ b/libunwindstack/tests/RegsTest.cpp
@@ -96,48 +96,48 @@ TEST_F(RegsTest, regs64) {
96 96
97TEST_F(RegsTest, rel_pc) { 97TEST_F(RegsTest, rel_pc) {
98 RegsArm64 arm64; 98 RegsArm64 arm64;
99 ASSERT_EQ(0xcU, arm64.GetAdjustedPc(0x10, elf_.get())); 99 ASSERT_EQ(4U, arm64.GetPcAdjustment(0x10, elf_.get()));
100 ASSERT_EQ(0x0U, arm64.GetAdjustedPc(0x4, elf_.get())); 100 ASSERT_EQ(4U, arm64.GetPcAdjustment(0x4, elf_.get()));
101 ASSERT_EQ(0x3U, arm64.GetAdjustedPc(0x3, elf_.get())); 101 ASSERT_EQ(0U, arm64.GetPcAdjustment(0x3, elf_.get()));
102 ASSERT_EQ(0x2U, arm64.GetAdjustedPc(0x2, elf_.get())); 102 ASSERT_EQ(0U, arm64.GetPcAdjustment(0x2, elf_.get()));
103 ASSERT_EQ(0x1U, arm64.GetAdjustedPc(0x1, elf_.get())); 103 ASSERT_EQ(0U, arm64.GetPcAdjustment(0x1, elf_.get()));
104 ASSERT_EQ(0x0U, arm64.GetAdjustedPc(0x0, elf_.get())); 104 ASSERT_EQ(0U, arm64.GetPcAdjustment(0x0, elf_.get()));
105 105
106 RegsX86 x86; 106 RegsX86 x86;
107 ASSERT_EQ(0xffU, x86.GetAdjustedPc(0x100, elf_.get())); 107 ASSERT_EQ(1U, x86.GetPcAdjustment(0x100, elf_.get()));
108 ASSERT_EQ(0x1U, x86.GetAdjustedPc(0x2, elf_.get())); 108 ASSERT_EQ(1U, x86.GetPcAdjustment(0x2, elf_.get()));
109 ASSERT_EQ(0x0U, x86.GetAdjustedPc(0x1, elf_.get())); 109 ASSERT_EQ(1U, x86.GetPcAdjustment(0x1, elf_.get()));
110 ASSERT_EQ(0x0U, x86.GetAdjustedPc(0x0, elf_.get())); 110 ASSERT_EQ(0U, x86.GetPcAdjustment(0x0, elf_.get()));
111 111
112 RegsX86_64 x86_64; 112 RegsX86_64 x86_64;
113 ASSERT_EQ(0xffU, x86_64.GetAdjustedPc(0x100, elf_.get())); 113 ASSERT_EQ(1U, x86_64.GetPcAdjustment(0x100, elf_.get()));
114 ASSERT_EQ(0x1U, x86_64.GetAdjustedPc(0x2, elf_.get())); 114 ASSERT_EQ(1U, x86_64.GetPcAdjustment(0x2, elf_.get()));
115 ASSERT_EQ(0x0U, x86_64.GetAdjustedPc(0x1, elf_.get())); 115 ASSERT_EQ(1U, x86_64.GetPcAdjustment(0x1, elf_.get()));
116 ASSERT_EQ(0x0U, x86_64.GetAdjustedPc(0x0, elf_.get())); 116 ASSERT_EQ(0U, x86_64.GetPcAdjustment(0x0, elf_.get()));
117 117
118 RegsMips mips; 118 RegsMips mips;
119 ASSERT_EQ(0x8U, mips.GetAdjustedPc(0x10, elf_.get())); 119 ASSERT_EQ(8U, mips.GetPcAdjustment(0x10, elf_.get()));
120 ASSERT_EQ(0x0U, mips.GetAdjustedPc(0x8, elf_.get())); 120 ASSERT_EQ(8U, mips.GetPcAdjustment(0x8, elf_.get()));
121 ASSERT_EQ(0x7U, mips.GetAdjustedPc(0x7, elf_.get())); 121 ASSERT_EQ(0U, mips.GetPcAdjustment(0x7, elf_.get()));
122 ASSERT_EQ(0x6U, mips.GetAdjustedPc(0x6, elf_.get())); 122 ASSERT_EQ(0U, mips.GetPcAdjustment(0x6, elf_.get()));
123 ASSERT_EQ(0x5U, mips.GetAdjustedPc(0x5, elf_.get())); 123 ASSERT_EQ(0U, mips.GetPcAdjustment(0x5, elf_.get()));
124 ASSERT_EQ(0x4U, mips.GetAdjustedPc(0x4, elf_.get())); 124 ASSERT_EQ(0U, mips.GetPcAdjustment(0x4, elf_.get()));
125 ASSERT_EQ(0x3U, mips.GetAdjustedPc(0x3, elf_.get())); 125 ASSERT_EQ(0U, mips.GetPcAdjustment(0x3, elf_.get()));
126 ASSERT_EQ(0x2U, mips.GetAdjustedPc(0x2, elf_.get())); 126 ASSERT_EQ(0U, mips.GetPcAdjustment(0x2, elf_.get()));
127 ASSERT_EQ(0x1U, mips.GetAdjustedPc(0x1, elf_.get())); 127 ASSERT_EQ(0U, mips.GetPcAdjustment(0x1, elf_.get()));
128 ASSERT_EQ(0x0U, mips.GetAdjustedPc(0x0, elf_.get())); 128 ASSERT_EQ(0U, mips.GetPcAdjustment(0x0, elf_.get()));
129 129
130 RegsMips64 mips64; 130 RegsMips64 mips64;
131 ASSERT_EQ(0x8U, mips64.GetAdjustedPc(0x10, elf_.get())); 131 ASSERT_EQ(8U, mips64.GetPcAdjustment(0x10, elf_.get()));
132 ASSERT_EQ(0x0U, mips64.GetAdjustedPc(0x8, elf_.get())); 132 ASSERT_EQ(8U, mips64.GetPcAdjustment(0x8, elf_.get()));
133 ASSERT_EQ(0x7U, mips64.GetAdjustedPc(0x7, elf_.get())); 133 ASSERT_EQ(0U, mips64.GetPcAdjustment(0x7, elf_.get()));
134 ASSERT_EQ(0x6U, mips64.GetAdjustedPc(0x6, elf_.get())); 134 ASSERT_EQ(0U, mips64.GetPcAdjustment(0x6, elf_.get()));
135 ASSERT_EQ(0x5U, mips64.GetAdjustedPc(0x5, elf_.get())); 135 ASSERT_EQ(0U, mips64.GetPcAdjustment(0x5, elf_.get()));
136 ASSERT_EQ(0x4U, mips64.GetAdjustedPc(0x4, elf_.get())); 136 ASSERT_EQ(0U, mips64.GetPcAdjustment(0x4, elf_.get()));
137 ASSERT_EQ(0x3U, mips64.GetAdjustedPc(0x3, elf_.get())); 137 ASSERT_EQ(0U, mips64.GetPcAdjustment(0x3, elf_.get()));
138 ASSERT_EQ(0x2U, mips64.GetAdjustedPc(0x2, elf_.get())); 138 ASSERT_EQ(0U, mips64.GetPcAdjustment(0x2, elf_.get()));
139 ASSERT_EQ(0x1U, mips64.GetAdjustedPc(0x1, elf_.get())); 139 ASSERT_EQ(0U, mips64.GetPcAdjustment(0x1, elf_.get()));
140 ASSERT_EQ(0x0U, mips64.GetAdjustedPc(0x0, elf_.get())); 140 ASSERT_EQ(0U, mips64.GetPcAdjustment(0x0, elf_.get()));
141} 141}
142 142
143TEST_F(RegsTest, rel_pc_arm) { 143TEST_F(RegsTest, rel_pc_arm) {
@@ -145,34 +145,34 @@ TEST_F(RegsTest, rel_pc_arm) {
145 145
146 // Check fence posts. 146 // Check fence posts.
147 elf_->FakeSetLoadBias(0); 147 elf_->FakeSetLoadBias(0);
148 ASSERT_EQ(3U, arm.GetAdjustedPc(0x5, elf_.get())); 148 ASSERT_EQ(2U, arm.GetPcAdjustment(0x5, elf_.get()));
149 ASSERT_EQ(4U, arm.GetAdjustedPc(0x4, elf_.get())); 149 ASSERT_EQ(0U, arm.GetPcAdjustment(0x4, elf_.get()));
150 ASSERT_EQ(3U, arm.GetAdjustedPc(0x3, elf_.get())); 150 ASSERT_EQ(0U, arm.GetPcAdjustment(0x3, elf_.get()));
151 ASSERT_EQ(2U, arm.GetAdjustedPc(0x2, elf_.get())); 151 ASSERT_EQ(0U, arm.GetPcAdjustment(0x2, elf_.get()));
152 ASSERT_EQ(1U, arm.GetAdjustedPc(0x1, elf_.get())); 152 ASSERT_EQ(0U, arm.GetPcAdjustment(0x1, elf_.get()));
153 ASSERT_EQ(0U, arm.GetAdjustedPc(0x0, elf_.get())); 153 ASSERT_EQ(0U, arm.GetPcAdjustment(0x0, elf_.get()));
154 154
155 elf_->FakeSetLoadBias(0x100); 155 elf_->FakeSetLoadBias(0x100);
156 ASSERT_EQ(0xffU, arm.GetAdjustedPc(0xff, elf_.get())); 156 ASSERT_EQ(0U, arm.GetPcAdjustment(0xff, elf_.get()));
157 ASSERT_EQ(0x103U, arm.GetAdjustedPc(0x105, elf_.get())); 157 ASSERT_EQ(2U, arm.GetPcAdjustment(0x105, elf_.get()));
158 ASSERT_EQ(0x104U, arm.GetAdjustedPc(0x104, elf_.get())); 158 ASSERT_EQ(0U, arm.GetPcAdjustment(0x104, elf_.get()));
159 ASSERT_EQ(0x103U, arm.GetAdjustedPc(0x103, elf_.get())); 159 ASSERT_EQ(0U, arm.GetPcAdjustment(0x103, elf_.get()));
160 ASSERT_EQ(0x102U, arm.GetAdjustedPc(0x102, elf_.get())); 160 ASSERT_EQ(0U, arm.GetPcAdjustment(0x102, elf_.get()));
161 ASSERT_EQ(0x101U, arm.GetAdjustedPc(0x101, elf_.get())); 161 ASSERT_EQ(0U, arm.GetPcAdjustment(0x101, elf_.get()));
162 ASSERT_EQ(0x100U, arm.GetAdjustedPc(0x100, elf_.get())); 162 ASSERT_EQ(0U, arm.GetPcAdjustment(0x100, elf_.get()));
163 163
164 // Check thumb instructions handling. 164 // Check thumb instructions handling.
165 elf_->FakeSetLoadBias(0); 165 elf_->FakeSetLoadBias(0);
166 memory_->SetData32(0x2000, 0); 166 memory_->SetData32(0x2000, 0);
167 ASSERT_EQ(0x2003U, arm.GetAdjustedPc(0x2005, elf_.get())); 167 ASSERT_EQ(2U, arm.GetPcAdjustment(0x2005, elf_.get()));
168 memory_->SetData32(0x2000, 0xe000f000); 168 memory_->SetData32(0x2000, 0xe000f000);
169 ASSERT_EQ(0x2001U, arm.GetAdjustedPc(0x2005, elf_.get())); 169 ASSERT_EQ(4U, arm.GetPcAdjustment(0x2005, elf_.get()));
170 170
171 elf_->FakeSetLoadBias(0x400); 171 elf_->FakeSetLoadBias(0x400);
172 memory_->SetData32(0x2100, 0); 172 memory_->SetData32(0x2100, 0);
173 ASSERT_EQ(0x2503U, arm.GetAdjustedPc(0x2505, elf_.get())); 173 ASSERT_EQ(2U, arm.GetPcAdjustment(0x2505, elf_.get()));
174 memory_->SetData32(0x2100, 0xf111f111); 174 memory_->SetData32(0x2100, 0xf111f111);
175 ASSERT_EQ(0x2501U, arm.GetAdjustedPc(0x2505, elf_.get())); 175 ASSERT_EQ(4U, arm.GetPcAdjustment(0x2505, elf_.get()));
176} 176}
177 177
178TEST_F(RegsTest, elf_invalid) { 178TEST_F(RegsTest, elf_invalid) {
@@ -188,27 +188,27 @@ TEST_F(RegsTest, elf_invalid) {
188 188
189 regs_arm.set_pc(0x1500); 189 regs_arm.set_pc(0x1500);
190 EXPECT_EQ(0x500U, invalid_elf->GetRelPc(regs_arm.pc(), &map_info)); 190 EXPECT_EQ(0x500U, invalid_elf->GetRelPc(regs_arm.pc(), &map_info));
191 EXPECT_EQ(0x4fcU, regs_arm.GetAdjustedPc(0x500U, invalid_elf)); 191 EXPECT_EQ(4U, regs_arm.GetPcAdjustment(0x500U, invalid_elf));
192 192
193 regs_arm64.set_pc(0x1600); 193 regs_arm64.set_pc(0x1600);
194 EXPECT_EQ(0x600U, invalid_elf->GetRelPc(regs_arm64.pc(), &map_info)); 194 EXPECT_EQ(0x600U, invalid_elf->GetRelPc(regs_arm64.pc(), &map_info));
195 EXPECT_EQ(0x600U, regs_arm64.GetAdjustedPc(0x600U, invalid_elf)); 195 EXPECT_EQ(0U, regs_arm64.GetPcAdjustment(0x600U, invalid_elf));
196 196
197 regs_x86.set_pc(0x1700); 197 regs_x86.set_pc(0x1700);
198 EXPECT_EQ(0x700U, invalid_elf->GetRelPc(regs_x86.pc(), &map_info)); 198 EXPECT_EQ(0x700U, invalid_elf->GetRelPc(regs_x86.pc(), &map_info));
199 EXPECT_EQ(0x700U, regs_x86.GetAdjustedPc(0x700U, invalid_elf)); 199 EXPECT_EQ(0U, regs_x86.GetPcAdjustment(0x700U, invalid_elf));
200 200
201 regs_x86_64.set_pc(0x1800); 201 regs_x86_64.set_pc(0x1800);
202 EXPECT_EQ(0x800U, invalid_elf->GetRelPc(regs_x86_64.pc(), &map_info)); 202 EXPECT_EQ(0x800U, invalid_elf->GetRelPc(regs_x86_64.pc(), &map_info));
203 EXPECT_EQ(0x800U, regs_x86_64.GetAdjustedPc(0x800U, invalid_elf)); 203 EXPECT_EQ(0U, regs_x86_64.GetPcAdjustment(0x800U, invalid_elf));
204 204
205 regs_mips.set_pc(0x1900); 205 regs_mips.set_pc(0x1900);
206 EXPECT_EQ(0x900U, invalid_elf->GetRelPc(regs_mips.pc(), &map_info)); 206 EXPECT_EQ(0x900U, invalid_elf->GetRelPc(regs_mips.pc(), &map_info));
207 EXPECT_EQ(0x900U, regs_mips.GetAdjustedPc(0x900U, invalid_elf)); 207 EXPECT_EQ(0U, regs_mips.GetPcAdjustment(0x900U, invalid_elf));
208 208
209 regs_mips64.set_pc(0x1a00); 209 regs_mips64.set_pc(0x1a00);
210 EXPECT_EQ(0xa00U, invalid_elf->GetRelPc(regs_mips64.pc(), &map_info)); 210 EXPECT_EQ(0xa00U, invalid_elf->GetRelPc(regs_mips64.pc(), &map_info));
211 EXPECT_EQ(0xa00U, regs_mips64.GetAdjustedPc(0xa00U, invalid_elf)); 211 EXPECT_EQ(0U, regs_mips64.GetPcAdjustment(0xa00U, invalid_elf));
212} 212}
213 213
214TEST_F(RegsTest, arm_set_from_raw) { 214TEST_F(RegsTest, arm_set_from_raw) {
diff --git a/libunwindstack/tests/UnwindOfflineTest.cpp b/libunwindstack/tests/UnwindOfflineTest.cpp
index df262f525..af4a5b59e 100644
--- a/libunwindstack/tests/UnwindOfflineTest.cpp
+++ b/libunwindstack/tests/UnwindOfflineTest.cpp
@@ -193,6 +193,14 @@ TEST_F(UnwindOfflineTest, pc_straddle_arm) {
193 " #02 pc 00007441 libbase.so (_ZN7android4base10LogMessageD2Ev+748)\n" 193 " #02 pc 00007441 libbase.so (_ZN7android4base10LogMessageD2Ev+748)\n"
194 " #03 pc 00015147 /does/not/exist/libhidlbase.so\n", 194 " #03 pc 00015147 /does/not/exist/libhidlbase.so\n",
195 frame_info); 195 frame_info);
196 EXPECT_EQ(0xf31ea9f8U, unwinder.frames()[0].pc);
197 EXPECT_EQ(0xe9c866f8U, unwinder.frames()[0].sp);
198 EXPECT_EQ(0xf2da0a1bU, unwinder.frames()[1].pc);
199 EXPECT_EQ(0xe9c86728U, unwinder.frames()[1].sp);
200 EXPECT_EQ(0xf2da1441U, unwinder.frames()[2].pc);
201 EXPECT_EQ(0xe9c86730U, unwinder.frames()[2].sp);
202 EXPECT_EQ(0xf3367147U, unwinder.frames()[3].pc);
203 EXPECT_EQ(0xe9c86778U, unwinder.frames()[3].sp);
196} 204}
197 205
198TEST_F(UnwindOfflineTest, pc_in_gnu_debugdata_arm) { 206TEST_F(UnwindOfflineTest, pc_in_gnu_debugdata_arm) {
@@ -209,6 +217,10 @@ TEST_F(UnwindOfflineTest, pc_in_gnu_debugdata_arm) {
209 " #01 pc 0006dce5 libandroid_runtime.so " 217 " #01 pc 0006dce5 libandroid_runtime.so "
210 "(_ZN7android14AndroidRuntime19javaCreateThreadEtcEPFiPvES1_PKcijPS1_)\n", 218 "(_ZN7android14AndroidRuntime19javaCreateThreadEtcEPFiPvES1_PKcijPS1_)\n",
211 frame_info); 219 frame_info);
220 EXPECT_EQ(0xf1f6dc49U, unwinder.frames()[0].pc);
221 EXPECT_EQ(0xd8fe6930U, unwinder.frames()[0].sp);
222 EXPECT_EQ(0xf1f6dce5U, unwinder.frames()[1].pc);
223 EXPECT_EQ(0xd8fe6958U, unwinder.frames()[1].sp);
212} 224}
213 225
214TEST_F(UnwindOfflineTest, pc_straddle_arm64) { 226TEST_F(UnwindOfflineTest, pc_straddle_arm64) {
@@ -229,6 +241,18 @@ TEST_F(UnwindOfflineTest, pc_straddle_arm64) {
229 "(_ZN11unwindstack37UnwindTest_remote_through_signal_Test8TestBodyEv+32)\n" 241 "(_ZN11unwindstack37UnwindTest_remote_through_signal_Test8TestBodyEv+32)\n"
230 " #05 pc 0000000000455d70 libunwindstack_test (_ZN7testing4Test3RunEv+392)\n", 242 " #05 pc 0000000000455d70 libunwindstack_test (_ZN7testing4Test3RunEv+392)\n",
231 frame_info); 243 frame_info);
244 EXPECT_EQ(0x64d09d4fd8U, unwinder.frames()[0].pc);
245 EXPECT_EQ(0x7fe0d84040U, unwinder.frames()[0].sp);
246 EXPECT_EQ(0x64d09d5078U, unwinder.frames()[1].pc);
247 EXPECT_EQ(0x7fe0d84070U, unwinder.frames()[1].sp);
248 EXPECT_EQ(0x64d09d508cU, unwinder.frames()[2].pc);
249 EXPECT_EQ(0x7fe0d84080U, unwinder.frames()[2].sp);
250 EXPECT_EQ(0x64d09d88fcU, unwinder.frames()[3].pc);
251 EXPECT_EQ(0x7fe0d84090U, unwinder.frames()[3].sp);
252 EXPECT_EQ(0x64d09d88d8U, unwinder.frames()[4].pc);
253 EXPECT_EQ(0x7fe0d840f0U, unwinder.frames()[4].sp);
254 EXPECT_EQ(0x64d0a00d70U, unwinder.frames()[5].pc);
255 EXPECT_EQ(0x7fe0d84110U, unwinder.frames()[5].sp);
232} 256}
233 257
234static void AddMemory(std::string file_name, MemoryOfflineParts* parts) { 258static void AddMemory(std::string file_name, MemoryOfflineParts* parts) {
@@ -390,6 +414,144 @@ TEST_F(UnwindOfflineTest, jit_debug_x86) {
390 " #67 pc 00001a80 dalvikvm32 (main+1312)\n" 414 " #67 pc 00001a80 dalvikvm32 (main+1312)\n"
391 " #68 pc 00018275 libc.so\n", 415 " #68 pc 00018275 libc.so\n",
392 frame_info); 416 frame_info);
417 EXPECT_EQ(0xeb89bfb8U, unwinder.frames()[0].pc);
418 EXPECT_EQ(0xffeb5280U, unwinder.frames()[0].sp);
419 EXPECT_EQ(0xeb89af00U, unwinder.frames()[1].pc);
420 EXPECT_EQ(0xffeb52a0U, unwinder.frames()[1].sp);
421 EXPECT_EQ(0xec6061a8U, unwinder.frames()[2].pc);
422 EXPECT_EQ(0xffeb5ce0U, unwinder.frames()[2].sp);
423 EXPECT_EQ(0xee75be81U, unwinder.frames()[3].pc);
424 EXPECT_EQ(0xffeb5d30U, unwinder.frames()[3].sp);
425 EXPECT_EQ(0xf728e4d2U, unwinder.frames()[4].pc);
426 EXPECT_EQ(0xffeb5d60U, unwinder.frames()[4].sp);
427 EXPECT_EQ(0xf6d27ab5U, unwinder.frames()[5].pc);
428 EXPECT_EQ(0xffeb5d80U, unwinder.frames()[5].sp);
429 EXPECT_EQ(0xf6f7df0dU, unwinder.frames()[6].pc);
430 EXPECT_EQ(0xffeb5e20U, unwinder.frames()[6].sp);
431 EXPECT_EQ(0xf6f73552U, unwinder.frames()[7].pc);
432 EXPECT_EQ(0xffeb5ec0U, unwinder.frames()[7].sp);
433 EXPECT_EQ(0xf6f7499aU, unwinder.frames()[8].pc);
434 EXPECT_EQ(0xffeb5f40U, unwinder.frames()[8].sp);
435 EXPECT_EQ(0xf7265362U, unwinder.frames()[9].pc);
436 EXPECT_EQ(0xffeb5fb0U, unwinder.frames()[9].sp);
437 EXPECT_EQ(0xf72945bdU, unwinder.frames()[10].pc);
438 EXPECT_EQ(0xffeb6110U, unwinder.frames()[10].sp);
439 EXPECT_EQ(0xee75be04U, unwinder.frames()[11].pc);
440 EXPECT_EQ(0xffeb6160U, unwinder.frames()[11].sp);
441 EXPECT_EQ(0xf728e4d2U, unwinder.frames()[12].pc);
442 EXPECT_EQ(0xffeb6180U, unwinder.frames()[12].sp);
443 EXPECT_EQ(0xf6d27ab5U, unwinder.frames()[13].pc);
444 EXPECT_EQ(0xffeb61b0U, unwinder.frames()[13].sp);
445 EXPECT_EQ(0xf6f7df0dU, unwinder.frames()[14].pc);
446 EXPECT_EQ(0xffeb6250U, unwinder.frames()[14].sp);
447 EXPECT_EQ(0xf6f73552U, unwinder.frames()[15].pc);
448 EXPECT_EQ(0xffeb62f0U, unwinder.frames()[15].sp);
449 EXPECT_EQ(0xf6f7499aU, unwinder.frames()[16].pc);
450 EXPECT_EQ(0xffeb6370U, unwinder.frames()[16].sp);
451 EXPECT_EQ(0xf7265362U, unwinder.frames()[17].pc);
452 EXPECT_EQ(0xffeb63e0U, unwinder.frames()[17].sp);
453 EXPECT_EQ(0xf72945bdU, unwinder.frames()[18].pc);
454 EXPECT_EQ(0xffeb6530U, unwinder.frames()[18].sp);
455 EXPECT_EQ(0xee75bd3cU, unwinder.frames()[19].pc);
456 EXPECT_EQ(0xffeb6580U, unwinder.frames()[19].sp);
457 EXPECT_EQ(0xf728e4d2U, unwinder.frames()[20].pc);
458 EXPECT_EQ(0xffeb65b0U, unwinder.frames()[20].sp);
459 EXPECT_EQ(0xf6d27ab5U, unwinder.frames()[21].pc);
460 EXPECT_EQ(0xffeb65e0U, unwinder.frames()[21].sp);
461 EXPECT_EQ(0xf6f7df0dU, unwinder.frames()[22].pc);
462 EXPECT_EQ(0xffeb6680U, unwinder.frames()[22].sp);
463 EXPECT_EQ(0xf6f73552U, unwinder.frames()[23].pc);
464 EXPECT_EQ(0xffeb6720U, unwinder.frames()[23].sp);
465 EXPECT_EQ(0xf6f7499aU, unwinder.frames()[24].pc);
466 EXPECT_EQ(0xffeb67a0U, unwinder.frames()[24].sp);
467 EXPECT_EQ(0xf7265362U, unwinder.frames()[25].pc);
468 EXPECT_EQ(0xffeb6810U, unwinder.frames()[25].sp);
469 EXPECT_EQ(0xf72945bdU, unwinder.frames()[26].pc);
470 EXPECT_EQ(0xffeb6960U, unwinder.frames()[26].sp);
471 EXPECT_EQ(0xee75bbdcU, unwinder.frames()[27].pc);
472 EXPECT_EQ(0xffeb69b0U, unwinder.frames()[27].sp);
473 EXPECT_EQ(0xf728e6a2U, unwinder.frames()[28].pc);
474 EXPECT_EQ(0xffeb69f0U, unwinder.frames()[28].sp);
475 EXPECT_EQ(0xf6d27acbU, unwinder.frames()[29].pc);
476 EXPECT_EQ(0xffeb6a20U, unwinder.frames()[29].sp);
477 EXPECT_EQ(0xf6f7df0dU, unwinder.frames()[30].pc);
478 EXPECT_EQ(0xffeb6ac0U, unwinder.frames()[30].sp);
479 EXPECT_EQ(0xf6f73552U, unwinder.frames()[31].pc);
480 EXPECT_EQ(0xffeb6b60U, unwinder.frames()[31].sp);
481 EXPECT_EQ(0xf6f7499aU, unwinder.frames()[32].pc);
482 EXPECT_EQ(0xffeb6be0U, unwinder.frames()[32].sp);
483 EXPECT_EQ(0xf7265362U, unwinder.frames()[33].pc);
484 EXPECT_EQ(0xffeb6c50U, unwinder.frames()[33].sp);
485 EXPECT_EQ(0xf72945bdU, unwinder.frames()[34].pc);
486 EXPECT_EQ(0xffeb6dd0U, unwinder.frames()[34].sp);
487 EXPECT_EQ(0xee75b625U, unwinder.frames()[35].pc);
488 EXPECT_EQ(0xffeb6e20U, unwinder.frames()[35].sp);
489 EXPECT_EQ(0xf728e4d2U, unwinder.frames()[36].pc);
490 EXPECT_EQ(0xffeb6e50U, unwinder.frames()[36].sp);
491 EXPECT_EQ(0xf6d27ab5U, unwinder.frames()[37].pc);
492 EXPECT_EQ(0xffeb6e70U, unwinder.frames()[37].sp);
493 EXPECT_EQ(0xf6f7df0dU, unwinder.frames()[38].pc);
494 EXPECT_EQ(0xffeb6f10U, unwinder.frames()[38].sp);
495 EXPECT_EQ(0xf6f73552U, unwinder.frames()[39].pc);
496 EXPECT_EQ(0xffeb6fb0U, unwinder.frames()[39].sp);
497 EXPECT_EQ(0xf6f7499aU, unwinder.frames()[40].pc);
498 EXPECT_EQ(0xffeb7030U, unwinder.frames()[40].sp);
499 EXPECT_EQ(0xf7265362U, unwinder.frames()[41].pc);
500 EXPECT_EQ(0xffeb70a0U, unwinder.frames()[41].sp);
501 EXPECT_EQ(0xf72945bdU, unwinder.frames()[42].pc);
502 EXPECT_EQ(0xffeb71f0U, unwinder.frames()[42].sp);
503 EXPECT_EQ(0xee75aedcU, unwinder.frames()[43].pc);
504 EXPECT_EQ(0xffeb7240U, unwinder.frames()[43].sp);
505 EXPECT_EQ(0xf728e4d2U, unwinder.frames()[44].pc);
506 EXPECT_EQ(0xffeb72a0U, unwinder.frames()[44].sp);
507 EXPECT_EQ(0xf6d27ab5U, unwinder.frames()[45].pc);
508 EXPECT_EQ(0xffeb72c0U, unwinder.frames()[45].sp);
509 EXPECT_EQ(0xf6f7df0dU, unwinder.frames()[46].pc);
510 EXPECT_EQ(0xffeb7360U, unwinder.frames()[46].sp);
511 EXPECT_EQ(0xf6f73552U, unwinder.frames()[47].pc);
512 EXPECT_EQ(0xffeb7400U, unwinder.frames()[47].sp);
513 EXPECT_EQ(0xf6f7499aU, unwinder.frames()[48].pc);
514 EXPECT_EQ(0xffeb7480U, unwinder.frames()[48].sp);
515 EXPECT_EQ(0xf7265362U, unwinder.frames()[49].pc);
516 EXPECT_EQ(0xffeb74f0U, unwinder.frames()[49].sp);
517 EXPECT_EQ(0xf72945bdU, unwinder.frames()[50].pc);
518 EXPECT_EQ(0xffeb7680U, unwinder.frames()[50].sp);
519 EXPECT_EQ(0xee756c22U, unwinder.frames()[51].pc);
520 EXPECT_EQ(0xffeb76d0U, unwinder.frames()[51].sp);
521 EXPECT_EQ(0xf728e6a2U, unwinder.frames()[52].pc);
522 EXPECT_EQ(0xffeb76f0U, unwinder.frames()[52].sp);
523 EXPECT_EQ(0xf6d27acbU, unwinder.frames()[53].pc);
524 EXPECT_EQ(0xffeb7710U, unwinder.frames()[53].sp);
525 EXPECT_EQ(0xf6f7df0dU, unwinder.frames()[54].pc);
526 EXPECT_EQ(0xffeb77b0U, unwinder.frames()[54].sp);
527 EXPECT_EQ(0xf6f73552U, unwinder.frames()[55].pc);
528 EXPECT_EQ(0xffeb7850U, unwinder.frames()[55].sp);
529 EXPECT_EQ(0xf6f7499aU, unwinder.frames()[56].pc);
530 EXPECT_EQ(0xffeb78d0U, unwinder.frames()[56].sp);
531 EXPECT_EQ(0xf7265362U, unwinder.frames()[57].pc);
532 EXPECT_EQ(0xffeb7940U, unwinder.frames()[57].sp);
533 EXPECT_EQ(0xf72945bdU, unwinder.frames()[58].pc);
534 EXPECT_EQ(0xffeb7a80U, unwinder.frames()[58].sp);
535 EXPECT_EQ(0xf728e6a2U, unwinder.frames()[59].pc);
536 EXPECT_EQ(0xffeb7ad0U, unwinder.frames()[59].sp);
537 EXPECT_EQ(0xf6d27acbU, unwinder.frames()[60].pc);
538 EXPECT_EQ(0xffeb7af0U, unwinder.frames()[60].sp);
539 EXPECT_EQ(0xf718bc95U, unwinder.frames()[61].pc);
540 EXPECT_EQ(0xffeb7b90U, unwinder.frames()[61].sp);
541 EXPECT_EQ(0xf718bb5aU, unwinder.frames()[62].pc);
542 EXPECT_EQ(0xffeb7c50U, unwinder.frames()[62].sp);
543 EXPECT_EQ(0xf706b3ddU, unwinder.frames()[63].pc);
544 EXPECT_EQ(0xffeb7d10U, unwinder.frames()[63].sp);
545 EXPECT_EQ(0xf6d6548cU, unwinder.frames()[64].pc);
546 EXPECT_EQ(0xffeb7d70U, unwinder.frames()[64].sp);
547 EXPECT_EQ(0xf6d5df06U, unwinder.frames()[65].pc);
548 EXPECT_EQ(0xffeb7df0U, unwinder.frames()[65].sp);
549 EXPECT_EQ(0x56574d8cU, unwinder.frames()[66].pc);
550 EXPECT_EQ(0xffeb7e40U, unwinder.frames()[66].sp);
551 EXPECT_EQ(0x56574a80U, unwinder.frames()[67].pc);
552 EXPECT_EQ(0xffeb7e70U, unwinder.frames()[67].sp);
553 EXPECT_EQ(0xf7363275U, unwinder.frames()[68].pc);
554 EXPECT_EQ(0xffeb7ef0U, unwinder.frames()[68].sp);
393} 555}
394 556
395TEST_F(UnwindOfflineTest, jit_debug_arm) { 557TEST_F(UnwindOfflineTest, jit_debug_arm) {
@@ -553,6 +715,158 @@ TEST_F(UnwindOfflineTest, jit_debug_arm) {
553 " #74 pc 00001349 dalvikvm32 (main+896)\n" 715 " #74 pc 00001349 dalvikvm32 (main+896)\n"
554 " #75 pc 000850c9 libc.so\n", 716 " #75 pc 000850c9 libc.so\n",
555 frame_info); 717 frame_info);
718 EXPECT_EQ(0xdfe66a5eU, unwinder.frames()[0].pc);
719 EXPECT_EQ(0xff85d180U, unwinder.frames()[0].sp);
720 EXPECT_EQ(0xe044712dU, unwinder.frames()[1].pc);
721 EXPECT_EQ(0xff85d200U, unwinder.frames()[1].sp);
722 EXPECT_EQ(0xe27a7cb1U, unwinder.frames()[2].pc);
723 EXPECT_EQ(0xff85d290U, unwinder.frames()[2].sp);
724 EXPECT_EQ(0xed75c175U, unwinder.frames()[3].pc);
725 EXPECT_EQ(0xff85d2b0U, unwinder.frames()[3].sp);
726 EXPECT_EQ(0xed761129U, unwinder.frames()[4].pc);
727 EXPECT_EQ(0xff85d2e8U, unwinder.frames()[4].sp);
728 EXPECT_EQ(0xed3b97a9U, unwinder.frames()[5].pc);
729 EXPECT_EQ(0xff85d370U, unwinder.frames()[5].sp);
730 EXPECT_EQ(0xed541833U, unwinder.frames()[6].pc);
731 EXPECT_EQ(0xff85d3d8U, unwinder.frames()[6].sp);
732 EXPECT_EQ(0xed528935U, unwinder.frames()[7].pc);
733 EXPECT_EQ(0xff85d428U, unwinder.frames()[7].sp);
734 EXPECT_EQ(0xed52971dU, unwinder.frames()[8].pc);
735 EXPECT_EQ(0xff85d470U, unwinder.frames()[8].sp);
736 EXPECT_EQ(0xed73c865U, unwinder.frames()[9].pc);
737 EXPECT_EQ(0xff85d4b0U, unwinder.frames()[9].sp);
738 EXPECT_EQ(0xed7606ffU, unwinder.frames()[10].pc);
739 EXPECT_EQ(0xff85d5d0U, unwinder.frames()[10].sp);
740 EXPECT_EQ(0xe27a7c31U, unwinder.frames()[11].pc);
741 EXPECT_EQ(0xff85d640U, unwinder.frames()[11].sp);
742 EXPECT_EQ(0xed75c175U, unwinder.frames()[12].pc);
743 EXPECT_EQ(0xff85d660U, unwinder.frames()[12].sp);
744 EXPECT_EQ(0xed761129U, unwinder.frames()[13].pc);
745 EXPECT_EQ(0xff85d698U, unwinder.frames()[13].sp);
746 EXPECT_EQ(0xed3b97a9U, unwinder.frames()[14].pc);
747 EXPECT_EQ(0xff85d720U, unwinder.frames()[14].sp);
748 EXPECT_EQ(0xed541833U, unwinder.frames()[15].pc);
749 EXPECT_EQ(0xff85d788U, unwinder.frames()[15].sp);
750 EXPECT_EQ(0xed528935U, unwinder.frames()[16].pc);
751 EXPECT_EQ(0xff85d7d8U, unwinder.frames()[16].sp);
752 EXPECT_EQ(0xed52971dU, unwinder.frames()[17].pc);
753 EXPECT_EQ(0xff85d820U, unwinder.frames()[17].sp);
754 EXPECT_EQ(0xed73c865U, unwinder.frames()[18].pc);
755 EXPECT_EQ(0xff85d860U, unwinder.frames()[18].sp);
756 EXPECT_EQ(0xed7606ffU, unwinder.frames()[19].pc);
757 EXPECT_EQ(0xff85d970U, unwinder.frames()[19].sp);
758 EXPECT_EQ(0xe27a7b77U, unwinder.frames()[20].pc);
759 EXPECT_EQ(0xff85d9e0U, unwinder.frames()[20].sp);
760 EXPECT_EQ(0xed75c175U, unwinder.frames()[21].pc);
761 EXPECT_EQ(0xff85da10U, unwinder.frames()[21].sp);
762 EXPECT_EQ(0xed761129U, unwinder.frames()[22].pc);
763 EXPECT_EQ(0xff85da48U, unwinder.frames()[22].sp);
764 EXPECT_EQ(0xed3b97a9U, unwinder.frames()[23].pc);
765 EXPECT_EQ(0xff85dad0U, unwinder.frames()[23].sp);
766 EXPECT_EQ(0xed541833U, unwinder.frames()[24].pc);
767 EXPECT_EQ(0xff85db38U, unwinder.frames()[24].sp);
768 EXPECT_EQ(0xed528935U, unwinder.frames()[25].pc);
769 EXPECT_EQ(0xff85db88U, unwinder.frames()[25].sp);
770 EXPECT_EQ(0xed52971dU, unwinder.frames()[26].pc);
771 EXPECT_EQ(0xff85dbd0U, unwinder.frames()[26].sp);
772 EXPECT_EQ(0xed73c865U, unwinder.frames()[27].pc);
773 EXPECT_EQ(0xff85dc10U, unwinder.frames()[27].sp);
774 EXPECT_EQ(0xed7606ffU, unwinder.frames()[28].pc);
775 EXPECT_EQ(0xff85dd20U, unwinder.frames()[28].sp);
776 EXPECT_EQ(0xe27a7a29U, unwinder.frames()[29].pc);
777 EXPECT_EQ(0xff85dd90U, unwinder.frames()[29].sp);
778 EXPECT_EQ(0xed75c175U, unwinder.frames()[30].pc);
779 EXPECT_EQ(0xff85ddc0U, unwinder.frames()[30].sp);
780 EXPECT_EQ(0xed76122fU, unwinder.frames()[31].pc);
781 EXPECT_EQ(0xff85de08U, unwinder.frames()[31].sp);
782 EXPECT_EQ(0xed3b97bbU, unwinder.frames()[32].pc);
783 EXPECT_EQ(0xff85de90U, unwinder.frames()[32].sp);
784 EXPECT_EQ(0xed541833U, unwinder.frames()[33].pc);
785 EXPECT_EQ(0xff85def8U, unwinder.frames()[33].sp);
786 EXPECT_EQ(0xed528935U, unwinder.frames()[34].pc);
787 EXPECT_EQ(0xff85df48U, unwinder.frames()[34].sp);
788 EXPECT_EQ(0xed52971dU, unwinder.frames()[35].pc);
789 EXPECT_EQ(0xff85df90U, unwinder.frames()[35].sp);
790 EXPECT_EQ(0xed73c865U, unwinder.frames()[36].pc);
791 EXPECT_EQ(0xff85dfd0U, unwinder.frames()[36].sp);
792 EXPECT_EQ(0xed7606ffU, unwinder.frames()[37].pc);
793 EXPECT_EQ(0xff85e110U, unwinder.frames()[37].sp);
794 EXPECT_EQ(0xe27a739bU, unwinder.frames()[38].pc);
795 EXPECT_EQ(0xff85e180U, unwinder.frames()[38].sp);
796 EXPECT_EQ(0xed75c175U, unwinder.frames()[39].pc);
797 EXPECT_EQ(0xff85e1b0U, unwinder.frames()[39].sp);
798 EXPECT_EQ(0xed761129U, unwinder.frames()[40].pc);
799 EXPECT_EQ(0xff85e1e0U, unwinder.frames()[40].sp);
800 EXPECT_EQ(0xed3b97a9U, unwinder.frames()[41].pc);
801 EXPECT_EQ(0xff85e268U, unwinder.frames()[41].sp);
802 EXPECT_EQ(0xed541833U, unwinder.frames()[42].pc);
803 EXPECT_EQ(0xff85e2d0U, unwinder.frames()[42].sp);
804 EXPECT_EQ(0xed528935U, unwinder.frames()[43].pc);
805 EXPECT_EQ(0xff85e320U, unwinder.frames()[43].sp);
806 EXPECT_EQ(0xed52971dU, unwinder.frames()[44].pc);
807 EXPECT_EQ(0xff85e368U, unwinder.frames()[44].sp);
808 EXPECT_EQ(0xed73c865U, unwinder.frames()[45].pc);
809 EXPECT_EQ(0xff85e3a8U, unwinder.frames()[45].sp);
810 EXPECT_EQ(0xed7606ffU, unwinder.frames()[46].pc);
811 EXPECT_EQ(0xff85e4c0U, unwinder.frames()[46].sp);
812 EXPECT_EQ(0xe27a6aa7U, unwinder.frames()[47].pc);
813 EXPECT_EQ(0xff85e530U, unwinder.frames()[47].sp);
814 EXPECT_EQ(0xed75c175U, unwinder.frames()[48].pc);
815 EXPECT_EQ(0xff85e5a0U, unwinder.frames()[48].sp);
816 EXPECT_EQ(0xed761129U, unwinder.frames()[49].pc);
817 EXPECT_EQ(0xff85e5d8U, unwinder.frames()[49].sp);
818 EXPECT_EQ(0xed3b97a9U, unwinder.frames()[50].pc);
819 EXPECT_EQ(0xff85e660U, unwinder.frames()[50].sp);
820 EXPECT_EQ(0xed541833U, unwinder.frames()[51].pc);
821 EXPECT_EQ(0xff85e6c8U, unwinder.frames()[51].sp);
822 EXPECT_EQ(0xed528935U, unwinder.frames()[52].pc);
823 EXPECT_EQ(0xff85e718U, unwinder.frames()[52].sp);
824 EXPECT_EQ(0xed52971dU, unwinder.frames()[53].pc);
825 EXPECT_EQ(0xff85e760U, unwinder.frames()[53].sp);
826 EXPECT_EQ(0xed73c865U, unwinder.frames()[54].pc);
827 EXPECT_EQ(0xff85e7a0U, unwinder.frames()[54].sp);
828 EXPECT_EQ(0xed7606ffU, unwinder.frames()[55].pc);
829 EXPECT_EQ(0xff85e8f0U, unwinder.frames()[55].sp);
830 EXPECT_EQ(0xe27a1a99U, unwinder.frames()[56].pc);
831 EXPECT_EQ(0xff85e960U, unwinder.frames()[56].sp);
832 EXPECT_EQ(0xed75c175U, unwinder.frames()[57].pc);
833 EXPECT_EQ(0xff85e990U, unwinder.frames()[57].sp);
834 EXPECT_EQ(0xed76122fU, unwinder.frames()[58].pc);
835 EXPECT_EQ(0xff85e9c8U, unwinder.frames()[58].sp);
836 EXPECT_EQ(0xed3b97bbU, unwinder.frames()[59].pc);
837 EXPECT_EQ(0xff85ea50U, unwinder.frames()[59].sp);
838 EXPECT_EQ(0xed541833U, unwinder.frames()[60].pc);
839 EXPECT_EQ(0xff85eab8U, unwinder.frames()[60].sp);
840 EXPECT_EQ(0xed528935U, unwinder.frames()[61].pc);
841 EXPECT_EQ(0xff85eb08U, unwinder.frames()[61].sp);
842 EXPECT_EQ(0xed52971dU, unwinder.frames()[62].pc);
843 EXPECT_EQ(0xff85eb50U, unwinder.frames()[62].sp);
844 EXPECT_EQ(0xed73c865U, unwinder.frames()[63].pc);
845 EXPECT_EQ(0xff85eb90U, unwinder.frames()[63].sp);
846 EXPECT_EQ(0xed7606ffU, unwinder.frames()[64].pc);
847 EXPECT_EQ(0xff85ec90U, unwinder.frames()[64].sp);
848 EXPECT_EQ(0xed75c175U, unwinder.frames()[65].pc);
849 EXPECT_EQ(0xff85ed00U, unwinder.frames()[65].sp);
850 EXPECT_EQ(0xed76122fU, unwinder.frames()[66].pc);
851 EXPECT_EQ(0xff85ed38U, unwinder.frames()[66].sp);
852 EXPECT_EQ(0xed3b97bbU, unwinder.frames()[67].pc);
853 EXPECT_EQ(0xff85edc0U, unwinder.frames()[67].sp);
854 EXPECT_EQ(0xed6ac92dU, unwinder.frames()[68].pc);
855 EXPECT_EQ(0xff85ee28U, unwinder.frames()[68].sp);
856 EXPECT_EQ(0xed6ac6c3U, unwinder.frames()[69].pc);
857 EXPECT_EQ(0xff85eeb8U, unwinder.frames()[69].sp);
858 EXPECT_EQ(0xed602411U, unwinder.frames()[70].pc);
859 EXPECT_EQ(0xff85ef48U, unwinder.frames()[70].sp);
860 EXPECT_EQ(0xed3e0a9fU, unwinder.frames()[71].pc);
861 EXPECT_EQ(0xff85ef90U, unwinder.frames()[71].sp);
862 EXPECT_EQ(0xed3db9b9U, unwinder.frames()[72].pc);
863 EXPECT_EQ(0xff85f008U, unwinder.frames()[72].sp);
864 EXPECT_EQ(0xab0d459fU, unwinder.frames()[73].pc);
865 EXPECT_EQ(0xff85f038U, unwinder.frames()[73].sp);
866 EXPECT_EQ(0xab0d4349U, unwinder.frames()[74].pc);
867 EXPECT_EQ(0xff85f050U, unwinder.frames()[74].sp);
868 EXPECT_EQ(0xedb0d0c9U, unwinder.frames()[75].pc);
869 EXPECT_EQ(0xff85f0c0U, unwinder.frames()[75].sp);
556} 870}
557 871
558// The eh_frame_hdr data is present but set to zero fdes. This should 872// The eh_frame_hdr data is present but set to zero fdes. This should
@@ -573,6 +887,16 @@ TEST_F(UnwindOfflineTest, bad_eh_frame_hdr_arm64) {
573 " #03 pc 0000000000000590 waiter64\n" 887 " #03 pc 0000000000000590 waiter64\n"
574 " #04 pc 00000000000a8e98 libc.so (__libc_init+88)\n", 888 " #04 pc 00000000000a8e98 libc.so (__libc_init+88)\n",
575 frame_info); 889 frame_info);
890 EXPECT_EQ(0x60a9fdf550U, unwinder.frames()[0].pc);
891 EXPECT_EQ(0x7fdd141990U, unwinder.frames()[0].sp);
892 EXPECT_EQ(0x60a9fdf568U, unwinder.frames()[1].pc);
893 EXPECT_EQ(0x7fdd1419a0U, unwinder.frames()[1].sp);
894 EXPECT_EQ(0x60a9fdf57cU, unwinder.frames()[2].pc);
895 EXPECT_EQ(0x7fdd1419b0U, unwinder.frames()[2].sp);
896 EXPECT_EQ(0x60a9fdf590U, unwinder.frames()[3].pc);
897 EXPECT_EQ(0x7fdd1419c0U, unwinder.frames()[3].sp);
898 EXPECT_EQ(0x7542d68e98U, unwinder.frames()[4].pc);
899 EXPECT_EQ(0x7fdd1419d0U, unwinder.frames()[4].sp);
576} 900}
577 901
578// The elf has bad eh_frame unwind information for the pcs. If eh_frame 902// The elf has bad eh_frame unwind information for the pcs. If eh_frame
@@ -592,6 +916,16 @@ TEST_F(UnwindOfflineTest, debug_frame_first_x86) {
592 " #03 pc 000006f7 waiter (main+23)\n" 916 " #03 pc 000006f7 waiter (main+23)\n"
593 " #04 pc 00018275 libc.so\n", 917 " #04 pc 00018275 libc.so\n",
594 frame_info); 918 frame_info);
919 EXPECT_EQ(0x56598685U, unwinder.frames()[0].pc);
920 EXPECT_EQ(0xffcf9e38U, unwinder.frames()[0].sp);
921 EXPECT_EQ(0x565986b7U, unwinder.frames()[1].pc);
922 EXPECT_EQ(0xffcf9e50U, unwinder.frames()[1].sp);
923 EXPECT_EQ(0x565986d7U, unwinder.frames()[2].pc);
924 EXPECT_EQ(0xffcf9e60U, unwinder.frames()[2].sp);
925 EXPECT_EQ(0x565986f7U, unwinder.frames()[3].pc);
926 EXPECT_EQ(0xffcf9e70U, unwinder.frames()[3].sp);
927 EXPECT_EQ(0xf744a275U, unwinder.frames()[4].pc);
928 EXPECT_EQ(0xffcf9e80U, unwinder.frames()[4].sp);
595} 929}
596 930
597// Make sure that a pc that is at the beginning of an fde unwinds correctly. 931// Make sure that a pc that is at the beginning of an fde unwinds correctly.
@@ -610,6 +944,16 @@ TEST_F(UnwindOfflineTest, eh_frame_hdr_begin_x86_64) {
610 " #03 pc 00000000000013ed unwind_test64 (main+13)\n" 944 " #03 pc 00000000000013ed unwind_test64 (main+13)\n"
611 " #04 pc 00000000000202b0 libc.so\n", 945 " #04 pc 00000000000202b0 libc.so\n",
612 frame_info); 946 frame_info);
947 EXPECT_EQ(0x561550b17a80U, unwinder.frames()[0].pc);
948 EXPECT_EQ(0x7ffcc8596ce8U, unwinder.frames()[0].sp);
949 EXPECT_EQ(0x561550b17dd9U, unwinder.frames()[1].pc);
950 EXPECT_EQ(0x7ffcc8596cf0U, unwinder.frames()[1].sp);
951 EXPECT_EQ(0x561550b1821eU, unwinder.frames()[2].pc);
952 EXPECT_EQ(0x7ffcc8596f40U, unwinder.frames()[2].sp);
953 EXPECT_EQ(0x561550b183edU, unwinder.frames()[3].pc);
954 EXPECT_EQ(0x7ffcc8597190U, unwinder.frames()[3].sp);
955 EXPECT_EQ(0x7f4de62162b0U, unwinder.frames()[4].pc);
956 EXPECT_EQ(0x7ffcc85971a0U, unwinder.frames()[4].sp);
613} 957}
614 958
615} // namespace unwindstack 959} // namespace unwindstack