Fix build issue on riscv 95/290495/1
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>
Mon, 27 Mar 2023 12:48:59 +0000 (14:48 +0200)
committerMateusz Moscicki <m.moscicki2@partner.samsung.com>
Mon, 27 Mar 2023 15:09:56 +0000 (17:09 +0200)
Change-Id: I37083fc604170613f0d7033afc6fa4cfb12901ae

src/livedumper/livedumper.hpp
src/livedumper/note.hpp

index 60de125..851194b 100644 (file)
@@ -28,7 +28,6 @@
 #include <limits.h>
 #include <string.h>
 #include <sys/mman.h>
-#include <sys/ptrace.h>
 #include <sys/wait.h>
 
 #include <fstream>
@@ -107,12 +106,8 @@ class LiveDumper {
        }
 
        void GetRegs(user_regs_struct *registers, pid_t pid) const {
-#if defined(__aarch64__) || (defined(__riscv) && __riscv_xlen == 64)
                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));
        }
index 65e112f..95e0113 100644 (file)
@@ -18,6 +18,9 @@
 #ifndef NOTE_HPP__
 #define NOTE_HPP__
 
+#include <sys/ptrace.h>
+#include <asm/ptrace.h>
+
 #include "helpers.hpp"
 #include "maps.hpp"