This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ppc32 debugging ppc64, 2011 revisit


On 7/23/11 2:38 PM, Mark Kettenis wrote:
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.

The cloning is a bit messy, because there are a couple additional call layers with heuristics for /proc reading and so forth, while the ifdef version adds about 10 lines total. In any case, I'll just post the patch and then count the number of fingers being poked down throats. :-)


Stan
stan@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]