Fix vmap handling. Adjust all PCs by -2 in WalkStack.
Vmap handling didn't increment the register when it got the first hit in
the core spill mask (bug exposed by register promotion). Adjust PCs by -2
in WalkStack so that ToDexPc calls don't need adjustment. This corrects
line number information on "run-test 054".
Change-Id: Iebfb4109b5234bb7357b5ba538883c28dfc7cb26
diff --git a/src/exception_test.cc b/src/exception_test.cc
index 7acc584..fd012cd 100644
--- a/src/exception_test.cc
+++ b/src/exception_test.cc
@@ -98,11 +98,15 @@
ASSERT_EQ(kStackAlignment, 16);
ASSERT_EQ(sizeof(uintptr_t), sizeof(uint32_t));
+ // Create two fake stack frames with mapping data created in SetUp. We map offset 3 in the code
+ // two dex pc 3, however, we set the return pc to 5 as the stack walker always subtracts two
+ // from a return pc.
+
// Create/push fake 16byte stack frame for method g
fake_stack[top_of_stack++] = reinterpret_cast<uintptr_t>(method_g_);
fake_stack[top_of_stack++] = 0;
fake_stack[top_of_stack++] = 0;
- fake_stack[top_of_stack++] = reinterpret_cast<uintptr_t>(method_f_->GetCode()) + 3; // return pc
+ fake_stack[top_of_stack++] = reinterpret_cast<uintptr_t>(method_f_->GetCode()) + 5; // return pc
// Create/push fake 16byte stack frame for method f
fake_stack[top_of_stack++] = reinterpret_cast<uintptr_t>(method_f_);