From e2d604e7e71ddeae79cbcb06c2a9362fe8d354ac Mon Sep 17 00:00:00 2001 From: Michal Bloch Date: Thu, 23 May 2019 18:57:24 +0200 Subject: [PATCH] Release 5.5.13 Quickfix for a compilation issue on aarch64. Change-Id: I390dfaffba12ebe5692cf5d821abb56168d24a0c Signed-off-by: Michal Bloch --- packaging/crash-worker.spec | 2 +- packaging/crash-worker_system-tests.spec | 2 +- src/livedumper/livedumper.hpp | 5 +++++ src/livedumper/note.hpp | 4 ++++ tests/test3.c | 6 +++--- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/packaging/crash-worker.spec b/packaging/crash-worker.spec index 3cf5782..dfa19b8 100644 --- a/packaging/crash-worker.spec +++ b/packaging/crash-worker.spec @@ -14,7 +14,7 @@ Name: crash-worker Summary: Crash-manager -Version: 5.5.12 +Version: 5.5.13 Release: 1 Group: Framework/system License: Apache-2.0 and BSD diff --git a/packaging/crash-worker_system-tests.spec b/packaging/crash-worker_system-tests.spec index f18e16f..03dcd48 100644 --- a/packaging/crash-worker_system-tests.spec +++ b/packaging/crash-worker_system-tests.spec @@ -8,7 +8,7 @@ Name: crash-worker_system-tests Summary: Package with binaries and scripts for crash-worker system tests -Version: 5.5.12 +Version: 5.5.13 Release: 1 Group: Framework/system License: Apache-2.0 and BSD diff --git a/src/livedumper/livedumper.hpp b/src/livedumper/livedumper.hpp index b478b40..5b97066 100644 --- a/src/livedumper/livedumper.hpp +++ b/src/livedumper/livedumper.hpp @@ -98,7 +98,12 @@ class LiveDumper { } void GetRegs(user_regs_struct *registers, pid_t pid) const { +#if defined(__aarch64__) + struct iovec iov = { registers, sizeof *registers }; + if (ptrace(PTRACE_GETREGSET, pid, NT_PRSTATUS, &iov) == -1) +#else if (ptrace(PTRACE_GETREGS, pid, nullptr, registers) == -1) +#endif throw std::system_error(errno, std::system_category(), "failed to get registers for: " + std::to_string(pid)); } diff --git a/src/livedumper/note.hpp b/src/livedumper/note.hpp index 19b9927..6977c08 100644 --- a/src/livedumper/note.hpp +++ b/src/livedumper/note.hpp @@ -33,10 +33,14 @@ #if defined(__arm__) typedef user_regs user_regs_struct; #define MACHINE EM_ARM +#elif defined(__aarch64__) +#define MACHINE EM_AARCH64 #elif defined(__x86_64__) #define MACHINE EM_X86_64 #elif defined(__i386__) #define MACHINE EM_386 +#else +#error "architecture unsupported" #endif class Note { diff --git a/tests/test3.c b/tests/test3.c index ca6ae03..b61f3ff 100644 --- a/tests/test3.c +++ b/tests/test3.c @@ -2,7 +2,7 @@ #include #include -int crash_other_thread = 0; +intptr_t crash_other_thread = 0; #define CRASHING_THREAD 19 gboolean crasher(gpointer data) @@ -13,7 +13,7 @@ gboolean crasher(gpointer data) void *fun(void *arg) { - int threadnum = (int)arg; + intptr_t threadnum = (intptr_t)arg; if (crash_other_thread && threadnum == CRASHING_THREAD) crasher(NULL); else @@ -35,7 +35,7 @@ int main(int argc) } pthread_t t; - int i; + intptr_t i; for (i = 0; i <= CRASHING_THREAD; i++) pthread_create(&t, NULL, fun, (void *)i); -- 2.7.4