This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Patches for GNU/Linux PPC native now in CVS
- To: gdb at sourceware dot cygnus dot com
- Subject: Patches for GNU/Linux PPC native now in CVS
- From: Kevin Buettner <kevinb at cygnus dot com>
- Date: Mon, 21 Feb 2000 19:52:01 -0700
Howdy,
I've just committed the changes needed for a native GNU/Linux gdb port.
As many of you know, when I first did the port (back in the gdb-4.16
days), I made a copy of rs6000-tdep.c and hacked away at it. At the
time, this was certainly more expedient and I was certain that I
wouldn't break the other ports which depended on rs6000-tdep.c.
In doing the merge, it was my intent to convert rs6000-tdep.c to use
the gdbarch machinery and then integrate my linux patches. It turns
out that it wasn't necessary to do any conversion to the gdbarch
machinery and I was able to get by with only minor changes to
rs6000-tdep.c. What I did was to create a new file named
ppc-linux-tdep.c and in it I placed all of the linux specific
knowledge. This knowledge pertains to things like how to deal with
signal handlers and shared library trampolines.
In config/powerpc/tm-linux.h, I override a number of macros (which'll
someday be gdbarch'd) to call functions specific to linux/ppc. But,
in most cases, I only deal with the special cases for linux that
aren't dealt with in rs6000-tdep.c. And I usually end up calling the
equivalent function in rs6000-tdep.c to do the bulk of the work
and to handle the non-special cases. Thus, there is very little, if
any, duplicated code between rs6000-tdep.c and ppc-linux-tdep.c.
The one function that will need to be moved or eliminated at some
point is ppc_sysv_abi_push_arguments (). As you might guess from
the name, this is a version of PUSH_ARGUMENTS for the PPC which
pushes the arguments according to the System V ABI. (It should
also do well for the EABI, since the ABIs are very similar with
regard to calling conventions.) The corresponding function in
rs6000-tdep.c is rs6000_push_arguments (). It is supposed to handle
all of the ABIs. I believe it does a credible job of handling the
PowerOpen (AIX) ABI, but I think there are a number of problems
with its support of the SysV ABI and EABI. (E.g, I know it doesn't
always pass long long correctly.)
I'm seeing 33 failures in the test suite at the present time. There
are some things which *should* work, like backtracing through signal
handlers, but which don't for some reason. In the coming days, I
will attempt to reduce the number of failures. In particular, I
will make sure we can backtrace through signal handlers. (I put
a lot of time into this in the initial port, and want to make sure
that it'll work again in the present port.)
I invite those of you who have Linux/PPC machines to try out these
changes and let me know how they work. Also, please let me know about
any problems that you find.
Kevin
--
Kevin Buettner
kev@primenet.com, kevinb@redhat.com