--- strace-4.5.19/syscall.c	2009-10-12 12:54:21.000000000 -0700
+++ strace-4.5.19-dd/syscall.c	2010-02-09 10:38:51.000000000 -0800
@@ -2035,7 +2035,7 @@
 		else
 			nargs = tcp->u_nargs = MAX_ARGS;
 
-		if (ptrace (PTRACE_GETREGS, pid, NULL, (long) &regs) < 0)
+		if (ptrace (PTRACE_GETREGS, tcp->pid, NULL, (long) &regs) < 0)
 			return -1;
 
 		for(i = 0; i < nargs; i++) {

