7003789: PTRACE_GETREGS problems with SA on Linux.
Summary: ifdef definitions for PTRACE_GETREGS_REQ clarified
Reviewed-by: dholmes
--- a/hotspot/agent/src/os/linux/ps_proc.c Tue Dec 07 03:15:45 2010 -0800
+++ b/hotspot/agent/src/os/linux/ps_proc.c Wed Dec 08 04:50:35 2010 -0800
@@ -121,15 +121,13 @@
#define ptrace_getregs(request, pid, addr, data) ptrace(request, pid, data, addr)
#endif
-#ifdef _LP64
-#ifdef PTRACE_GETREGS64
+#if defined(_LP64) && defined(PTRACE_GETREGS64)
#define PTRACE_GETREGS_REQ PTRACE_GETREGS64
+#elif defined(PTRACE_GETREGS)
+#define PTRACE_GETREGS_REQ PTRACE_GETREGS
+#elif defined(PT_GETREGS)
+#define PTRACE_GETREGS_REQ PT_GETREGS
#endif
-#else
-#if defined(PTRACE_GETREGS) || defined(PT_GETREGS)
-#define PTRACE_GETREGS_REQ PTRACE_GETREGS
-#endif
-#endif /* _LP64 */
#ifdef PTRACE_GETREGS_REQ
if (ptrace_getregs(PTRACE_GETREGS_REQ, pid, user, NULL) < 0) {