Index: runtime/vm/signal_handler_linux.cc |
diff --git a/runtime/vm/signal_handler_linux.cc b/runtime/vm/signal_handler_linux.cc |
index 2f581b24f53d91c81ac1874e1ce8ca332f65c69b..7c522fd8840726dbe959691a00e69da8bfb20466 100644 |
--- a/runtime/vm/signal_handler_linux.cc |
+++ b/runtime/vm/signal_handler_linux.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 |