Date: Mon, 18 Jul 2011 18:19:14 -0700
From: Stan Shebs<stanshebs@earthlink.net>
2. The old patch works by making a clone of the generic xfer_partial, to
accommodate the randomly-different API of the 32-x-64 ptrace commands,
but I added #ifdef cases to inf-ptrace.c, which actually seemed cleaner,
and avoided duplicating the semi-complicated algorithm. (Yes yes,
ifdefs are evil, but keep in mind that inf-ptrace.c is inherently
native-only.)
Indeed, ifdefs are generally ok in native-only code, but we should
avoid things turning into an ifdef maze. I don't know hiw invaisive
your changes are, but I think you should consider cloning the bits of
inf_ptrace_xfer_partial() that are relevant into ppc-linux-nat.c and
make your changes there. If you substitute the appropriate types for
PTRACE_RET_TYPE and PTRACE_TYPE_ARG3, the code will be more readable.
Also, you probably don't need to worry about PT_WRITE_D
vs. PT_WRITE_I.