From: Denys Vlasenko Date: Wed, 18 Jan 2012 10:07:24 +0000 (+0100) Subject: Change x86_64_regs struct type from pt_regs to user_regs_struct X-Git-Tag: v4.7~213 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e73a89d99921f7b9dc3f1350a4eb97c7fdc6032a;p=strace Change x86_64_regs struct type from pt_regs to user_regs_struct * 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 --- diff --git a/syscall.c b/syscall.c index d3560068..9c04cf90 100644 --- 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 */