# HG changeset patch # User dlong # Date 1422937593 18000 # Node ID 7e2e246df4e9a1df4d7067a0bd33fe5a21bdfc82 # Parent 134cdf5e0b8a4a4993748802e2ca90a81cddcbc2 8069030: support new PTRACE_GETREGSET Summary: use PTRACE_GETREGSET if other options are not available Reviewed-by: sla, dholmes diff -r 134cdf5e0b8a -r 7e2e246df4e9 agent/src/os/linux/ps_proc.c --- a/agent/src/os/linux/ps_proc.c Thu Mar 13 14:55:34 2014 -0700 +++ b/agent/src/os/linux/ps_proc.c Mon Feb 02 23:26:33 2015 -0500 @@ -27,9 +27,11 @@ #include #include #include +#include #include #include #include +#include #include "libproc_impl.h" #if defined(x86_64) && !defined(amd64) @@ -138,6 +140,15 @@ return false; } return true; +#elif defined(PTRACE_GETREGSET) + struct iovec iov; + iov.iov_base = user; + iov.iov_len = sizeof(*user); + if (ptrace(PTRACE_GETREGSET, pid, NT_PRSTATUS, (void*) &iov) < 0) { + print_debug("ptrace(PTRACE_GETREGSET, ...) failed for lwp %d\n", pid); + return false; + } + return true; #else print_debug("ptrace(PTRACE_GETREGS, ...) not supported\n"); return false;