Fix the PC. And we pass the unit tests on host and target again.
Change-Id: I44a8db00269471bacd4031259f57358670583e49
diff --git a/src/thread.cc b/src/thread.cc
index 16b8b67..e264600 100644
--- a/src/thread.cc
+++ b/src/thread.cc
@@ -968,14 +968,14 @@
while (frame.GetSP() != 0) {
for ( ; frame.GetMethod() != 0; frame.Next()) {
+ DCHECK(frame.GetMethod()->IsWithinCode(pc));
+ visitor->VisitFrame(frame, pc);
+ pc = frame.GetReturnPC();
// Move the PC back 2 bytes as a call will frequently terminate the
// decoding of a particular instruction and we want to make sure we
// get the Dex PC of the instruction with the call and not the
// instruction following.
if (pc > 0) { pc -= 2; }
- DCHECK(frame.GetMethod()->IsWithinCode(pc));
- visitor->VisitFrame(frame, pc);
- pc = frame.GetReturnPC();
}
if (record == NULL) {
break;
@@ -993,14 +993,14 @@
if (frame.GetSP() != 0) {
for ( ; frame.GetMethod() != 0; frame.Next()) {
+ DCHECK(frame.GetMethod()->IsWithinCode(pc));
+ visitor->VisitFrame(frame, pc);
+ pc = frame.GetReturnPC();
// Move the PC back 2 bytes as a call will frequently terminate the
// decoding of a particular instruction and we want to make sure we
// get the Dex PC of the instruction with the call and not the
// instruction following.
if (pc > 0) { pc -= 2; }
- DCHECK(frame.GetMethod()->IsWithinCode(pc));
- visitor->VisitFrame(frame, pc);
- pc = frame.GetReturnPC();
}
if (include_upcall) {
visitor->VisitFrame(frame, pc);