Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(754)

Unified Diff: runtime/vm/signal_handler_linux.cc

Issue 2965823002: [profiler, linux/android] Check whether a sample is ARM or Thumb code to decide which FP register t… (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..c8aeb92bfb93eb0aff288eef0f8c8836894bed20 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)) {
zra 2017/06/30 21:35:30 ditto
rmacnak 2017/06/30 21:44:21 Done.
+ // 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
« runtime/vm/signal_handler_android.cc ('K') | « runtime/vm/signal_handler_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698