Messages in this thread |  | | From | Roland McGrath <> | Subject | Re: ptrace PTRACE_PEEKUSER behavior | Date | Thu, 8 May 2008 12:44:31 -0700 (PDT) |
| |
> > Quoting Roland McGrath <roland@redhat.com>: > > > 'struct user' is really a virtual structure layout, and never exists > > anywhere as an actual struct. It's really just defining the argument > > values that can be used in PEEKUSR/POKEUSR calls. > > But the powerpc ptrace code returns the FPRs & FPSCR though they are > not part of user struct.
I guess I was too strong in describing 'struct user' as useful even in that sense. Each arch defines the offset values for its PEEKUSR/POKEUSR, and on powerpc the asm/ptrace.h PT_* macros are the only true definition of that ABI.
'struct user' is used in a.out core dumps, if those can even still be generated on powerpc. Other than that, the struct is actually meaningless cruft on powerpc. On other machines it's almost that, except that e.g. on x86 there is no other definition than offsetof(struct user, u_debugreg[0]) to supply that offset for PTRACE_POKEUSR.
> Does this mandate inclusion of floating point set in powerpc user struct?
I think what it mandates is dropping any idea that 'struct user' is necessarily meaningful in any generic sense. The only use it has is arch-specific cases where offsetof(struct user, something) is part of the ptrace ABI.
Thanks, Roland
|  |