Index: source/Plugins/Process/Linux/NativeProcessLinux.cpp =================================================================== --- source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -19,12 +19,18 @@ #include #include #include +#include #include #include #include #include #include +#if defined (__arm64__) || defined (__aarch64__) +// NT_PRSTATUS and NT_FPREGSET definition +#include +#endif + // C++ Includes #include #include @@ -659,10 +665,22 @@ void ReadGPROperation::Execute(NativeProcessLinux *monitor) { +#if defined (__arm64__) || defined (__aarch64__) + int regset = NT_PRSTATUS; + struct iovec ioVec; + + ioVec.iov_base = m_buf; + ioVec.iov_len = m_buf_size; + if (PTRACE(PTRACE_GETREGSET, m_tid, ®set, &ioVec, m_buf_size) < 0) + m_result = false; + else + m_result = true; +#else if (PTRACE(PTRACE_GETREGS, m_tid, NULL, m_buf, m_buf_size) < 0) m_result = false; else m_result = true; +#endif } //------------------------------------------------------------------------------ @@ -687,10 +705,22 @@ void ReadFPROperation::Execute(NativeProcessLinux *monitor) { +#if defined (__arm64__) || defined (__aarch64__) + int regset = NT_FPREGSET; + struct iovec ioVec; + + ioVec.iov_base = m_buf; + ioVec.iov_len = m_buf_size; + if (PTRACE(PTRACE_GETREGSET, m_tid, ®set, &ioVec, m_buf_size) < 0) + m_result = false; + else + m_result = true; +#else if (PTRACE(PTRACE_GETFPREGS, m_tid, NULL, m_buf, m_buf_size) < 0) m_result = false; else m_result = true; +#endif } //------------------------------------------------------------------------------ @@ -744,10 +774,22 @@ void WriteGPROperation::Execute(NativeProcessLinux *monitor) { +#if defined (__arm64__) || defined (__aarch64__) + int regset = NT_PRSTATUS; + struct iovec ioVec; + + ioVec.iov_base = m_buf; + ioVec.iov_len = m_buf_size; + if (PTRACE(PTRACE_SETREGSET, m_tid, ®set, &ioVec, m_buf_size) < 0) + m_result = false; + else + m_result = true; +#else if (PTRACE(PTRACE_SETREGS, m_tid, NULL, m_buf, m_buf_size) < 0) m_result = false; else m_result = true; +#endif } //------------------------------------------------------------------------------ @@ -772,10 +814,22 @@ void WriteFPROperation::Execute(NativeProcessLinux *monitor) { +#if defined (__arm64__) || defined (__aarch64__) + int regset = NT_FPREGSET; + struct iovec ioVec; + + ioVec.iov_base = m_buf; + ioVec.iov_len = m_buf_size; + if (PTRACE(PTRACE_SETREGSET, m_tid, ®set, &ioVec, m_buf_size) < 0) + m_result = false; + else + m_result = true; +#else if (PTRACE(PTRACE_SETFPREGS, m_tid, NULL, m_buf, m_buf_size) < 0) m_result = false; else m_result = true; +#endif } //------------------------------------------------------------------------------