[csw-devel] SF.net SVN: gar:[10015] csw/mgar/pkg/gdb/trunk
dmichelsen at users.sourceforge.net
dmichelsen at users.sourceforge.net
Thu May 27 10:01:12 CEST 2010
Revision: 10015
http://gar.svn.sourceforge.net/gar/?rev=10015&view=rev
Author: dmichelsen
Date: 2010-05-27 08:01:12 +0000 (Thu, 27 May 2010)
Log Message:
-----------
gdb: Add patches from sfw
Modified Paths:
--------------
csw/mgar/pkg/gdb/trunk/Makefile
csw/mgar/pkg/gdb/trunk/checksums
Added Paths:
-----------
csw/mgar/pkg/gdb/trunk/files/gdb.auxv.patch
csw/mgar/pkg/gdb/trunk/files/gdb.solib-svr4.patch
Modified: csw/mgar/pkg/gdb/trunk/Makefile
===================================================================
--- csw/mgar/pkg/gdb/trunk/Makefile 2010-05-27 07:30:25 UTC (rev 10014)
+++ csw/mgar/pkg/gdb/trunk/Makefile 2010-05-27 08:01:12 UTC (rev 10015)
@@ -9,6 +9,10 @@
MASTER_SITES = http://ftp.gnu.org/gnu/gdb/
DISTFILES = $(GARNAME)-$(GARVERSION).tar.bz2
+# Patches from http://cvs.opensolaris.org/source/xref/sfw/usr/src/cmd/gdb/
+PATCHFILES = gdb.auxv.patch
+PATCHFILES += gdb.solib-svr4.patch
+
SPKG_SOURCEURL = http://www.gnu.org/software/gdb
# We define upstream file regex so we can be notifed of new upstream software release
Modified: csw/mgar/pkg/gdb/trunk/checksums
===================================================================
--- csw/mgar/pkg/gdb/trunk/checksums 2010-05-27 07:30:25 UTC (rev 10014)
+++ csw/mgar/pkg/gdb/trunk/checksums 2010-05-27 08:01:12 UTC (rev 10015)
@@ -1 +1,3 @@
-c9da266b884fb8fa54df786dfaadbc7a download/gdb-6.8.tar.bz2
+c9da266b884fb8fa54df786dfaadbc7a gdb-6.8.tar.bz2
+0e2918ca6429132ec762588dc722f6d0 gdb.auxv.patch
+d10a6f2ec5eaced8a9ae908b2d5e1d3e gdb.solib-svr4.patch
Added: csw/mgar/pkg/gdb/trunk/files/gdb.auxv.patch
===================================================================
--- csw/mgar/pkg/gdb/trunk/files/gdb.auxv.patch (rev 0)
+++ csw/mgar/pkg/gdb/trunk/files/gdb.auxv.patch 2010-05-27 08:01:12 UTC (rev 10015)
@@ -0,0 +1,81 @@
+--- gdb-6.8/gdb/auxv.c.orig Sun Aug 2 13:51:23 2009
++++ gdb-6.8/gdb/auxv.c Sun Aug 2 13:51:46 2009
+@@ -52,9 +52,21 @@
+ int fd;
+ LONGEST n;
+
++ /*
++ * Solaris pads auxv for 32 bit process out to 64 bits when being read
++ * by a 64 bit process. gdb expects a 32 bit auxv for 32 bit processes.
++ * We'll remove the padding here.
++ */
++ int solaris_64_32 = TYPE_LENGTH (builtin_type_void_data_ptr) == 4 && sizeof (void *) == 8;
++
+ gdb_assert (object == TARGET_OBJECT_AUXV);
+ gdb_assert (readbuf || writebuf);
+
++ /*
++ * Adjust offest for the 64/32 case.
++ */
++ if (solaris_64_32) offset *= 2;
++
+ pathname = xstrprintf ("/proc/%d/auxv", PIDGET (inferior_ptid));
+ fd = open (pathname, writebuf != NULL ? O_WRONLY : O_RDONLY);
+ xfree (pathname);
+@@ -64,10 +76,54 @@
+ if (offset != (ULONGEST) 0
+ && lseek (fd, (off_t) offset, SEEK_SET) != (off_t) offset)
+ n = -1;
+- else if (readbuf != NULL)
++ else if (readbuf != NULL) {
+ n = read (fd, readbuf, len);
+- else
++ /*
++ * Remove the padding for the 64/32 case.
++ */
++ if (solaris_64_32) {
++ /*
++ * Solaris pads auxv for 32 bit process out to 64 bits when being read
++ * by a 64 bit process. gdb expects a 32 bit auxv for 32 bit processes.
++ */
++ unsigned *from, *to;
++ gdb_assert (n % 4 == 0);
++ from = to = (unsigned *)readbuf;
++ while (from < (unsigned *)(readbuf + n)) {
++ /*
++ * The type is always in the first 4 bytes followed by 4 bytes
++ * of padding on both SPARC and x86.
++ */
++ *to++ = *from;
++ from += 2;
++ /*
++ * The value is before the padding on Intel and after on SPARC.
++ */
++ switch (gdbarch_byte_order (current_gdbarch)) {
++ case BFD_ENDIAN_LITTLE:
++ *to++ = *from;
++ gdb_assert (*(from + 1) == 0);
++ break;
++ case BFD_ENDIAN_BIG:
++ gdb_assert (*from == 0);
++ *to++ = *(from + 1);
++ break;
++ default: gdb_assert (0);
++ }
++ from += 2;
++ }
++ /*
++ * Adjust the length for the 64/32 case.
++ */
++ n /= 2;
++ }
++ } else {
++ /*
++ * Does gdb ever write to auxv?
++ */
++ gdb_assert (!writebuf);
+ n = write (fd, writebuf, len);
++ }
+
+ (void) close (fd);
+
Added: csw/mgar/pkg/gdb/trunk/files/gdb.solib-svr4.patch
===================================================================
--- csw/mgar/pkg/gdb/trunk/files/gdb.solib-svr4.patch (rev 0)
+++ csw/mgar/pkg/gdb/trunk/files/gdb.solib-svr4.patch 2010-05-27 08:01:12 UTC (rev 10015)
@@ -0,0 +1,15 @@
+--- gdb-6.8/gdb/solib-svr4.c.orig Fri Jul 10 12:25:23 2009
++++ gdb-6.8/gdb/solib-svr4.c Fri Jul 10 12:25:34 2009
+@@ -1649,6 +1649,12 @@
+ if (strcmp (gdb->so_original_name, "/usr/lib/ld.so.1") == 0
+ && strcmp (inferior->so_original_name, "/lib/ld.so.1") == 0)
+ return 1;
++ if (strcmp (gdb->so_original_name, "/usr/lib/amd64/ld.so.1") == 0
++ && strcmp (inferior->so_original_name, "/lib/amd64/ld.so.1") == 0)
++ return 1;
++ if (strcmp (gdb->so_original_name, "/usr/lib/sparcv9/ld.so.1") == 0
++ && strcmp (inferior->so_original_name, "/lib/sparcv9/ld.so.1") == 0)
++ return 1;
+
+ return 0;
+ }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list