Patch to support AMD64 Solaris 10
Mon Oct 25 19:55:00 GMT 2004
Date: Mon, 25 Oct 2004 17:48:29 +0000 (UTC)
From: "Joseph S. Myers" <firstname.lastname@example.org>
Thanks for your contribution. The code looks pretty good to me, but
here are a few comments.
This patch adds initial support for Solaris 10 on AMD64. The test results
(debugging both 64-bit and 32-bit binaries) are fairly similar to those
for unmodified GDB (built as 32-bit and debugging 32-bit binaries), though
as the prerelease operating system isn't yet fully reliable running the
GDB testsuite it's difficult to get full testsuite results for comparison.
Oh dear. So the guys at Sun still have to do some catching up with
the Open Source OS'es ;-).
The configuration is based on the existing IA32 Solaris support.
Fair enough, although it's not necessarily the best example.
A limitation of this patch is that GDB needs to be built as a 64-bit
binary (configured with CC="gcc -m64": 32-bit compilation is the default
for this system) to work on AMD64 Solaris; GDB built as a 32-bit binary
doesn't work with this patch on AMD64 Solaris 10. The problem is that
there is a single target triplet and so a single GDB configuration, but
64-bit GDB should be using the functions in amd64-sol2-nat.c added by this
patch while 32-bit GDB (which in any case could only debug 32-bit
binaries, but the operating system does support plain x86 systems as well
as AMD64 ones, so such a GDB is desirable) should be using the functions
in i386v4-nat.c. Any comments on the best approach for having the single
configuration cleanly support being built as both 32-bit and 64-bit?
This sounds pretty much like the situation for Solaris SPARC. I think
the way this is solved in sparc-sol2-tdep.c is pretty elegant, but I
may be biased ;-). The defined(__arch64__) should be dropped though,
since there is no need to support Linux and IA-32/AMD64. For
consistency with SPARC I'd suggest nameing the file i386-sol2-nat.c.
Comparison with Solaris SPARC makes me believe that using
gregset_t/fpregset_t in amd64-sol2-nat.c isn't right and that you
should use prgregset_t/prfpregset_t instead.
Again, for consistency with Solaris SPARC, could you name the makefile
fragments sol2-64.m[th] instead of sol64.m[th]?
Oh and I suppose Sun is calling this Solaris AMD64 instead of Solaris
x86-64 so I think your comments should do the same. AFAIAC, scrap the
"Based on" comments. I don't think they're very useful.
You're not listed in the GDB MAINTAINERS file, so we'll have to check
out the paperwork first before I can approve any of this.
More information about the Gdb-patches