SUGGESTED FIX
NO... I'd misread the original. Here's the intended fix:
--- a/agent/src/os/linux/ps_proc.c
+++ b/agent/src/os/linux/ps_proc.c
@@ -121,15 +121,13 @@ static bool process_get_lwp_regs(struct
#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) {
|
SUGGESTED FIX
UPDATED:
$ hg diff agent/src/os/linux/ps_proc.c
diff --git a/agent/src/os/linux/ps_proc.c b/agent/src/os/linux/ps_proc.c
--- a/agent/src/os/linux/ps_proc.c
+++ b/agent/src/os/linux/ps_proc.c
@@ -124,10 +124,10 @@ static bool process_get_lwp_regs(struct
#ifdef _LP64
#ifdef PTRACE_GETREGS64
#define PTRACE_GETREGS_REQ PTRACE_GETREGS64
-#endif
-#else
-#if defined(PTRACE_GETREGS) || defined(PT_GETREGS)
+#elif defined(PTRACE_GETREGS)
#define PTRACE_GETREGS_REQ PTRACE_GETREGS
+#elif defined (PT_GETREGS)
+#define PTRACE_GETREGS_REQ PT_GETREGS
#endif
#endif /* _LP64 */
|