[csw-devel] SF.net SVN: gar:[18829] csw/mgar/pkg/gdb

pfelecan at users.sourceforge.net pfelecan at users.sourceforge.net
Mon Jul 23 08:56:03 CEST 2012


Revision: 18829
          http://gar.svn.sourceforge.net/gar/?rev=18829&view=rev
Author:   pfelecan
Date:     2012-07-23 06:56:03 +0000 (Mon, 23 Jul 2012)
Log Message:
-----------
gdb/trunk:
- migrated from a private recipe to a GAR based recipe
- removed patches from a previous tentative to "garify"

Modified Paths:
--------------
    csw/mgar/pkg/gdb/Makefile
    csw/mgar/pkg/gdb/trunk/Makefile
    csw/mgar/pkg/gdb/trunk/checksums

Added Paths:
-----------
    csw/mgar/pkg/gdb/trunk/files/0001-OpenSolaris-gdb-solib-svr4.patch
    csw/mgar/pkg/gdb/trunk/files/0002-OpenSolaris-gdb-fork-child.patch
    csw/mgar/pkg/gdb/trunk/files/0003-Extend-to-OpenCSW-the-OpenSolaris-gdb-fork-child.patch

Removed 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/Makefile
===================================================================
--- csw/mgar/pkg/gdb/Makefile	2012-07-21 16:02:28 UTC (rev 18828)
+++ csw/mgar/pkg/gdb/Makefile	2012-07-23 06:56:03 UTC (rev 18829)
@@ -1,15 +1,2 @@
-# vim: ft=make ts=4 sw=4 noet
-
-default:
-	@echo "You are in the pkg/ directory."
-
 %:
-	$(MAKE) -C trunk $* 
-
-paranoid-%:
-	$(MAKE) -C trunk $* || exit 2 
-
-export BUILDLOG ?= $(shell pwd)/buildlog.txt
-
-report-%:
-	$(MAKE) -C trunk $* || echo "	*** make $* in $$i failed ***" >> $(BUILDLOG) 
+	$(MAKE) -C trunk $*

Modified: csw/mgar/pkg/gdb/trunk/Makefile
===================================================================
--- csw/mgar/pkg/gdb/trunk/Makefile	2012-07-21 16:02:28 UTC (rev 18828)
+++ csw/mgar/pkg/gdb/trunk/Makefile	2012-07-23 06:56:03 UTC (rev 18829)
@@ -1,35 +1,74 @@
+# $Id$
+
 NAME = gdb
-VERSION = 6.8
+VERSION = 7.4.1
+GARTYPE = v2
 CATEGORIES = devel
-GARTYPE = v2
 
-DESCRIPTION = The GNU Project Debugger
+DESCRIPTION = The GNU Debugger
 define BLURB
-endef
+  GDB, the GNU Project debugger, allows you to see what is going on 'inside'
+  another program while it executes -- or what another program was doing at
+  the moment it crashed.
 
-MASTER_SITES = http://ftp.gnu.org/gnu/gdb/
-DISTFILES  = $(NAME)-$(VERSION).tar.bz2
+  GDB can do four main kinds of things (plus other things in support of these)
+  to help you catch bugs in the act:
 
-# Patches from http://cvs.opensolaris.org/source/xref/sfw/usr/src/cmd/gdb/
-PATCHFILES  = gdb.auxv.patch
-PATCHFILES += gdb.solib-svr4.patch
+  - Start your program, specifying anything that might affect its behavior.
+  - Make your program stop on specified conditions.
+  - Examine what has happened, when your program has stopped.
+  - Change things in your program, so you can experiment with correcting the
+    effects of one bug and go on to learn about another. 
 
-SPKG_SOURCEURL = http://www.gnu.org/software/gdb
+  The program being debugged can be written in Ada, C, C++, Objective-C, Pascal
+  (and many other languages). Those programs might be executing on the same
+   machine as GDB (native) or on another machine (remote). GDB can run on most
+  popular UNIX and Microsoft Windows variants.
+endef
 
