#include <limits.h>
#include <string.h>
#include <sys/mman.h>
-#include <sys/ptrace.h>
#include <sys/wait.h>
#include <fstream>
}
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));
}