[PATCH] Use PTRACE_GETREGS on i386

Mike Frysinger vapier at gentoo.org
Mon Aug 29 18:16:41 UTC 2011


On Monday, August 29, 2011 04:42:04 Denys Vlasenko wrote:
> On Fri, 2011-08-26 at 15:56 -0400, Mike Frysinger wrote:
> > On Friday, August 26, 2011 13:32:17 Denys Vlasenko wrote:
> > > On Fri, 2011-08-26 at 20:36 +0400, Dmitry V. Levin wrote:
> > > > On Thu, Aug 25, 2011 at 12:10:06PM +0200, Denys Vlasenko wrote:
> > > > > +static struct i386_user_regs_struct i386_regs;
> > > > 
> > > > strace is not going to call PTRACE_GETREGS with different regs
> > > > structures, so is there any use to include the architecture name to
> > > > the structure name?
> > > 
> > > There *is* a reason to name it i386_regs: it makes it possible
> > > to easily find its uses.
> > > 
> > > For example,  Alpha, Blackfin and SH all have "static long r0". How can
> > > I quickly find only Alpha's usages of r0? There is no easy way to do
> > > it. I'd rather have them named alpha_r0, bfin_r0, sh_r0.
> > > 
> > > Same problem with variables named r10, a3 - several arches have them.
> > > "struct <something> regs" is used by FOUR architectures.
> > > 
> > > Variable pc is unique to S390, but it has such a short name that grep
> > > finds a lot of stray matches. Again, s390_pc would be much nicer.
> > 
> > i think this is a structure problem with the strace code base in general.
> > it'd be nice if we had all the arch-cruft in an arch-specific subdir
> > instead of sprinkling ifdefs everywhere.  changing the variable names is
> > a very poor- man's solution.
> 
> I am not proposing to change existing variables' names.
> I am explaining why I'm choosing names differently for NEW variables.

my point really wasnt relevant to the new/changing aspect, but to trying to 
namespace by prefixing variable names
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20110829/2f0defc4/attachment.bin>


More information about the Strace-devel mailing list