[lkml]   [2008]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: ptrace PTRACE_PEEKUSER behavior
> Quoting Roland McGrath <>:
> > '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.


 \ /
  Last update: 2008-05-08 21:47    [W:0.045 / U:7.804 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site