-# We define upstream file regex so we can be notifed of new upstream software release
-UFILES_REGEX = $(NAME)-(\d+(?:\.\d+)*).tar.gz
+MASTER_SITES = $(GNU_MIRROR)
+DISTFILES  = $(DISTNAME).tar.gz
+# from private patch 2:
+PATCHFILES	+=	0001-OpenSolaris-gdb-solib-svr4.patch
+# from private patch 3:
+PATCHFILES	+=	0002-OpenSolaris-gdb-fork-child.patch
+# from private patch 4:
+PATCHFILES	+=	0003-Extend-to-OpenCSW-the-OpenSolaris-gdb-fork-child.patch
 
-# If the url used to check for software update is different of MASTER_SITES, then 
-# uncomment the next line. Otherwise it is set by default to the value of MASTER_SITES
-# UPSTREAM_MASTER_SITES = 
+GARCOMPILER		=	GNU
 
-RUNTIME_DEP_PKGS = CSWexpat CSWggettextrt CSWiconv CSWncurses
+BUILD_DEP_PKGS	+=	CSWgcc4ada
+BUILD_DEP_PKGS	+=	CSWflex-new
+BUILD_DEP_PKGS	+=	CSWexpect
+BUILD_DEP_PKGS	+=	CSWdejagnu
+BUILD_DEP_PKGS	+=	CSWlibiconv-dev
+BUILD_DEP_PKGS	+=	CSWlibncurses-dev
+BUILD_DEP_PKGS	+=	CSWlibz-dev
 
-BUILD64 = 1
-NOISALIST = 1
-CONFIGURE_ARGS = $(DIRPATHS)
+CONFIGURE_ARGS	=	$(DIRPATHS)
+CONFIGURE_ARGS	+=	--enable-64-bit-bfd
+CONFIGURE_ARGS	+=	--enable-tui
+CONFIGURE_ARGS	+=	--with-curses
+CONFIGURE_ARGS	+=	--with-expat
+CONFIGURE_ARGS	+=	--with-python
+# private TCL headers not being installed
+# (https://www.opencsw.org/mantis/view.php?id=4652)
+#CONFIGURE_ARGS	+=	--enable-gdbtk
+#CONFIGURE_ARGS	+=	--with-tcl=/opt/csw/lib
+#CONFIGURE_ARGS	+=	--with-tk=/opt/csw/lib
+CONFIGURE_ARGS	+=	--with-x
 
+RUNTIME_DEP_PKGS	+=	CSWlibexpat1
+RUNTIME_DEP_PKGS	+=	CSWlibiconv2
+RUNTIME_DEP_PKGS	+=	CSWlibintl8
+RUNTIME_DEP_PKGS	+=	CSWlibncurses5
+RUNTIME_DEP_PKGS	+=	CSWlibpython2-6-1-0
+RUNTIME_DEP_PKGS	+=	CSWlibz1
+
 include gar/category.mk
 
-# Needed for testing
-PATH := $(PATH):/opt/csw/gcc4/bin
+PATH := /opt/csw/gnu:/opt/csw/libexec/flex-2.5.35/bin:$(PATH)
+
+# this is private and not available publicly
+mydependencies:
+	for package in $(PACKAGES); do echo '___' $${package}; $(HOME)/bin/ocswdeplist --depth 1 --dependencies --packaging --csw --prototype $(HOME)/opencsw/$(NAME)/trunk/work/build-global/$${package}.prototype --target $(HOME)/opencsw/$(NAME)/trunk/work/pkgroot; done

Modified: csw/mgar/pkg/gdb/trunk/checksums
===================================================================
--- csw/mgar/pkg/gdb/trunk/checksums	2012-07-21 16:02:28 UTC (rev 18828)
+++ csw/mgar/pkg/gdb/trunk/checksums	2012-07-23 06:56:03 UTC (rev 18829)
@@ -1,3 +1 @@
-c9da266b884fb8fa54df786dfaadbc7a  gdb-6.8.tar.bz2
-0e2918ca6429132ec762588dc722f6d0  gdb.auxv.patch
-d10a6f2ec5eaced8a9ae908b2d5e1d3e  gdb.solib-svr4.patch
+5fb7fca9ef7a9e3cfee0e2f2c0e52051  gdb-7.4.1.tar.gz

