]> granicus.if.org Git - strace/commitdiff
Change x86_64_regs struct type from pt_regs to user_regs_struct
authorDenys Vlasenko <dvlasenk@redhat.com>
Wed, 18 Jan 2012 10:07:24 +0000 (11:07 +0100)
committerDenys Vlasenko <dvlasenk@redhat.com>
Wed, 18 Jan 2012 10:07:24 +0000 (11:07 +0100)
* syscall.c: Change x86_64_regs struct type from
pt_regs to user_regs_struct, and explain the change in comment.

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

index d35600683d32e8f2a0eeb8973052a6f4d1252225..9c04cf90fe0080b907b5bcc2429ce03397148849 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -737,7 +737,13 @@ struct tcb *tcp_last = NULL;
 # if defined(I386)
 struct pt_regs i386_regs;
 # elif defined(X86_64)
-static struct pt_regs x86_64_regs;
+/*
+ * On 32 bits, pt_regs and user_regs_struct are the same,
+ * but on 64 bits, user_regs_struct has six more fields:
+ * fs_base, gs_base, ds, es, fs, gs.
+ * PTRACE_GETREGS fills them too, so struct pt_regs would overflow.
+ */
+static struct user_regs_struct x86_64_regs;
 # elif defined (IA64)
 long r8, r10, psr; /* TODO: make static? */
 long ia32 = 0; /* not static */