[PATCH 1/1] Add state argument to change_syscall and fix SPARC

Dmitry V. Levin ldv at altlinux.org
Fri Nov 30 00:02:30 UTC 2012


On Thu, Nov 29, 2012 at 05:37:37PM +0000, James Hogan wrote:
> Add a state argument to change_syscall() so that SPARC can modify that
> instead of read-modify-writing the whole register set. This function is
> always called within an arg_setup/arg_finish_change sequence which on
> certain architectures like SPARC will also be doing a read-modify-write.
> This prevents the second write (from arg_finish_change) from undoing the
> effects of the change_syscall() call.
> 
> * util.c (change_syscall): Add state arg.
> Move below definition of arg_setup_state.
> Change SPARC to set state->u_regs[U_REG_G1] rather than
> read-modify-writing it with PTRACE_GETREGS and PTRACE_SETREGS.
> (setbpt, clearbpt): Pass state arg to change_syscall.
> 
> Signed-off-by: James Hogan <james.hogan at imgtec.com>
> ---
> Note, I haven't compiled or tested this on SPARC or SPARC64, only on
> x86_64. It looks pretty trivial though.

I also haven't tested this on SPARC/SPARC64 but the fix is obvious so
I've applied it as is.

Thanks,


-- 
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/20121130/f6ff7008/attachment.bin>


More information about the Strace-devel mailing list