diff options
Diffstat (limited to 'chromium/base/profiler/register_context.h')
-rw-r--r-- | chromium/base/profiler/register_context.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/chromium/base/profiler/register_context.h b/chromium/base/profiler/register_context.h index 9c6eaf1b1b2..556b34c27aa 100644 --- a/chromium/base/profiler/register_context.h +++ b/chromium/base/profiler/register_context.h @@ -17,6 +17,8 @@ #include <windows.h> #elif defined(OS_MACOSX) #include <mach/machine/thread_status.h> +#elif defined(OS_ANDROID) && !defined(ARCH_CPU_64_BITS) +#include <sys/ucontext.h> #endif namespace base { @@ -83,6 +85,23 @@ inline uintptr_t& RegisterContextInstructionPointer( return AsUintPtr(&context->__rip); } +#elif defined(OS_ANDROID) && defined(ARCH_CPU_ARM_FAMILY) && \ + defined(ARCH_CPU_32_BITS) // #if defined(OS_WIN) + +using RegisterContext = mcontext_t; + +inline uintptr_t& RegisterContextStackPointer(mcontext_t* context) { + return AsUintPtr(&context->arm_sp); +} + +inline uintptr_t& RegisterContextFramePointer(mcontext_t* context) { + return AsUintPtr(&context->arm_fp); +} + +inline uintptr_t& RegisterContextInstructionPointer(mcontext_t* context) { + return AsUintPtr(&context->arm_ip); +} + #else // #if defined(OS_WIN) // Placeholders for other platforms. |