aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/linux/android_ucontext.h32
-rw-r--r--src/client/linux/handler/exception_handler.cc7
2 files changed, 7 insertions, 32 deletions
diff --git a/src/client/linux/android_ucontext.h b/src/client/linux/android_ucontext.h
index 30a4e6c2..7942db79 100644
--- a/src/client/linux/android_ucontext.h
+++ b/src/client/linux/android_ucontext.h
@@ -35,33 +35,15 @@
#ifndef GOOGLE_BREAKPAD_CLIENT_LINUX_ANDROID_UCONTEXT_H_
#define GOOGLE_BREAKPAD_CLIENT_LINUX_ANDROID_UCONTEXT_H_
+#include <android/api-level.h>
#include <signal.h>
-#if !defined(__GLIBC__) && (defined(__arm__) || defined(__thumb__))
+// <signal.h> didn't include <asm/sigcontext.h> before API level 8.
+// It is used to define struct sigcontext properly.
+#if defined(__arm__) && __ANDROID_API__ < 8
+#include <asm/sigcontext.h>
+#endif
-struct sigcontext {
- uint32_t trap_no;
- uint32_t error_code;
- uint32_t oldmask;
- uint32_t arm_r0;
- uint32_t arm_r1;
- uint32_t arm_r2;
- uint32_t arm_r3;
- uint32_t arm_r4;
- uint32_t arm_r5;
- uint32_t arm_r6;
- uint32_t arm_r7;
- uint32_t arm_r8;
- uint32_t arm_r9;
- uint32_t arm_r10;
- uint32_t arm_fp;
- uint32_t arm_ip;
- uint32_t arm_sp;
- uint32_t arm_lr;
- uint32_t arm_pc;
- uint32_t arm_cpsr;
- uint32_t fault_address;
-};
typedef uint32_t __sigset_t;
typedef struct sigcontext mcontext_t;
typedef struct ucontext {
@@ -72,6 +54,4 @@ typedef struct ucontext {
__sigset_t uc_sigmask;
} ucontext_t;
-#endif
-
#endif // GOOGLE_BREAKPAD_CLIENT_LINUX_ANDROID_UCONTEXT_H_
diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc
index 5d9e93f7..4b78424f 100644
--- a/src/client/linux/handler/exception_handler.cc
+++ b/src/client/linux/handler/exception_handler.cc
@@ -397,15 +397,10 @@ bool ExceptionHandler::GenerateDump(CrashContext *context) {
logger::write("\n", 1);
}
-#if defined(__ANDROID__)
- const pid_t child = clone(
- ThreadEntry, stack, CLONE_FILES | CLONE_FS | CLONE_UNTRACED,
- &thread_arg);
-#else
const pid_t child = sys_clone(
ThreadEntry, stack, CLONE_FILES | CLONE_FS | CLONE_UNTRACED,
&thread_arg, NULL, NULL, NULL);
-#endif
+
int r, status;
// Allow the child to ptrace us
sys_prctl(PR_SET_PTRACER, child);