changeset 1903:401fbd7ff77c

7003789: PTRACE_GETREGS problems with SA on Linux. Summary: ifdef definitions for PTRACE_GETREGS_REQ clarified Reviewed-by: dholmes
author kevinw
date Wed, 08 Dec 2010 04:50:35 -0800
parents 017cd8bce8a8
children f0ef5f5a460f 4de5f4101cfd 642e54d1850a
files agent/src/os/linux/ps_proc.c
diffstat 1 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/agent/src/os/linux/ps_proc.c	Tue Dec 07 03:15:45 2010 -0800
+++ b/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) {