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

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

Powered by Google App Engine
This is Rietveld 408576698