]> granicus.if.org Git - strace/commit
On X86_64 and I386, use PTRACE_GETREGS to fetch all registers
authorDenys Vlasenko <dvlasenk@redhat.com>
Tue, 30 Aug 2011 16:53:49 +0000 (18:53 +0200)
committerDenys Vlasenko <dvlasenk@redhat.com>
Tue, 30 Aug 2011 16:53:49 +0000 (18:53 +0200)
commiteb0e3e8f501b8519594d57caf2632581b3031c50
treecfcc816d51112c2e47c9b2f5934318b9c7351be6
parenta673f3fa62e1c2f34d27e88fb0772b9ee3d6f0f1
On X86_64 and I386, use PTRACE_GETREGS to fetch all registers

Before this change, registers were read with PTRACE_PEEKUSER
ptrace operation, one per register. This is slower than
fetching them all in one ptrace operation.

* defs.h: include asm/ptrace.h on X86_64 and I386.
* syscall.c: New static variables i386_regs and x86_64_regs.
Remove static eax/rax variables.
(get_scno): Fetch all registers with single PTRACE_GETREGS operation.
(get_syscall_result): Likewise.
(syscall_fixup_on_sysenter): Use PTRACE_GETREGS results in i386/x86_64_regs.
(syscall_enter): Set tcp->u_arg[i] from PTRACE_GETREGS results.
(get_error): Set tcp->u_rval, tcp->u_error from PTRACE_GETREGS results.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
defs.h
syscall.c