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

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: explicit compare 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
« no previous file with comments | « runtime/vm/signal_handler_android.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « runtime/vm/signal_handler_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698