[PATCH 2/2] powerpc: Provide a fallback for old kernels without PTRACE_GETREGS

Dmitry V. Levin ldv at altlinux.org
Mon Jun 10 15:01:28 UTC 2013


On Mon, Jun 10, 2013 at 09:48:28PM +1000, Anton Blanchard wrote:
[...]
> @@ -1042,6 +1091,8 @@ get_regs(pid_t pid)
>  	get_regs_error = ptrace(PTRACE_GETREGS, pid, (char *)&sparc_regs, 0);
>  # elif defined(POWERPC)
>  	get_regs_error = ptrace(PTRACE_GETREGS, pid, NULL, (long) &ppc_regs);
> +	if (get_regs_error)
> +		get_regs_error = powerpc_getregs_old(pid);

I suggest checking errno, there is no need to try the fallback after genuine
ptrace errors.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20130610/d40d2c31/attachment.bin>


More information about the Strace-devel mailing list