diff options
4 files changed, 10 insertions, 12 deletions
diff --git a/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc b/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc index 461a6cfe..4ccb7201 100644 --- a/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc +++ b/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc @@ -43,6 +43,8 @@ #if defined(__ARM_EABI__) #define TID_PTR_REGISTER "r3" +#elif defined(__aarch64__) +#define TID_PTR_REGISTER "x3" #elif defined(__i386) #define TID_PTR_REGISTER "ecx" #elif defined(__x86_64) diff --git a/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc b/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc index 15a66ce2..010ec67c 100644 --- a/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc +++ b/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc @@ -433,6 +433,8 @@ TEST(LinuxPtraceDumperTest, VerifyStackReadWithMultipleThreads) { // specific register. Check that we can recover its value. #if defined(__ARM_EABI__) pid_t* process_tid_location = (pid_t*)(one_thread.regs.uregs[3]); +#elif defined(__aarch64__) + pid_t* process_tid_location = (pid_t*)(one_thread.regs.regs[3]); #elif defined(__i386) pid_t* process_tid_location = (pid_t*)(one_thread.regs.ecx); #elif defined(__x86_64) diff --git a/src/client/linux/minidump_writer/minidump_writer_unittest.cc b/src/client/linux/minidump_writer/minidump_writer_unittest.cc index 1ef064b1..e1046e12 100644 --- a/src/client/linux/minidump_writer/minidump_writer_unittest.cc +++ b/src/client/linux/minidump_writer/minidump_writer_unittest.cc @@ -525,26 +525,19 @@ TEST(MinidumpWriterTest, InvalidStackPointer) { // Fake the child's stack pointer for its crashing thread. NOTE: This must // be an invalid memory address for the child process (stack or otherwise). -#if defined(__i386) // Try 1MB below the current stack. uintptr_t invalid_stack_pointer = reinterpret_cast<uintptr_t>(&context) - 1024*1024; +#if defined(__i386) context.context.uc_mcontext.gregs[REG_ESP] = invalid_stack_pointer; #elif defined(__x86_64) - // Try 1MB below the current stack. - uintptr_t invalid_stack_pointer = - reinterpret_cast<uintptr_t>(&context) - 1024*1024; context.context.uc_mcontext.gregs[REG_RSP] = invalid_stack_pointer; #elif defined(__ARM_EABI__) - // Try 1MB below the current stack. - uintptr_t invalid_stack_pointer = - reinterpret_cast<uintptr_t>(&context) - 1024*1024; context.context.uc_mcontext.arm_sp = invalid_stack_pointer; +#elif defined(__aarch64__) + context.context.uc_mcontext.sp = invalid_stack_pointer; #elif defined(__mips__) - // Try 1MB below the current stack. - uintptr_t invalid_stack_pointer = - reinterpret_cast<uintptr_t>(&context) - 1024 * 1024; - context.context.uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP] = + context.context.uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP] = invalid_stack_pointer; #else # error "This code has not been ported to your platform yet." @@ -629,7 +622,7 @@ TEST(MinidumpWriterTest, MinidumpSizeLimit) { ASSERT_EQ(1, r); ASSERT_TRUE(pfd.revents & POLLIN); uint8_t junk; - ASSERT_EQ(read(fds[0], &junk, sizeof(junk)), + ASSERT_EQ(read(fds[0], &junk, sizeof(junk)), static_cast<ssize_t>(sizeof(junk))); } close(fds[0]); diff --git a/src/common/android/include/sys/procfs.h b/src/common/android/include/sys/procfs.h index ec65b91c..94994147 100644 --- a/src/common/android/include/sys/procfs.h +++ b/src/common/android/include/sys/procfs.h @@ -36,6 +36,7 @@ #else +#include <asm/ptrace.h> #include <sys/cdefs.h> #include <sys/user.h> #include <unistd.h> |