Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Mar 2014 19:48:45 +0000 (UTC)
From:      Cy Schubert <cy@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r349283 - in head/devel/xxgdb: . files
Message-ID:  <201403261948.s2QJmjwq054508@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cy
Date: Wed Mar 26 19:48:45 2014
New Revision: 349283
URL: http://svnweb.freebsd.org/changeset/ports/349283
QAT: https://qat.redports.org/buildarchive/r349283/

Log:
  Fix:
   - pty creation
   - segmentation violations
   - bus errors
   - alternate gdb invocation (prompt through environment)
  
  Stagify.

Added:
  head/devel/xxgdb/files/patch-xdbx.c   (contents, props changed)
  head/devel/xxgdb/files/patch-xxgdb.man   (contents, props changed)
Modified:
  head/devel/xxgdb/Makefile
  head/devel/xxgdb/files/patch-ab
  head/devel/xxgdb/files/patch-ac
  head/devel/xxgdb/pkg-plist

Modified: head/devel/xxgdb/Makefile
==============================================================================
--- head/devel/xxgdb/Makefile	Wed Mar 26 19:39:41 2014	(r349282)
+++ head/devel/xxgdb/Makefile	Wed Mar 26 19:48:45 2014	(r349283)
@@ -3,7 +3,7 @@
 
 PORTNAME=	xxgdb
 PORTVERSION=	1.12
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	devel
 MASTER_SITES=	${MASTER_SITE_XCONTRIB}
 MASTER_SITE_SUBDIR=	utilities
@@ -13,17 +13,15 @@ COMMENT=	X window interface for gdb
 
 USES=		imake
 USE_XORG=	ice sm x11 xaw xext xmu xt
-MAN1=		xxgdb.1
 
 # This isn't included in the original Imakefile for some reason.
 #  Yes, I know this will recompile the program every time, but
 #  we have the cookie anyway and it's much easier this way
 #  than modifying the Imakefile.
-NO_STAGE=	yes
 post-build:
 	cd ${WRKSRC} && ${CC} ${CFLAGS} -o xxgdbiowin xxgdbiowin.c
 
 post-install:
-	${INSTALL_PROGRAM} ${WRKSRC}/xxgdbiowin ${PREFIX}/bin
+	${INSTALL_PROGRAM} ${WRKSRC}/xxgdbiowin ${STAGEDIR}${PREFIX}/bin
 
 .include <bsd.port.mk>

Modified: head/devel/xxgdb/files/patch-ab
==============================================================================
--- head/devel/xxgdb/files/patch-ab	Wed Mar 26 19:39:41 2014	(r349282)
+++ head/devel/xxgdb/files/patch-ab	Wed Mar 26 19:48:45 2014	(r349283)
@@ -1,6 +1,14 @@
---- Imakefile.orig	Tue Jun 20 07:20:55 1995
-+++ Imakefile	Fri Nov 17 21:27:09 2000
-@@ -79,6 +79,10 @@
+--- Imakefile.orig	1995-06-19 15:20:55.000000000 -0700
++++ Imakefile	2014-03-25 21:44:23.829815727 -0700
+@@ -8,6 +8,7 @@
+ #endif
+ 
+ #CC = gcc
++CCOPTIONS=-O0
+ 
+ #if mc68000			/* for SUN 3 */
+ CCOPTIONS=-m68881
+@@ -79,11 +80,15 @@
  # Add to open all windows at startup
  #DEFINES+=-DOPEN_ALL_WINDOWS
  
@@ -11,3 +19,9 @@
  mallocc = #malloc.c
  malloco = #malloc.o
  
+         DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
+-LOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
++LOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB) -lutil
+ 
+            SRCS = calldbx.c command.c dbx.c dialog.c datadpy.c filemenu.c \
+ 		  handler.c parser.c regex.c signs.c signals.c source.c \

Modified: head/devel/xxgdb/files/patch-ac
==============================================================================
--- head/devel/xxgdb/files/patch-ac	Wed Mar 26 19:39:41 2014	(r349282)
+++ head/devel/xxgdb/files/patch-ac	Wed Mar 26 19:48:45 2014	(r349283)
@@ -1,6 +1,6 @@
---- calldbx.c.orig	Tue Jun 20 07:11:00 1995
-+++ calldbx.c	Fri Nov 17 21:27:09 2000
-@@ -74,8 +74,8 @@
+--- calldbx.c.orig	1995-06-19 15:11:00.000000000 -0700
++++ calldbx.c	2014-03-26 12:20:00.741924675 -0700
+@@ -74,8 +74,16 @@
  #include <string.h>
  #include <fcntl.h>
  #include "global.h"
@@ -8,10 +8,26 @@
 -#include <termio.h>
 +#if !(defined(OLDSUNOS) || defined(BSD)) || defined(__FreeBSD__)
 +#include <termios.h>
++#include <sys/param.h>
++#if defined(__FreeBSD_version) && __FreeBSD_version >= 900007
++#define NEW_FREEBSD_PTYS
++#include <sys/types.h>
++#include <sys/ioctl.h>
++#include <termios.h>
++#include <libutil.h>
++#endif
  #else
  #include <sgtty.h>
  #endif
