diff options
author | dlong <none@none> | 2015-02-02 23:26:33 -0500 |
---|---|---|
committer | dlong <none@none> | 2015-02-02 23:26:33 -0500 |
commit | 9182af13ad5d9c033818c6cdc8ccc90c88b1a02f (patch) | |
tree | 03f66f55f632bc891f14aea23c6c7066385ef8c0 /agent | |
parent | eb75059dc2ce5c0963ff017a873c568951434537 (diff) | |
download | jdk8u_hotspot-9182af13ad5d9c033818c6cdc8ccc90c88b1a02f.tar.gz |
8069030: support new PTRACE_GETREGSET
Summary: use PTRACE_GETREGSET if other options are not available
Reviewed-by: sla, dholmes
Diffstat (limited to 'agent')
-rw-r--r-- | agent/src/os/linux/ps_proc.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/agent/src/os/linux/ps_proc.c b/agent/src/os/linux/ps_proc.c index 61923a255..270b9d295 100644 --- a/agent/src/os/linux/ps_proc.c +++ b/agent/src/os/linux/ps_proc.c @@ -27,9 +27,11 @@ #include <string.h> #include <signal.h> #include <errno.h> +#include <elf.h> #include <sys/types.h> #include <sys/wait.h> #include <sys/ptrace.h> +#include <sys/uio.h> #include "libproc_impl.h" #if defined(x86_64) && !defined(amd64) @@ -138,6 +140,15 @@ static bool process_get_lwp_regs(struct ps_prochandle* ph, pid_t pid, struct use 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; |