This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
ppc32 debugging ppc64, 2011 revisit
- From: Stan Shebs <stanshebs at earthlink dot net>
- To: gdb-patches at sourceware dot org
- Date: Mon, 18 Jul 2011 18:19:14 -0700
- Subject: ppc32 debugging ppc64, 2011 revisit
So Mentor Embedded Linux has a need for a run-anywhere native GDB for
PowerPC, meaning in practice that we want a 32-bit GDB that can debug
both 32- and 64-bit programs. So I imagine I'm clever, and steal some
bits from spu-linux-nat.c that use the *_3264 ptrace() commands that are
the defined way to get at a 64-bit program from 32-bit land, and it
works reasonably well, modulo various system hangs and crashes due to
32-x-64 lameness in the oldish version of PPC Linux we have in-house.
But in the usual way, when preparing for submission, I discover that rth
had posted similar code to solve the same problem - back in 2005! It's
at http://www.cygwin.com/ml/gdb-patches/2005-09/msg00082.html , and
there's even a bit of discussion thread; but it seems nothing was ever
committed.
So I have a couple questions:
1. Does anybody remember a fatal flaw, or was the patch simply forgotten
about?
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.)
3. Does anybody have an up-to-date Linux running on PPC64 hw that I
could use? There seem to be fewer compile farms around than formerly,
and the in-house machine is very old and may not survive a kernel
update, so we don't want to mess with it too much right now.
Stan
stan@codesourcery.com