diff options
author | rmcilroy@chromium.org <rmcilroy@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2014-04-03 13:15:37 +0000 |
---|---|---|
committer | rmcilroy@chromium.org <rmcilroy@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2014-04-03 13:15:37 +0000 |
commit | 410b7024e3b66863af88e624536bebbbb7873252 (patch) | |
tree | e025780f530fd5ed4986333b97ed34c44d92c0a8 /src/client/linux/handler | |
parent | First cut at adding arm64 Linux / Android support to Breakpad. (diff) | |
download | breakpad-410b7024e3b66863af88e624536bebbbb7873252.tar.xz |
Add Arm64 version of breakpad_getcontext for Android.
This CL adds breakpad_getcontext support for Arm64 to Android. The assembly
is based on getcontext.S in glibc.
BUG=354405,335641
R=mark@chromium.org
Review URL: https://breakpad.appspot.com/1384002
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1302 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/linux/handler')
-rw-r--r-- | src/client/linux/handler/exception_handler.cc | 11 | ||||
-rw-r--r-- | src/client/linux/handler/exception_handler.h | 8 |
2 files changed, 13 insertions, 6 deletions
diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc index 9d081ca8..e5aaecd8 100644 --- a/src/client/linux/handler/exception_handler.cc +++ b/src/client/linux/handler/exception_handler.cc @@ -398,8 +398,15 @@ bool ExceptionHandler::HandleSignal(int sig, siginfo_t* info, void* uc) { CrashContext context; memcpy(&context.siginfo, info, sizeof(siginfo_t)); memcpy(&context.context, uc, sizeof(struct ucontext)); -#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__) - // FP state is not part of user ABI on ARM or ARM64 Linux. +#if defined(__aarch64__) + struct ucontext *uc_ptr = (struct ucontext*)uc; + struct fpsimd_context *fp_ptr = + (struct fpsimd_context*)&uc_ptr->uc_mcontext.__reserved; + if (fp_ptr->head.magic == FPSIMD_MAGIC) { + memcpy(&context.float_state, fp_ptr, sizeof(context.float_state)); + } +#elif !defined(__ARM_EABI__) && !defined(__mips__) + // FP state is not part of user ABI on ARM Linux. // In case of MIPS Linux FP state is already part of struct ucontext // and 'float_state' is not a member of CrashContext. struct ucontext *uc_ptr = (struct ucontext*)uc; diff --git a/src/client/linux/handler/exception_handler.h b/src/client/linux/handler/exception_handler.h index 2e842d83..e906e7a7 100644 --- a/src/client/linux/handler/exception_handler.h +++ b/src/client/linux/handler/exception_handler.h @@ -190,11 +190,11 @@ class ExceptionHandler { siginfo_t siginfo; pid_t tid; // the crashing thread. struct ucontext context; -#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__) - // #ifdef this out because FP state is not part of user ABI for Linux ARM - // or ARM64. In case of MIPS Linux FP state is already part of struct +#if !defined(__ARM_EABI__) && !defined(__mips__) + // #ifdef this out because FP state is not part of user ABI for Linux ARM. + // In case of MIPS Linux FP state is already part of struct // ucontext so 'float_state' is not required. - struct _libc_fpstate float_state; + fpstate_t float_state; #endif }; |