7003789: PTRACE_GETREGS problems with SA on Linux.
authorkevinw
Wed, 08 Dec 2010 04:50:35 -0800
changeset 7415 e7c6833aac14
parent 7414 940d84ca7fca
child 7421 4abc09aaa48d
child 7439 572e3f624901
child 7443 39c85d63abf2
7003789: PTRACE_GETREGS problems with SA on Linux. Summary: ifdef definitions for PTRACE_GETREGS_REQ clarified Reviewed-by: dholmes
hotspot/agent/src/os/linux/ps_proc.c
--- 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) {