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

Denys Vlasenko dvlasenk at redhat.com
Wed Jun 19 14:21:55 UTC 2013


On 06/10/2013 01:48 PM, Anton Blanchard wrote:
> 
> PTRACE_GETREGS was added to the ppc kernel in 2.6.23. In order to
> provide backward compatibility for very old kernels, add a manual
> fallback.


>  # 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);

Just to be sure that we only fall back if PTRACE_GETREGS op is unknown,
not in other cases (such as tracee killed under us) lets do this:

	if (get_regs_error && errno == ????)

Which errno is generated in this case?






More information about the Strace-devel mailing list