]> granicus.if.org Git - strace/commitdiff
x32: use PTRACE_GETREGSET unconditionally
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 17 Mar 2013 23:15:18 +0000 (23:15 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 18 Mar 2013 11:46:35 +0000 (11:46 +0000)
* syscall.c (get_regs) [X32]: Assume that PTRACE_GETREGSET always works
regardless of the kernel version.

syscall.c

index 72ef2333284b4a8005738c87d70f66deb802fca8..4d72f42b36a91d5753a68dd4d584125bbbd88274 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -1005,7 +1005,12 @@ get_regs(pid_t pid)
        get_regs_error = ptrace(PTRACE_GETREGS, pid, NULL, &avr32_regs);
 # elif defined(I386)
        get_regs_error = ptrace(PTRACE_GETREGS, pid, NULL, (long) &i386_regs);
-# elif defined(X86_64) || defined(X32)
+# elif defined(X32)
+       /* x86_io.iov_base = &x86_regs_union; - already is */
+       x86_io.iov_len = sizeof(x86_regs_union);
+       get_regs_error = ptrace(PTRACE_GETREGSET, pid,
+                               NT_PRSTATUS, (long) &x86_io);
+# elif defined(X86_64)
        /*
         * PTRACE_GETREGSET was introduced in 2.6.33.
         * Let's be paranoid and require a bit later kernel.