Added: csw/mgar/pkg/gdb/trunk/files/0001-OpenSolaris-gdb-solib-svr4.patch
===================================================================
--- csw/mgar/pkg/gdb/trunk/files/0001-OpenSolaris-gdb-solib-svr4.patch	                        (rev 0)
+++ csw/mgar/pkg/gdb/trunk/files/0001-OpenSolaris-gdb-solib-svr4.patch	2012-07-23 06:56:03 UTC (rev 18829)
@@ -0,0 +1,28 @@
+From 40c7d0836f4433f9908ffa814fb67507cee07051 Mon Sep 17 00:00:00 2001
+From: Peter Felecan <pfelecan at opencsw.org>
+Date: Fri, 20 Jul 2012 15:47:41 +0200
+Subject: [PATCH] OpenSolaris gdb solib svr4
+
+---
+ gdb/solib-svr4.c |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
+index 69d3cb5..640ef70 100644
+--- a/gdb/solib-svr4.c
++++ b/gdb/solib-svr4.c
+@@ -130,6 +130,11 @@ svr4_same_1 (const char *gdb_so_name, const char *inferior_so_name)
+   if (strcmp (gdb_so_name, "/usr/lib/sparcv9/ld.so.1") == 0
+       && strcmp (inferior_so_name, "/lib/sparcv9/ld.so.1") == 0)
+     return 1;
++  /* Similarly, we observed the same issue with amd64, but with
++     different locations.  */
++  if (strcmp (gdb_so_name, "/usr/lib/amd64/ld.so.1") == 0
++      && strcmp (inferior_so_name, "/lib/amd64/ld.so.1") == 0)
++    return 1;
+ 
+   return 0;
+ }
+-- 
+1.7.10.3
+

Added: csw/mgar/pkg/gdb/trunk/files/0002-OpenSolaris-gdb-fork-child.patch
===================================================================
--- csw/mgar/pkg/gdb/trunk/files/0002-OpenSolaris-gdb-fork-child.patch	                        (rev 0)
+++ csw/mgar/pkg/gdb/trunk/files/0002-OpenSolaris-gdb-fork-child.patch	2012-07-23 06:56:03 UTC (rev 18829)
@@ -0,0 +1,87 @@
+From 8a377eecfc6cd2ee3fc1cf1cccc6614917306555 Mon Sep 17 00:00:00 2001
+From: Peter Felecan <pfelecan at opencsw.org>
+Date: Fri, 20 Jul 2012 15:56:22 +0200
+Subject: [PATCH] OpenSolaris gdb fork child
+
+---
+ gdb/fork-child.c |   37 +++++++++++++++++++++++++++++++++++++
+ 1 file changed, 37 insertions(+)
+
+diff --git a/gdb/fork-child.c b/gdb/fork-child.c
+index cba91f9..8a45a62 100644
+--- a/gdb/fork-child.c
++++ b/gdb/fork-child.c
+@@ -43,6 +43,16 @@ extern char **environ;
+ 
+ static char *exec_wrapper;
+ 
++/* On Solaris, the SHELL may be a hard link to /usr/lib/isaexec.
++   If so, there will be one more exec trap to skip while starting
++   the inferior.  */
++
++#include <fcntl.h>
++#include <sys/types.h>
++#include <sys/stat.h>
++
++static int isaexec_shell;
++
+ /* Break up SCRATCH into an argument vector suitable for passing to
+    execvp and store it in ARGV.  E.g., on "run a b c d" this routine
+    would get as input the string "a b c d", and as output it would
+@@ -144,6 +154,8 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
+   int i;
+   int save_errno;
+ 
++  isaexec_shell = 0;  /* Solaris only */
++
+   /* If no exec file handed to us, get it from the exec-file command
+      -- with a good, common error message if none is specified.  */
+   exec_file = exec_file_arg;
+@@ -156,12 +168,34 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
+   shell_file = shell_file_arg;
+   if (STARTUP_WITH_SHELL)
+     {
++      /* Solaris only, is the shell a hard link to isaexec?  */
++      struct stat buf1, buf2;
++
+       /* Figure out what shell to start up the user program under.  */
+       if (shell_file == NULL)
+ 	shell_file = getenv ("SHELL");
+       if (shell_file == NULL)
+ 	shell_file = default_shell_file;
+       shell = 1;
++
++      /* Solaris only, is the shell a hard link to isaexec?
++	 If either stat call fails or the user's shell is
++	 not linked to isaexec, proceed with gdb's normal
++	 behavior, i.e. do not skip an extra exec.
++
++	 Assume that two files are the same if their inode
++	 numbers, device numbers, and number of links match.
++	 Is it possible to get a false positive if the shell
++	 and isaexec are located on different file systems?  */
++      if (
++	stat ("/usr/lib/isaexec", &buf1) == 0 &&
++	stat (shell_file, &buf2) == 0 &&
++	buf1.st_ino == buf2.st_ino &&
++	buf1.st_dev == buf2.st_dev &&
++	buf1.st_nlink == buf2.st_nlink
++      ) {
++	isaexec_shell = 1;
++      }
+     }
+ 
+   if (!shell)
+@@ -425,6 +459,9 @@ startup_inferior (int ntraps)
+   else
+     resume_ptid = minus_one_ptid;
+ 
++  /* Solaris only, increment ntraps if shell is isaexec'ed.  */
++  pending_execs += isaexec_shell;
++
+   /* The process was started by the fork that created it, but it will
+      have stopped one instruction after execing the shell.  Here we
+      must get it up to actual execution of the real program.  */
+-- 
+1.7.10.3
+

