Index: runtime/vm/signal_handler_android.cc |
diff --git a/runtime/vm/signal_handler_android.cc b/runtime/vm/signal_handler_android.cc |
index 6482242ae949983577d33abfb6bedbd64c65bde7..e4e25b25da5ae51fd00453f56d1f291ae9c239be 100644 |
--- a/runtime/vm/signal_handler_android.cc |
+++ b/runtime/vm/signal_handler_android.cc |
@@ -36,7 +36,14 @@ uintptr_t SignalHandler::GetFramePointer(const mcontext_t& mcontext) { |
#elif defined(HOST_ARCH_X64) |
fp = static_cast<uintptr_t>(mcontext.gregs[REG_RBP]); |
#elif defined(HOST_ARCH_ARM) |
- fp = static_cast<uintptr_t>(mcontext.arm_fp); |
+ // B1.3.3 Program Status Registers (PSRs) |
+ if ((mcontext.arm_cpsr & (1 << 5)) != 0) { |
+ // Thumb mode. |
+ fp = static_cast<uintptr_t>(mcontext.arm_r7); |
+ } else { |
+ // ARM mode. |
+ fp = static_cast<uintptr_t>(mcontext.arm_fp); |
+ } |
#elif defined(HOST_ARCH_ARM64) |
fp = static_cast<uintptr_t>(mcontext.regs[29]); |
#else |