In ptrace, when request is PPC_PTRACE_GETREGS, SETREGS, GETFPREGS and SETFPREGS, order of the last two arguments is not correct. General format of ptrace is ptrace (request, pid, addr, data). For the above mentioned request ids in ppc64, if we use ptrace like long reg[32]; ptrace (PPC_PTRACE_GETREGS, pid, 0, ®[0]); the return value is always -1. If we exchange the last two arguments like, ptrace (PPC_PTRACE_GETREGS, pid, ®[0], 0); it works! This is because PPC_PTRACE_GETREGS option for powerpc is implemented such that general purpose registers of the child process get copied to the address variable instead of data variable. Same is the case with other PPC request options PPC_PTRACE_SETREGS, GETFPREGS and SETFPREGS. Prepared a patch for this problem and tested with 2.6.18-rc6 kernel. This patch can be applied directly to 2.6.19-rc3 kernel.