Added: csw/mgar/pkg/gdb/trunk/files/0003-Extend-to-OpenCSW-the-OpenSolaris-gdb-fork-child.patch
===================================================================
--- csw/mgar/pkg/gdb/trunk/files/0003-Extend-to-OpenCSW-the-OpenSolaris-gdb-fork-child.patch	                        (rev 0)
+++ csw/mgar/pkg/gdb/trunk/files/0003-Extend-to-OpenCSW-the-OpenSolaris-gdb-fork-child.patch	2012-07-23 06:56:03 UTC (rev 18829)
@@ -0,0 +1,33 @@
+From 0b22de02c702dd00ce3b2ce56651a60cb46cf00c Mon Sep 17 00:00:00 2001
+From: Peter Felecan <pfelecan at opencsw.org>
+Date: Fri, 20 Jul 2012 16:04:02 +0200
+Subject: [PATCH] Extend to OpenCSW the OpenSolaris gdb fork child
+
+---
+ gdb/fork-child.c |   10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/gdb/fork-child.c b/gdb/fork-child.c
+index 8a45a62..18c0d2c 100644
+--- a/gdb/fork-child.c
++++ b/gdb/fork-child.c
+@@ -196,6 +196,16 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
+       ) {
+ 	isaexec_shell = 1;
+       }
++	  /* do the same for Open CSW: */
++      if (
++	stat ("/opt/csw/bin/isaexec", &buf1) == 0 &&
++	stat (shell_file, &buf2) == 0 &&
++	buf1.st_ino == buf2.st_ino &&
++	buf1.st_dev == buf2.st_dev &&
++	buf1.st_nlink == buf2.st_nlink
++      ) {
++	isaexec_shell = 1;
++      }
+     }
+ 
+   if (!shell)
+-- 
+1.7.10.3
+

Deleted: csw/mgar/pkg/gdb/trunk/files/gdb.auxv.patch
===================================================================
--- csw/mgar/pkg/gdb/trunk/files/gdb.auxv.patch	2012-07-21 16:02:28 UTC (rev 18828)
+++ csw/mgar/pkg/gdb/trunk/files/gdb.auxv.patch	2012-07-23 06:56:03 UTC (rev 18829)
@@ -1,81 +0,0 @@
---- 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);
- 

Deleted: csw/mgar/pkg/gdb/trunk/files/gdb.solib-svr4.patch
===================================================================
--- csw/mgar/pkg/gdb/trunk/files/gdb.solib-svr4.patch	2012-07-21 16:02:28 UTC (rev 18828)
+++ csw/mgar/pkg/gdb/trunk/files/gdb.solib-svr4.patch	2012-07-23 06:56:03 UTC (rev 18829)
@@ -1,15 +0,0 @@
---- 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