-@@ -137,13 +137,17 @@
+@@ -116,6 +124,7 @@
+ char            iowintty[] = "/dev/ttyp0";
+ int             iowinpid = 0;
+ #endif /* CREATE_IO_WINDOW */
++#ifndef NEW_FREEBSD_PTYS
+ /*
+  *  Xdbx talks to dbx through a pseudo terminal which is a pair of master
+  *  and slave devices: /dev/pty?? and /dev/tty??, where ?? goes from p0 to
+@@ -137,13 +146,17 @@
  
  #ifndef sco
  	for (c='p'; c<'t'; c++) {
@@ -30,7 +46,15 @@
  	    if ((master = open(pty, O_RDWR)) >= 0) 
  		return (master); 
  	}
-@@ -246,8 +250,8 @@
+@@ -194,6 +207,7 @@
+     return slave;
+ #endif /* SVR4 */
+ }
++#endif /* NEW_FREEBSD_PTYS */
+ 
+ #ifdef CREATE_IO_WINDOW 
+ /* use a separate io window to talk to gdb, so program output is not confused with gdb output. */
+@@ -246,8 +260,8 @@
  /*
   * (JBL)10MAY91 : use sgttyb if generic BSD
   */
@@ -41,7 +65,62 @@
  #else
      struct sgttyb Termio;
  #endif
-@@ -355,11 +359,11 @@
+@@ -261,8 +275,10 @@
+ 
+ #ifdef GDB	/* for GDB, we use XXGDB_DEBUGGER instead */
+     debugger = (char *) getenv("XXGDB_DEBUGGER");	/* first looks up env var */
++    dbxprompt = (char *) getenv("XXGDB_DBXPROMPT");	/* first looks up env var */
+ #else
+     debugger = (char *) getenv("DEBUGGER");	/* first looks up env var */
++    dbxprompt = (char *) getenv("DBXPROMPT");	/* first looks up env var */
+ #endif
+ 
+ /* CRL mod 4 3/15/91 GWC if no env var then try app res for db_name */
+@@ -275,7 +291,8 @@
+ 	debugger  = XtNewString(DEBUGGER);
+ 
+ /* CRL mod 4 3/15/91 GWC -  allow the user to specify a db_prompt */
+-    if (app_resources.db_prompt &&
++    if (dbxprompt == NULL &&
++	app_resources.db_prompt &&
+ 	strcmp(app_resources.db_prompt, "") != 0)
+ 	dbxprompt = XtNewString(app_resources.db_prompt);
+   
+@@ -288,7 +305,15 @@
+ 	if (debug)
+ 		fprintf(stderr,"debugger=\"%s\"\nprompt=\"%s\"\n",debugger,dbxprompt);
+   
++#ifdef NEW_FREEBSD_PTYS
++    if (openpty(&master, &slave, NULL, NULL, NULL) == -1) {
++	sprintf(errmsg,"%s error: openpty failed\n");
++	perror(errmsg);
++	exit(1);
++    }
++#else
+     master = open_master();
++#endif
+ 
+     dbxpid = fork();
+     if (dbxpid == -1) {
+@@ -305,6 +330,7 @@
+ 	 *	    set line buffered mode
+ 	 *	    register dbx input with X
+ 	 */
++	close(slave);
+ 	close(0);
+ 	close(1);
+ 
+@@ -345,7 +371,9 @@
+ 	}
+ #endif
+ 
++#ifndef NEW_FREEBSD_PTYS
+ 	slave = open_slave(master);
++#endif
+ 	close(master);
+ 
+ 	/*
+@@ -355,11 +383,11 @@
  	/*
  	 * (JBL)10MAY91 : use sgttyb if OLDSUN or generic BSD
  	 */ 

Added: head/devel/xxgdb/files/patch-xdbx.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/xxgdb/files/patch-xdbx.c	Wed Mar 26 19:48:45 2014	(r349283)
@@ -0,0 +1,14 @@
+--- xdbx.c.orig	1995-04-20 19:37:31.000000000 -0700
++++ xdbx.c	2014-03-25 20:54:19.951463142 -0700
+@@ -74,11 +74,9 @@
+ #define XGDBVERSION	"1.12"
+ #endif
+ 
+-#ifdef SYSV 
+ #   include <stdio.h>
+ #   include <stdlib.h>
+ #   include <sys/param.h>
+-#endif
+ 
+ #include "global.h"
+ #include "bitmaps.h"

Added: head/devel/xxgdb/files/patch-xxgdb.man
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/xxgdb/files/patch-xxgdb.man	Wed Mar 26 19:48:45 2014	(r349283)
@@ -0,0 +1,12 @@
+--- xxgdb.man.orig	1994-12-02 17:40:19.000000000 -0800
++++ xxgdb.man	2014-03-26 12:27:51.559896216 -0700
+@@ -29,7 +29,8 @@
+ .LP
+ The name of the debugger invoked by \fIxxgdb\fP is, by default, gdb, but
+ it can be overridden with the environment variable XXGDB_DEBUGGER or with
+-the db_name option.
++the db_name option. Additionally, the prompt string can be overridden with
++the environment variable XXGDB_DBXPROMPT or with the db_prompt option.
+ .SH OPTIONS
+ \fIXxgdb\fP accepts all of the standard X Toolkit command line options 
+ (see \fIX\fP(1)), and all the gdb options (see \fIgdb\fP(1)), plus

Modified: head/devel/xxgdb/pkg-plist
==============================================================================
--- head/devel/xxgdb/pkg-plist	Wed Mar 26 19:39:41 2014	(r349282)
+++ head/devel/xxgdb/pkg-plist	Wed Mar 26 19:48:45 2014	(r349283)
@@ -1,3 +1,4 @@
 bin/xxgdb
 bin/xxgdbiowin
 lib/X11/app-defaults/XDbx
+man/man1/xxgdb.1.gz



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403261948.s2QJmjwq054508>