v12i078: xxgdb - X front end for gdb, Patch1, Part01/01

Pierre Willard pierre at tce.com
Fri May 3 16:47:19 AEST 1991


Submitted-by: pierre at tce.com (Pierre Willard)
Posting-number: Volume 12, Issue 78
Archive-name: xxgdb/patch1
Patch-To: xxgdb: Volume 11, Issue 42-55


	XXGDB version 1.03 ( X window interface to the GDB debugger )
	-------------------------------------------------------------

A little while ago (January 91) I posted the complete source files
for xxgdb version 1.01.

Please find in the following the differences from version
1.01 to 1.03.

Please post this complete message to comp.sources.x


NEW FEATURES OF VERSION 1.03  :

	Add source files selection in file button.
	Special test for core file in file button.
	Fix bug includeDir resource.
	Fix bug source file directories.
	Add patches for SUN-OS3.
	Add strstr function in gdb_parser.c (with #ifdef NEED_STRSTR)
	Remove bad test for MIPS and BSD in case of GDB.
	Miscellaneous patches for lint.
	Port to SYSV + SCO +SYSV32.
	Fix bug up/down/frame when arguments are on several lines.
	Fix bug in UpdateMessageWindow when arguments are too long.
	Fix bug define commands in .gdbinit or source files
	Add db_name and db_prompt option (GWC)
	and miscellaneous bugs.

TO PATCH XXGDB FROM VERSION 1.01 TO VERSION 1.03 :

	cd <original xxgdb 1.01 source directory>
	chmod +rw *
	patch < <patch_file>
	
THE FOLLOWING IS THE PATCH FILE FOR XXGDB 1.03 FROM XXGDB 1.01 :

diff -rc2 v1.01/Imakefile v1.03/Imakefile
*** v1.01/Imakefile	Tue Jan 15 11:18:58 1991
--- v1.03/Imakefile	Tue Apr  2 09:33:13 1991
***************
*** 8,14 ****
  #endif
  
! #if defined(SunArchitecture) && OSMajorVersion >= 4
!         DEFINES = -DSUNOS4 $(DEFGDB)
  #endif
  
  #ifdef UltrixArchitecture
--- 8,18 ----
  #endif
  
! #if defined(SunArchitecture)
! #if OSMajorVersion >= 4
! 	DEFINES = -DSUNOS4 $(DEFGDB)
! #else
! 	DEFINES = -DOLDSUNOS -DNEED_STRSTR $(DEFGDB)
  #endif
+ #endif
  
  #ifdef UltrixArchitecture
***************
*** 20,23 ****
--- 24,30 ----
  #endif
  
+ mallocc = #malloc.c
+ malloco = #malloc.o
+ 
          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  LOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
***************
*** 25,33 ****
             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 \
! 		  utils.c windows.c xdbx.c
  
             OBJS = calldbx.o command.o dbx.o dialog.o datadpy.o filemenu.o \
  		  handler.o parser.o regex.o signs.o signals.o source.o \
! 		  utils.o windows.o xdbx.o
  
  #if TARGET_IS_GDB
--- 32,40 ----
             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 \
! 		  utils.c windows.c xdbx.c $(mallocc)
  
             OBJS = calldbx.o command.o dbx.o dialog.o datadpy.o filemenu.o \
  		  handler.o parser.o regex.o signs.o signals.o source.o \
! 		  utils.o windows.o xdbx.o $(malloco)
  
  #if TARGET_IS_GDB
diff -rc2 v1.01/Makefile v1.03/Makefile
*** v1.01/Makefile	Tue Jan 15 11:18:58 1991
--- v1.03/Makefile	Tue Apr  2 09:35:10 1991
***************
*** 228,233 ****
  DEFGDB =  -DGDB -g
  
!         DEFINES = -DSUNOS4 $(DEFGDB)
  
          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  LOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
--- 228,236 ----
  DEFGDB =  -DGDB -g
  
! 	DEFINES = -DSUNOS4 $(DEFGDB)
  
+ mallocc = #malloc.c
+ malloco = #malloc.o
+ 
          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  LOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
***************
*** 235,243 ****
             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 \
! 		  utils.c windows.c xdbx.c
  
             OBJS = calldbx.o command.o dbx.o dialog.o datadpy.o filemenu.o \
  		  handler.o parser.o regex.o signs.o signals.o source.o \
! 		  utils.o windows.o xdbx.o
  
   PROGRAM = xxgdb
--- 238,246 ----
             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 \
! 		  utils.c windows.c xdbx.c $(mallocc)
  
             OBJS = calldbx.o command.o dbx.o dialog.o datadpy.o filemenu.o \
  		  handler.o parser.o regex.o signs.o signals.o source.o \
! 		  utils.o windows.o xdbx.o $(malloco)
  
   PROGRAM = xxgdb
diff -rc2 v1.01/XXGDB_README v1.03/XXGDB_README
*** v1.01/XXGDB_README	Tue Jan 15 12:34:20 1991
--- v1.03/XXGDB_README	Tue Apr 16 09:03:21 1991
***************
*** 57,60 ****
--- 57,94 ----
   *  XXGDB Created:   	December, 1990
   *
+  *****************************************************************************
+  *
+  *  Modifications for use under System V
+  *
+  *      Copyright 1990 Bull Worldwide Information Systems, Inc.
+  *
+  *  Permission to use, copy, modify, and distribute this software and its
+  *  documentation for any purpose and without fee is hereby granted,
+  *  provided that the above copyright notice appear in all copies and that
+  *  both that copyright notice and this permission notice appear in
+  *  supporting documentation, and that the name of Bull Worldwide
+  *  Information Systems not be used in advertising or publicity pertaining
+  *  to distribution of the software without specific, written prior
+  *  permission.  Bull makes no representations about the suitability of
+  *  this software for any purpose.  It is provided "as is" without express
+  *  or implied warranty.
+  *
+  *  BULL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+  *  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
+  *  SHALL BULL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
+  *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+  *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+  *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+  *  SOFTWARE.
+  *
+  *  Adaptation to SYSV: James Tsillas
+  *                      March, 1991
+  *
+  *****************************************************************************
+  *
+  *	Note that this software uses some files which are 
+  *  Copyright (C) 1985 Free Software Foundation, Inc.
+  *	See copyright header in regex.c and regex.h.
+  *
   *****************************************************************************/
  
***************
*** 74,79 ****
  	Thomson Consumer Electronics, Inc.
  
! XXGDB version 1.0
! -----------------
  
  	>> SEE ALSO XDBX DOCUMENTATION <<
--- 108,113 ----
  	Thomson Consumer Electronics, Inc.
  
! XXGDB version 1.03
! ------------------
  
  	>> SEE ALSO XDBX DOCUMENTATION <<
***************
*** 89,97 ****
  	See the XDBX_README file for more information on XDBX.
  	
! 	XXGDB has been tested on SUN 4 running OS 4.1
! 		
! 	- The name of the debugger called by xxgdb is by default 'gdb'.
! 	It can be overridden with the environment variable XXGDB_DEBUGGER.
  	
  	- XXGDB changes the GDB default 'set prettyprint' to ON. This is
  	necessary to be able to display the pointed object when clicking
--- 123,141 ----
  	See the XDBX_README file for more information on XDBX.
  	
! 	XXGDB has been originally tested on SUN 4 running OS 4.1.
! 	It should also run on SUN OS3.
  	
+     Also, any System V should be able to build by setting the -DSYSV flag.
+     SCO Unix also requires the -Dsco flag. Bull DPX/2 [23]00 requires the
+     -Dncl_mr flag as well as -DSYSV. Some systems may also need to set
+     -DUSG to use the GNU malloc instead of the native one. The GNU malloc
+     works much quicker and is much more reliable. SCO Unix requires GNU
+     malloc to work correctly. GNU malloc is not provided here, you should
+     get malloc.c and getpagesize.h from the source of gdb.
+ 
+     Also note that if building on SCO you must also link with -lsocket
+     and if building on DPX/2 you must also link with -linet. You will need
+     the R4 release of X11 for both.
+ 			
  	- XXGDB changes the GDB default 'set prettyprint' to ON. This is
  	necessary to be able to display the pointed object when clicking
***************
*** 105,109 ****
  	listed line and will make sure that this last line is visible
  	in the source window.
! 		
  	To build xxgdb, 'Imakefile' defines :
  	
--- 149,185 ----
  	listed line and will make sure that this last line is visible
  	in the source window.
! 	
! 	- The file button will execute 'core-file <filename>' if the file
! 	is named 'core', 'list <filename>:1' if the file is not executable
! 	and 'exec-file <filename> symbol-file <filename> if the file
! 	is executable. Executable files are displayed with a trailing '*'
! 	character.
! 	
! 	- For systems which do not have the ANSI strstr function in their
! 	library, one is included in gdb_parser.c and is compiled if NEED_STRSTR
! 	is defined.
! 	
! 	- if you define UNDISPWIN when compiling, then the display window
! 	will disappear when there is nothing to display.
! 	(eg, add -DUNDISPWIN in DEFGDB definition in Imakefile).
! 	See display_info_handler function in gdb_handler.c
! 	
! 	- The name of the debugger called by xxgdb is by default 'gdb'.
! 	It can be overridden with the environment variable XXGDB_DEBUGGER.
! 	
! 	- DO NOT modify the gdb prompt (using the 'set prompt' command).
! 	XXGDB assumes that the gdb prompt is 'gdb' or the XXGDB_DEBUGGER
! 	environment variable if defined.
! 	
! 	There are two new application resources and command line args:
!    	 - db_name can be used to specify the name of the debugger to
!      override the default "gdb" (instead of using an env. variable).
!      - db_prompt can be used to specify to xgdb the string to be used by
!      the debugger as a prompt.  The default is to expect the prompt
!      used by the debugger to be the name of the debugger enclosed in
!      parenthesis.   This is no good for gdbvx, which expects a prompt
!      of (gdb).
! 
! 
  	To build xxgdb, 'Imakefile' defines :
  	
***************
*** 117,121 ****
  The following bugs will probably be fixed in future versions.
  
! 	- 'define' command of GDB is NOT supported by xxgdb.
  	
  	- 'source' command of XXGDB behaves slighlty differently from 
--- 193,199 ----
  The following bugs will probably be fixed in future versions.
  
! 	- 'define' command of GDB is not completely supported by xxgdb
! 		because xxgdb does not interpret what the defined commands
! 		do.
  	
  	- 'source' command of XXGDB behaves slighlty differently from 
***************
*** 136,145 ****
  XXGDB history
  -------------
! 
  	1.0		December 1990.
! 	1.01	January 1991.
  				Fix bug with display command (when displaying structures).
  				Fix bug with undisplay command (display window went blank).
  				Add XXGDB no warranty message at start-up.
  
  				--------------------------
--- 214,246 ----
  XXGDB history
  -------------
! 	
  	1.0		December 1990.
! 	1.01	January 1991 (posted to comp.sources.x news group)
  				Fix bug with display command (when displaying structures).
  				Fix bug with undisplay command (display window went blank).
  				Add XXGDB no warranty message at start-up.
+ 	1.02	February 1991.
+ 				Add source files selection in file button.
+ 				Special test for core file in file button.
+ 				Fix bug includeDir resource.
+ 				Fix bug source file directories.
+ 				Add patches for SUN-OS3.
+ 				Add strstr function in gdb_parser.c (with #ifdef NEED_STRSTR)
+ 				Remove bad test for MIPS and BSD in case of GDB.
+ 	1.03	April 1991
+ 				Miscellaneous patches for lint.
+ 				Port to SYSV + SCO +SYSV32.
+ 				Fix bug up/down/frame when arguments are on several lines.
+ 				Fix bug in UpdateMessageWindow when arguments are too long.
+ 				Fix bug define commands in .gdbinit or source files
+ 				Add db_name and db_prompt option (GWC)
+ 				
  
+ Acknowledgement
+ ---------------
+ 
+ 	Thanks to Guy Cherry (GWC) for his numerous bug reports and
+ 	suggestions, and to all of you who helped improve xxgdb.
+ 	
  				--------------------------
+ 
diff -rc2 v1.01/calldbx.c v1.03/calldbx.c
*** v1.01/calldbx.c	Tue Jan 15 11:19:00 1991
--- v1.03/calldbx.c	Fri Apr 19 15:55:06 1991
***************
*** 69,78 ****
--- 69,93 ----
   */
  
+ #ifdef OLDSUNOS
+ #include	<sys/ioctl.h>
+ #else
  #include	<termio.h>
+ #endif
+ 
  #include	"global.h"
  
+ #ifdef SYSV 
+ #ifdef sco
+ #  include	<sys/fcntl.h>
+ #endif
+ #endif
+ 
  FILE   	    	*dbxfp = NULL;		/* file pointer to dbx */
  int    	    	dbxpid = 0;		/* dbx process id */
  
+ #ifdef SYSV
+ char            dbxfbuf[BUFSIZ];        
+ #endif
+ 
  static int	dbxInputId;		/* dbx input id */
  static char 	pty[11] = "/dev/pty??";	/* master side of pseudo-terminal */
***************
*** 90,101 ****
      char c;
  
!     for (c='p'; c<='s'; c++) {
! 	pty[8] = c;
  	for (i=0; i<16; i++) {
  	    pty[9] = "0123456789abcdef"[i];
! 	    if ((master = open(pty, O_RDWR)) != -1) 
  		return (master); 
  	}
!     }
  #ifdef GDB
      fprintf(stderr, "xxgdb: all ptys in use\n");
--- 105,124 ----
      char c;
  
! #ifndef sco
! 	for (c='p'; c<'t'; c++) {
  	for (i=0; i<16; i++) {
+ #else
+ 	c = 'p';
+ 	for (i=0; i<8; i++) {
+ #endif
+ 	    pty[8] = c;
  	    pty[9] = "0123456789abcdef"[i];
! 	    if ((master = open(pty, O_RDWR)) >= 0) 
  		return (master); 
  	}
! #ifndef sco
! 	}
! #endif
! 
  #ifdef GDB
      fprintf(stderr, "xxgdb: all ptys in use\n");
***************
*** 112,116 ****
      tty[8] = pty[8];
      tty[9] = pty[9];
!     if ((slave = open(tty, O_RDWR)) != -1)
  	return (slave);
      fprintf(stderr, "open: cannot open slave pty %s", tty);
--- 135,139 ----
      tty[8] = pty[8];
      tty[9] = pty[9];
!     if ((slave = open(tty, O_RDWR)) >= 0)
  	return (slave);
      fprintf(stderr, "open: cannot open slave pty %s", tty);
***************
*** 123,127 ****
--- 146,154 ----
  char *argv[];
  {
+ #ifndef OLDSUNOS
      struct termio Termio;
+ #else
+     struct sgttyb Termio;
+ #endif
      int  	  master;		/* file descriptor of master pty */
      int  	  slave; 		/* file descriptor of slave pty */
***************
*** 137,142 ****
      debugger = (char *) getenv("DEBUGGER");	/* first looks up env var */
  #endif
      if (debugger == NULL)
! 	debugger = XtNewString(DEBUGGER);
    
      /* construct dbx prompt string based on the name of debugger invoked */
--- 164,181 ----
      debugger = (char *) getenv("DEBUGGER");	/* first looks up env var */
  #endif
+ 
+ /* CRL mod 4 3/15/91 GWC if no env var then try app res for db_name */
+     if (debugger == NULL &&
+ 	app_resources.db_name &&
+ 	strcmp(app_resources.db_name, "") != NULL)
+ 	debugger =  XtNewString(app_resources.db_name);
+       
      if (debugger == NULL)
! 	debugger  = XtNewString(DEBUGGER);
! 
! /* CRL mod 4 3/15/91 GWC -  allow the user to specify a db_prompt */
!     if (app_resources.db_prompt &&
! 	strcmp(app_resources.db_prompt, "") != NULL)
! 	dbxprompt = XtNewString(app_resources.db_prompt);
    
      /* construct dbx prompt string based on the name of debugger invoked */
***************
*** 152,156 ****
--- 191,197 ----
       */
      if ((fd = open("/dev/tty", O_RDWR)) > 0) {
+ #ifndef SYSV 
  	ioctl(fd, TIOCNOTTY, 0);
+ #endif /* SYSV */
  	close(fd);
      }
***************
*** 157,161 ****
--- 198,205 ----
  
      master = open_master();
+     
+ #ifndef SYSV 
      slave = open_slave();
+ #endif
  
      dbxpid = fork();
***************
*** 181,186 ****
  	close(1);
  	fcntl(master, F_SETFL, FNDELAY);
!     	dbxfp = fdopen(master, "r+");
! 	setlinebuf(dbxfp);
  	dbxInputId = XtAppAddInput(app_context, master, XtInputReadMask, 
  				   read_dbx, NULL);
--- 225,242 ----
  	close(1);
  	fcntl(master, F_SETFL, FNDELAY);
! 	
! 	dbxfp = fdopen(master, "r+");
!     
!     /* (PW)10APR91 : I use 'setvbuf' instead of 'setlinebuf',
!     because I had a problem with 'define' commands in source
!     of gdbinit files. Also for SYSV setvbuf is required. */
!  /*	setlinebuf(dbxfp); */
!    
! #ifdef SYSV
! 	setvbuf(dbxfp, dbxfbuf, _IONBF, BUFSIZ); */
! #else
! 	setvbuf(dbxfp, NULL, _IONBF, 0);
! #endif
! 
  	dbxInputId = XtAppAddInput(app_context, master, XtInputReadMask, 
  				   read_dbx, NULL);
***************
*** 193,196 ****
--- 249,257 ----
  	 *	   exec dbx with arguments
  	 */
+       
+ #ifdef SYSV 
+         setpgrp();
+         slave = open_slave();
+ #endif
  	close(master);
  
***************
*** 198,201 ****
--- 259,264 ----
  	 * Modify local and output mode of slave pty
  	 */
+ 	 
+ #ifndef OLDSUNOS
  	ioctl(slave, TCGETA, &Termio);
  	Termio.c_lflag &= ~ECHO;	/* No echo */
***************
*** 202,205 ****
--- 265,274 ----
  	Termio.c_oflag &= ~ONLCR;	/* Do not map NL to CR-NL on output */
  	ioctl(slave, TCSETA, &Termio);
+ #else
+ 	ioctl(slave, TIOCGETP, &Termio);
+ 	Termio.sg_flags &= ~ECHO;	/* No echo */
+ 	Termio.sg_flags &= ~CRMOD;	/* Do not map NL to CR-NL on output */
+ 	ioctl(slave, TIOCSETP, &Termio);
+ #endif
  
  	dup2(slave, 0);
***************
*** 208,211 ****
--- 277,281 ----
  	if (slave > 2)
  	    close(slave);
+ 	    
  	fcntl(1, F_SETFL, FAPPEND);
  	setbuf(stdout, NULL);
***************
*** 215,218 ****
--- 285,289 ----
  	 * so we can change the group of the terminal.
  	 */
+ #ifndef SYSV
  	ioctl(0, TIOCGPGRP, &pgrp);
  	setpgrp(0, pgrp);
***************
*** 226,229 ****
--- 297,301 ----
  	ioctl(0, TIOCSPGRP, &pid);
  	setpgrp(0, pid);
+ #endif /* not SYSV */
  
  	argv[0] = debugger;
diff -rc2 v1.01/command.c v1.03/command.c
*** v1.01/command.c	Tue Jan 15 11:19:01 1991
--- v1.03/command.c	Fri Apr 12 17:04:49 1991
***************
*** 101,107 ****
--- 101,109 ----
  static char	command[LINESIZ];
  static CommandRec *commandQueue = NULL;
+ #ifndef GDB
  #ifdef BSD
  static char	savedCommand[LINESIZ] = ""; 
  #endif
+ #endif	/* not GDB */
  
  /* ARGSUSED */
***************
*** 328,332 ****
--- 330,338 ----
      XtPointer call_data;
  {
+ #ifdef SYSV 
+     int status;
+ #else
      union wait status;
+ #endif /* SYSV */
  
      write_dbx("quit\n");
***************
*** 333,337 ****
--- 339,347 ----
      XtDestroyApplicationContext(app_context);
      kill(dbxpid, SIGKILL);
+ #ifdef SYSV 
+     waitpid(&status, NULL, WNOHANG);
+ #else
      wait3(&status, WNOHANG, NULL);
+ #endif /* SYSV */
      exit(0);
  }
***************
*** 767,771 ****
--- 777,783 ----
  					  parent, args, n);
      CreateButtons(commandWindow);
+ #ifndef SYSV 
      getwd(cwd);
+ #endif
  }
  
***************
*** 783,786 ****
--- 795,799 ----
      CommandRec *p, *q, *r;
  
+ #ifndef GDB 
  #ifdef BSD 
      /* Save the command if it is not a blank command; else use the 
***************
*** 791,794 ****
--- 804,808 ----
  	strcpy(command, savedCommand);
  #endif
+ #endif	/* not GDB */
  
      p = (CommandRec *)XtNew(CommandRec);
***************
*** 804,807 ****
--- 818,823 ----
      }
      write_dbx(command);
+     
+     Prompt = FALSE;		/* (PW)12APR91 : no more Prompt now. */
  }
  
diff -rc2 v1.01/datadpy.c v1.03/datadpy.c
*** v1.01/datadpy.c	Tue Jan 15 11:19:03 1991
--- v1.03/datadpy.c	Mon Apr 15 09:19:39 1991
***************
*** 74,78 ****
   *   pop_down():	pop down the popup and free storage.
   *   DestroyDataPopup():event handler for destroying a popup, call DeleteList()
!  *			and pop_down().
   *   MovePopup():	Position the popup.
   *   print_handler():	Action handler for displaying pointers and structures.
--- 74,78 ----
   *   pop_down():	pop down the popup and free storage.
   *   DestroyDataPopup():event handler for destroying a popup, call DeleteList()
!  *			and pop_down() (CRL mod 25)
   *   MovePopup():	Position the popup.
   *   print_handler():	Action handler for displaying pointers and structures.
***************
*** 101,105 ****
--- 101,111 ----
  static DataDpyList	*TopParentList = NULL;
  static int		font_height, font_width;
+ 
+ #ifdef OBSOLETE
  static void		DestroyDataPopup();
+ #else
+ /* CRL mod 25 4/12/91 GWC - changed label widget to command widget in popups */
+ static void		DestroyDataCallback();
+ #endif
  
  /* 
***************
*** 287,294 ****
      XtSetArg(args[n], XtNresize, (XtArgVal) False);                    	n++;
      XtSetArg(args[n], XtNjustify, (XtArgVal) XtJustifyCenter);         	n++;
      dataDpy->label = XtCreateManagedWidget("label", labelWidgetClass, 
  	dataDpy->popup, args, n);
!     XtAddEventHandler(dataDpy->label, (EventMask) ButtonPressMask, False, 
  	DestroyDataPopup, dataDpy);
  
      /* Create the text window */
--- 293,310 ----
      XtSetArg(args[n], XtNresize, (XtArgVal) False);                    	n++;
      XtSetArg(args[n], XtNjustify, (XtArgVal) XtJustifyCenter);         	n++;
+ 
+ #ifdef OBSOLETE
      dataDpy->label = XtCreateManagedWidget("label", labelWidgetClass, 
  	dataDpy->popup, args, n);
! /*	GWC says it is better to use ButtonReleaseMask instead of ButtonPressMask.*/
! 	XtAddEventHandler(dataDpy->label, (EventMask) ButtonPressMask, False, 
  	DestroyDataPopup, dataDpy);
+ #else
+ /* CRL mod 25 4/12/91 GWC - changed label widget to command widget in
+ popups */
+ 	dataDpy->label = XtCreateManagedWidget("command", commandWidgetClass, 
+   		dataDpy->popup, args, n);
+     XtAddCallback(dataDpy->label, XtNcallback, DestroyDataCallback, dataDpy);
+ #endif
  
      /* Create the text window */
***************
*** 484,487 ****
--- 500,505 ----
   */
  /* ARGSUSED */
+ 
+ #ifdef OBSOLETE
  static void DestroyDataPopup(w, dataDpy, event)
      Widget w;
***************
*** 488,491 ****
--- 506,516 ----
      DataDpyRec *dataDpy;
      XEvent *event;
+ #else
+ /* CRL mod 25 4/12/91 GWC - changed label widget to command widget */
+ static void DestroyDataCallback(w, dataDpy, call_data)
+     Widget w;
+     DataDpyRec *dataDpy;
+     caddr_t call_data;
+ #endif
  {
      if (!dataDpy->parent)
***************
*** 600,604 ****
      if (Parent)
      	XDefineCursor(display, XtWindow(Parent->dataDpyWindow), watch);
!     UpdateMessageWindow("Click the label to pop down the data popup");
  
      /* Searches the table for an unused or empty slot */
--- 625,629 ----
      if (Parent)
      	XDefineCursor(display, XtWindow(Parent->dataDpyWindow), watch);
!     UpdateMessageWindow("Click the label to pop down the data popup",NULL);
  
      /* Searches the table for an unused or empty slot */
diff -rc2 v1.01/dbx.c v1.03/dbx.c
*** v1.01/dbx.c	Tue Jan 15 11:19:04 1991
--- v1.03/dbx.c	Fri Apr 12 17:05:54 1991
***************
*** 88,117 ****
  char *xdbxinit;
  {
      FILE *fp;
      char s[LINESIZ];
  
      if (strcmp(xdbxinit, "") == NULL)
  	return;
!     if (fp = fopen(xdbxinit, "r")) {
! 	while (fgets(s, LINESIZ, fp)) {
  #ifdef GDB
! 		/* if GDB:
! 			Check for comment line,
! 			DO NOT SEND '\n',
! 			Take care of source command.
! 		*/
! 		if ((*s != '#') && strcmp(s,"\n") && (!gdb_source_command(s,TRUE))) {	
! #endif /* GDB */
! 	    send_command(s);
! 	    AppendDialogText(s);
! 	    Prompt = False;
! 	    while (!Prompt)
! 		read_dbx();
! #ifdef GDB
  		}
- #endif /* GDB */
- 	}
  	close(fp);
      }
  }
  
--- 88,115 ----
  char *xdbxinit;
  {
+ #ifndef GDB
      FILE *fp;
      char s[LINESIZ];
+ #endif /* not GDB */
  
      if (strcmp(xdbxinit, "") == NULL)
  	return;
! 	
  #ifdef GDB
! 
! 	read_source_file(xdbxinit);
! 	
! #else /* not GDB */
!     if (fp = fopen(xdbxinit, "r")) {
! 		while (fgets(s, LINESIZ, fp)) {
! 			send_command(s);
! 			AppendDialogText(s);
! 			Prompt = False;
! 			while (!Prompt)
! 				read_dbx();
  		}
  	close(fp);
      }
+ #endif /* not GDB */
  }
  
***************
*** 219,222 ****
--- 217,221 ----
  }
  
+ #ifdef GDB
  /*  Sends a command to dbx and read the corresponding output, directly
   *  invoking the Xt input procedure, read_dbx().
***************
*** 225,228 ****
--- 224,237 ----
  char *command;
  {
+ 	query_dbx_echo(command, False);
+ }
+ 
+ #else
+ /*  Sends a command to dbx and read the corresponding output, directly
+  *  invoking the Xt input procedure, read_dbx().
+  */
+ void query_dbx(command)
+ char *command;
+ {
      write_dbx(command);
      insert_command(command);
***************
*** 236,237 ****
--- 245,247 ----
      Echo = True;
  }
+ #endif
diff -rc2 v1.01/defs.h v1.03/defs.h
*** v1.01/defs.h	Tue Jan 15 11:19:05 1991
--- v1.03/defs.h	Fri Apr 12 10:06:28 1991
***************
*** 147,150 ****
--- 147,154 ----
      String    prompt;		/* prompt string for xdbx */
  
+ /* CRL mod 4 3/15/91 GWC - added two new app res */
+     String    db_name;  	/* name for dbx child */
+     String    db_prompt;	/* prompt for dbx child */
+ 
      Pixel     stop_color;	/* color of stop sign */
      Pixel     arrow_color;	/* color of arrow sign */
diff -rc2 v1.01/dialog.c v1.03/dialog.c
*** v1.01/dialog.c	Tue Jan 15 11:19:06 1991
--- v1.03/dialog.c	Mon Mar 11 15:59:05 1991
***************
*** 237,242 ****
      Cardinal *num_params;
  {
      FalseSignal = TRUE;
!     killpg(dbxpid, SIGINT);
  }
  
--- 237,246 ----
      Cardinal *num_params;
  {
+ #ifndef GDB
      FalseSignal = TRUE;
!    killpg(dbxpid, SIGINT);
! #else      
! 	write_dbx("\003");	/* (PW)18FEB91 : seems to work better */
! #endif	/* GDB */
  }
  
diff -rc2 v1.01/filemenu.c v1.03/filemenu.c
*** v1.01/filemenu.c	Tue Jan 15 11:19:07 1991
--- v1.03/filemenu.c	Wed Apr  3 14:12:30 1991
***************
*** 81,84 ****
--- 81,92 ----
  #include <X11/Xos.h>
  #include <sys/stat.h>
+ 
+ #ifdef SYSV 
+ #include <stdio.h>
+ #include <sys/param.h>
+ #include <sys/types.h>
+ #include <dirent.h>
+ #endif
+ 
  #ifdef SUNOS4
  #include <dirent.h>
***************
*** 91,95 ****
  #define FILES_PER_COL   10              /* # of files per column in file menu */
  
- char		cwd[MAXPATHLEN];	/* current working directory of dbx */
  static char	fileMenuDir[MAXPATHLEN];/* current directory of file menu */
  static char  	**filelist; 		/* list of file names in fileMenu */
--- 99,102 ----
***************
*** 111,120 ****
  {
      char command[LINESIZ];
  
! #ifdef BSD
!     int i;
! 
!     if (strcmp(dir, "./") == NULL) 
! 	return;
      if (dir[0] == '/' || dir[0] == '~') 
  	strcpy(cwd, dir);
--- 118,127 ----
  {
      char command[LINESIZ];
+     char store[LINESIZ];
+     int i,j;
  
!     if(!strcmp(dir, "./")) return;
!     
! #if defined(BSD)
      if (dir[0] == '/' || dir[0] == '~') 
  	strcpy(cwd, dir);
***************
*** 130,134 ****
      }
  #else
!     sprintf(command, "cd %s\n", dir);
      query_dbx(command);
  #endif
--- 137,154 ----
      }
  #else
!     if(!strcmp(dir,"../"))
!        {
! 	 for(i=0,j=0; cwd[i]; i++) if(cwd[i]=='/')j++;
! 	 if( j == 1 ) strcpy(store,"/");
! 	 else
! 	   strcpy(store,"..");
!        }
!     else
!       {
! 	if(!strcmp(cwd, "/"))cwd[0]='\0';
! 	sprintf(store,"%s/%s", cwd, dir);
! 	LASTCH(store)='\0';
!       }
!     sprintf(command, "cd %s\n", store);
      query_dbx(command);
  #endif
***************
*** 143,146 ****
--- 163,167 ----
   *    executable files
   */
+ #ifndef SYSV
  static int InList(entry)
  Directory *entry;
***************
*** 172,182 ****
  	return True;
      }
- #ifdef GDB
- 	/* for GDB, we only want directories and executable files */
-     return FALSE;
- #else
      return True;
- #endif /* GDB */
  }
  
  
--- 193,199 ----
  	return True;
      }
      return True;
  }
+ #endif /* not SYSV */
  
  
***************
*** 189,196 ****
  char *dir;
  {
      extern 	alphasort();
      Directory   **namelist;
!     int		i, j;
  
      nfiles = scandir(dir, &namelist, InList, alphasort);
      if (nfiles == -1) {
--- 206,229 ----
  char *dir;
  {
+ #ifndef SYSV 
      extern 	alphasort();
      Directory   **namelist;
! #else
!     struct dirent *WorkingDirEntry;
!     DIR *WorkingDir;
!     char store[LINESIZ];
! #endif
!     register int		i,j;
  
+ #ifdef SYSV 
+     if(!(WorkingDir = opendir(dir)))
+       {
+ 	UpdateMessageWindow("scandir: cannot open %s", dir);
+ 	return;
+       }
+     nfiles=0;
+     while(readdir(WorkingDir))nfiles++;
+     rewinddir(WorkingDir);
+ #else    
      nfiles = scandir(dir, &namelist, InList, alphasort);
      if (nfiles == -1) {
***************
*** 198,201 ****
--- 231,235 ----
  	return;
      }
+ #endif
      if (filelist) {
  	for (i=0; filelist[i]; i++)
***************
*** 206,214 ****
      i = 0;
      for (j=0; j<nfiles; j++) {
! 	filelist[i++] = XtNewString(namelist[j]->d_name);
!     	XtFree(namelist[j]);
      }
      filelist[i++] = NULL;
      XtFree(namelist);
      return;
  }
--- 240,291 ----
      i = 0;
      for (j=0; j<nfiles; j++) {
! #ifdef SYSV 
!       WorkingDirEntry = readdir(WorkingDir);
!       if(!strcmp(WorkingDirEntry->d_name, "."))
! 	  strcpy(store, "./");
!       else
! 	{
! 	  if(!strcmp(WorkingDirEntry->d_name, ".."))
! 	    strcpy(store, "../");
! 	  else
! 	    {
! 	      struct stat statbuf;
! 	      
! 	      sprintf(store,"%s/%s",cwd,WorkingDirEntry->d_name);
! 	      if(stat(store, &statbuf) == -1)
! 		store[0]='\0';
! 	      else
! 		{
! 		  if (statbuf.st_mode & S_IFDIR)
! 		    sprintf(store, "%s/", WorkingDirEntry->d_name);
! 		  else
! 		    if (statbuf.st_mode & S_IEXEC)
! 		      sprintf(store, "%s*", WorkingDirEntry->d_name);
! 		    else
! 		      if(LASTCH(WorkingDirEntry->d_name) == '~' ||
! 			 LASTCH(WorkingDirEntry->d_name) == '#' ||
! 			 WorkingDirEntry->d_name[0] == '.' ||
! 			 (LASTCH(WorkingDirEntry->d_name) == 'o' && 
! 			  SECLASTCH(WorkingDirEntry->d_name) == '.'))
! 			store[0]='\0';
! 		      else
! 			strcpy(store, WorkingDirEntry->d_name);
! 		}
! 	    }
! 	}
! 	 if(store[0])    
! 	   filelist[i++] = XtNewString(store);
! #else /* not SYSV */
!       filelist[i++] = XtNewString(namelist[j]->d_name);
!       XtFree(namelist[j]);
! #endif
      }
      filelist[i++] = NULL;
+ 
+ #ifdef SYSV 
+     closedir(WorkingDir);
+ #else
      XtFree(namelist);
+ #endif
      return;
  }
***************
*** 239,243 ****
      }
      else if (LASTCH(filename) == '*') {
!     	UpdateMessageWindow("");
  #ifdef GDB
  	/* for GDB, we send the commands : exec-file & symbol-file */
--- 316,320 ----
      }
      else if (LASTCH(filename) == '*') {
!     	UpdateMessageWindow("",NULL);
  #ifdef GDB
  	/* for GDB, we send the commands : exec-file & symbol-file */
***************
*** 278,283 ****
      }
      else {
!     	UpdateMessageWindow("");
! #ifndef GDB
  	sprintf(command, "file %s\n", filename);
  	send_command(command);
--- 355,367 ----
      }
      else {
!     	UpdateMessageWindow("",NULL);
! #ifdef GDB
!     if (strcmp(filename, "core") == NULL)
! 		sprintf(command, "core-file %s\n", filename);
!     else
! 		sprintf(command, "list %s:1\n", filename);
! 	send_command(command);
!     	AppendDialogText(command);
! #else /* not GDB */
  	sprintf(command, "file %s\n", filename);
  	send_command(command);
***************
*** 297,301 ****
  {
      XtPopdown(popupshell);
!     UpdateMessageWindow("");
  }
  
--- 381,385 ----
  {
      XtPopdown(popupshell);
!     UpdateMessageWindow("",NULL);
  }
  
***************
*** 416,424 ****
      XtPopup(popupshell, XtGrabNonexclusive);
  
! #ifdef GDB
!     UpdateMessageWindow("Select an executable file or a directory");
! #else
!     UpdateMessageWindow("Select a file or directory");
! #endif /* GDB */
      XUndefineCursor(display, XtWindow(toplevel));
      XUndefineCursor(display, XtWindow(sourceWindow));
--- 500,505 ----
      XtPopup(popupshell, XtGrabNonexclusive);
  
!     UpdateMessageWindow("Select a file or directory",NULL);
!     
      XUndefineCursor(display, XtWindow(toplevel));
      XUndefineCursor(display, XtWindow(sourceWindow));
diff -rc2 v1.01/gdb_handler.c v1.03/gdb_handler.c
*** v1.01/gdb_handler.c	Tue Jan 15 11:19:13 1991
--- v1.03/gdb_handler.c	Fri Apr 12 17:06:15 1991
***************
*** 83,89 ****
   *    done_handler():		Progrm execution completed, clear breakpoints
   *    source_handler():		Exec commands of source file specified.
!  *    query_dbx_echo():		Send command with echo on.
   */
  
  
  void query_dbx_echo();
--- 83,92 ----
   *    done_handler():		Progrm execution completed, clear breakpoints
   *    source_handler():		Exec commands of source file specified.
!  *    query_dbx_echo():		Send command with echo on or off.
   */
  
+ #ifdef SYSV 
+ #   include <signal.h>
+ #endif
  
  void query_dbx_echo();
***************
*** 91,101 ****
  /*  
   *  Display an outlined arrow to locate the calling routine in a stack
!  *  frame.  BSD and SUN dbx have slightly different output semantics here.
!  *  The appropriate file with the calling routine is displayed and the
!  *  file variable is set accordingly.
   */
  void updown_handler()
  {
!     char command[LINESIZ], *func, *file;
      int	 line;
  
--- 94,102 ----
  /*  
   *  Display an outlined arrow to locate the calling routine in a stack
!  *  frame.
   */
  void updown_handler()
  {
!     char *func, *file;
      int	 line;
  
***************
*** 102,111 ****
      line = Token.line;
      func = XtNewString(Token.func);
! #ifdef MIPS
!     LoadCurrentFile();
! #endif
! #ifdef BSD
!     file = GetPathname(Token.file);
! #else
      if (line <= 0) line = 1;
      LoadCurrentFile();
--- 103,107 ----
      line = Token.line;
      func = XtNewString(Token.func);
! 
      if (line <= 0) line = 1;
      LoadCurrentFile();
***************
*** 112,116 ****
      if (displayedFile)
  	file = displayedFile->pathname;
- #endif
  
      if (line <= 0 || func == NULL || file == NULL)
--- 108,111 ----
***************
*** 145,149 ****
   	error message will be displayed ! */
   	
!  	query_dbx_echo("list ,main\n");	/* tell gdb to use main file 
   								and get line number of main(). (,main will end at main) */
     
--- 140,144 ----
   	error message will be displayed ! */
   	
!  	query_dbx_echo("list ,main\n", TRUE);	/* tell gdb to use main file 
   								and get line number of main(). (,main will end at main) */
     
***************
*** 160,164 ****
  		}
  		
! 	UpdateMessageWindow("Ready for execution");
  	query_dbx("display\n");		/* clear display window */
  }
--- 155,159 ----
  		}
  		
! 	UpdateMessageWindow("Ready for execution",NULL);
  	query_dbx("display\n");		/* clear display window */
  }
***************
*** 187,190 ****
--- 182,195 ----
      Cardinal	n;
  
+ #ifdef UNDISPWIN
+ 	/* this code removes the display window when there is nothing to display (GWC) */
+ 	
+ 	if (!Token.display || strcmp(Token.display, "") == NULL) {
+ 		XtUnmanageChild(separator);
+ 		XtUnmanageChild(displayWindow);
+ 		return;
+ 	}
+ #endif /* UNDISPWIN */
+ 
      if (!Token.display || strcmp(Token.display, "") == NULL) {
  	if (!XtIsManaged(displayWindow))
***************
*** 263,268 ****
  
  /* ARGSUSED */
! void directory_handler(output)
! char *output;
  {
  	/* Note : for GDB, the 'directory' command with no
--- 268,272 ----
  
  /* ARGSUSED */
! void directory_handler()
  {
  	/* Note : for GDB, the 'directory' command with no
***************
*** 416,422 ****
  		
  	if (message)
! 		UpdateMessageWindow(message);
  	else
! 		UpdateMessageWindow(Token.mesg);
  		
      line = Token.line;
--- 420,426 ----
  		
  	if (message)
! 		UpdateMessageWindow(message,NULL);
  	else
! 		UpdateMessageWindow(Token.mesg,NULL);
  		
      line = Token.line;
***************
*** 423,436 ****
      func = (Token.func) ? XtNewString(Token.func) : 0;
      
- #ifdef MIPS
-     status = LoadCurrentFile();
- #else
      if (Token.file)
  	status = LoadFile(Token.file);
- #endif
  	
- #ifndef BSD
      display_info_handler();		/* uses Token.display ! */
- #endif
  
  	/* because of tbreak, we have to call info break here */
--- 427,434 ----
***************
*** 478,483 ****
  int signal;
  {
-     char command[LINESIZ];
- 
      arrow.line = 0;
      updown.line = 0;
--- 476,479 ----
***************
*** 484,490 ****
      UpdateArrow(displayedFile);
      UpdateUpdown(displayedFile);
!     UpdateMessageWindow("Ready for execution");
  }
  
  /* WARNING : source_handler() is NOT called by the parser.
  It is called by gdb_source_command() in gdb_parser.c.
--- 480,528 ----
      UpdateArrow(displayedFile);
      UpdateUpdown(displayedFile);
!     UpdateMessageWindow("Ready for execution",NULL);
  }
  
+ /*--------------------------------------------------------------------------+
+ |																			|
+ |	Function to read the .dgbinit file or any source file.					|
+ |																			|
+ |	input : file name.														|
+ |																			|
+ |	output : none.															|
+ |																			|
+ +--------------------------------------------------------------------------*/
+ void read_source_file(file)
+ char *file;
+ {
+ char s[LINESIZ];
+ FILE *fp;
+ 
+     if (fp = fopen(file, "r"))
+     	{
+ 		while (fgets(s, LINESIZ, fp))
+ 			{
+ 			/* Check for comment line,
+ 				DO NOT SEND '\n',
+ 				Take care of source command,
+ 				Take care of define or document commands.
+ 			*/
+ 			
+ 			if ((*s != '#') && strcmp(s,"\n"))	
+ 				{
+ 				if (gdb_source_command(s,TRUE) || gdb_define_command(s,fp))
+ 					{
+ 		   		 	Prompt = False;
+ 		    		while (!Prompt)
+ 						read_dbx();
+ 					}
+ 				else
+ 					query_dbx_echo (s, TRUE);
+ 				}
+ 			}
+ 			
+ 		close(fp);
+ 		}
+ }
+ 
  /* WARNING : source_handler() is NOT called by the parser.
  It is called by gdb_source_command() in gdb_parser.c.
***************
*** 496,501 ****
  {
  char *file;
- FILE *fp;
- char s[LINESIZ];
  
      if (!Token.file || strcmp(Token.file, "") == NULL)
--- 534,537 ----
***************
*** 510,530 ****
  		return;		/* (PW)11JAN91 */
  
!     if (fp = fopen(file, "r"))
!     	{
! 		while (fgets(s, LINESIZ, fp))
! 			{
! 			/* DO NOT SEND \n and Take care of source command */
! 			if ((*s != '#') && strcmp(s,"\n") && (!gdb_source_command(s,TRUE)))	
! 				{
! 			    write_dbx(s);
! 				insert_command(s);
! 			    AppendDialogText(s);
! 			    Prompt = False;
! 			    while (!Prompt)
! 					read_dbx();
! 				}
! 			}
! 		close(fp);
! 		}
  }
  
--- 546,550 ----
  		return;		/* (PW)11JAN91 */
  
! 	read_source_file(file);
  }
  
***************
*** 532,539 ****
   *  invoking the Xt input procedure, read_dbx().
   *
!  *	Same as query_dbx() in dbx.c except that Echo = True.
   */
! void query_dbx_echo(command)
  char *command;
  {
      write_dbx(command);
--- 552,560 ----
   *  invoking the Xt input procedure, read_dbx().
   *
!  *	Same as query_dbx() in dbx.c except that Echo = True or False.
   */
! void query_dbx_echo(command, echo)
  char *command;
+ int echo;
  {
      write_dbx(command);
***************
*** 540,544 ****
      insert_command(command);
  
!     Echo = True;
      Prompt = False;
      while (!Prompt)
--- 561,565 ----
      insert_command(command);
  
!     Echo = echo;
      Prompt = False;
      while (!Prompt)
***************
*** 547,549 ****
--- 568,608 ----
      Parse = True;	/* Always reset Parse and Echo to True */
      Echo = True;
+ }
+ 
+ /*  core-file  
+  *  gdb does not display current line, file, func ..., so we send
+  *  'frame 0' command to have them.
+  */
+ void core_file_handler()
+ {
+ 	char *message;
+ 	int line;
+ 	int signal;
+ 	
+ 	message = XtNewString(Token.mesg);
+ 	signal = Token.stop;					/* signal number received */
+ 	
+ 	query_dbx("frame 0\n"); /* this will update updown.line, updown.func and
+ 								updown.file. (see updown_handler) */
+ 	
+ 	line = updown.line;
+ 	updown.line = 0;
+ 	
+     /* Display bomb sign if segmentation fault occurred in source code */
+     
+     if (line != 0 && signal == SIGSEGV) {
+     arrow.line = 0;
+ 	bomb.line = line;
+ 	strcpy(bomb.func, updown.func);
+ 	strcpy(bomb.file, updown.file);
+     } else {
+ 	bomb.line = 0;
+ 	arrow.line = line;
+ 	strcpy(arrow.func, updown.func);
+ 	strcpy(arrow.file, updown.file);
+ 	}
+ 	
+ 	UpdateMessageWindow(message,NULL);
+ 	XtFree(message);
+     AdjustText(line); 
  }
diff -rc2 v1.01/gdb_parser.c v1.03/gdb_parser.c
*** v1.01/gdb_parser.c	Tue Jan 15 11:19:13 1991
--- v1.03/gdb_parser.c	Fri Apr 12 17:05:32 1991
***************
*** 127,131 ****
  
      if (debug) {
! 	fprintf(stderr, "parse(output = %s, command = %s)\n", output, command);
      }
  
--- 127,133 ----
  
      if (debug) {
!     char *temp;
!     if(!command)temp="";else temp=command;
! 	fprintf(stderr, "parse(output = %s, command = %s)\n", output, temp);
      }
  
***************
*** 136,140 ****
      if (!command) {
  	if (match(output_pattern, output_string, O_DEBUG) != -1)
! 	    debug_handler(); 
  	debug_init();
  	XtFree(output_string);
--- 138,146 ----
      if (!command) {
  	if (match(output_pattern, output_string, O_DEBUG) != -1)
! 		{
! 	    debug_handler();
! 	    if (match(output_pattern, output_string, O_CORE_FILE) != -1)
! 			core_file_handler();
! 	    }
  	debug_init();
  	XtFree(output_string);
***************
*** 338,341 ****
--- 344,354 ----
  		break;
  		
+ 	case C_CORE_FILE:
+ 	    if (match(output_pattern, output_string, O_CORE_FILE) != -1)
+ 		core_file_handler();
+ 	    else
+ 		bell(0);
+ 	    break;
+ 	    
  	default:
  	    break;
***************
*** 344,349 ****
--- 357,394 ----
  }
  
+ #ifdef NEED_STRSTR
  /*--------------------------------------------------------------------------+
  |																			|
+ |	Some systems DO NOT have the ANSI strstr function						|
+ |																			|
+ +--------------------------------------------------------------------------*/	
+ char *
+ strstr (source, substr)
+ 	char *source;
+ 	char *substr;
+ {
+ char *src;
+ char *sub;
+ 
+ 	if (!source || !substr)
+ 		return NULL;
+ 		
+ 	while (*source)
+ 		{
+ 		for (src = source, sub = substr;
+ 				(*src) && (*sub) && (*src == *sub);
+ 					src++,sub++);
+ 		if (!*sub)
+ 			return source;
+ 			
+ 		source++;
+ 		}
+ 		
+ 	return NULL;
+ }
+ #endif
+ 
+ /*--------------------------------------------------------------------------+
+ |																			|
  |	Function to filter all the display information in a string				|
  |																			|
***************
*** 459,464 ****
      char 		*p;
      char 		*p2;
-     char 		*p3;
-     int			r;
      static Boolean	deleteRest = False;
      int			command_type = -1;
--- 504,507 ----
***************
*** 608,609 ****
--- 651,758 ----
  	return FALSE;
  }
+ 
+ /*--------------------------------------------------------------------------+
+ |																			|
+ |	Function to filter 'define' & 'document' commands						|
+ |																			|
+ |	input : command (from .gdbinit or source command),						|
+ |			fp = file pointer.												|
+ |																			|
+ |	output : TRUE if define or document command was recognized				|
+ |																			|
+ |	In case the command is recognized, it is executed here.					|
+ |																			|
+ +--------------------------------------------------------------------------*/
+ int gdb_define_command(command,fp)
+ char *command;
+ FILE *fp;
+ {
+ char s[LINESIZ];
+ int error_cmd;
+ int end_found;
+ 
+ 	if ((command && (match(command_pattern, command, C_DEFINE) != -1))
+ 		|| (command && (match(command_pattern, command, C_DOCUMENT) != -1)))
+ 		{
+ 		AppendDialogText(command);
+ 		send_command(command);
+ 		
+ /*
+ 				gdb could ask :
+ 			
+ 					"Redefine command \"%s\"? "
+ 					"Really redefine built-in command \"%s\"? "
+ 					
+ 				gdb could display 
+ 				
+ 					"Type commands for definition of \"%s\".\n"
+ 					"End with a line saying just \"end\"
+ 				
+ 				or
+ 					"Type documentation for \"%s\".\n"
+ 					"End with a line saying just \"end\".\n"
+ 					
+ 				or
+ 				 	"Command \"%s\" is built-in."
+ */
+ 	
+ 		error_cmd = FALSE;
+ 				
+ 		/* read message from gdb */
+ 		
+ 		while (1)
+ 			if (fgets(s, LINESIZ, dbxfp))
+ 				{
+ 				if (debug)
+ 					fprintf(stderr, "=>%s", s);
+ 				
+ 				if (strstr(s," is built-in."))	/* error for document of built-in command */
+ 					{
+ 					AppendDialogText(s);
+ 					error_cmd = TRUE;
+ 					bell(0);
+ 					break;
+ 					}
+ 			
+ 				if (strstr(s,"Redefine command ")
+ 				 || strstr(s,"Really redefine built-in command "))
+ 					write_dbx ("y\n"); 	/* answer to question if any */
+ 				else
+ 					{
+ 					if (strcmp(s,"End with a line saying just \"end\".\n") == NULL)
+ 						break;
+ 					}
+ 				}
+ 		
+ 		/* write command definition */
+ 		
+ 		end_found = FALSE;
+ 		
+ 		while (fgets (s, LINESIZ, fp))
+ 			{
+ 			if (!error_cmd)
+ 				{
+ 				AppendDialogText(s);
+ 				write_dbx (s);
+ 				}
+ 			
+ 			if (match(command_pattern, s, C_END) != -1)
+ 				{
+ 				end_found = TRUE;
+ 				break;
+ 				}
+ 			}
+ 			
+ 		if ((!error_cmd) && (!end_found))
+ 			{
+ 			AppendDialogText("Error : missing \"end\" in file.\n");
+ 			bell(0);
+ 			write_dbx ("end\n");
+ 			}
+ 		
+ 		return TRUE;
+ 		}
+ 		
+ 	return FALSE;
+ }
+ 
diff -rc2 v1.01/gdb_regex.h v1.03/gdb_regex.h
*** v1.01/gdb_regex.h	Tue Jan 15 11:19:14 1991
--- v1.03/gdb_regex.h	Fri Apr 12 10:06:33 1991
***************
*** 102,105 ****
--- 102,106 ----
  #define O_EXEC_DISPLAY		18			/* special for filter_display_info  */
  #define O_READING_SYMBOLS	19			/* special for filter_reading_symbols */
+ #define O_CORE_FILE			20
  
  
***************
*** 126,129 ****
--- 127,134 ----
  #define C_SOURCE		19
  #define C_EXEC_FILE		20
+ #define C_CORE_FILE		21
+ #define C_DEFINE		22
+ #define C_DOCUMENT		23
+ #define C_END			24
  
  /*--------------------------------------------------------------------------+
***************
*** 306,312 ****
      },
      /* up, down */
!     {"\\(.*\n\\)*\\(#[0-9]+[ ]+\\(0x[^ ]+[ ]+in[ ]+\\)?\\([^ ]+\\).*\n\\)\\(Source file is more recent than executable.\n\\)?\032\032\\([^ ]+\\):\\([0-9]+\\):\\([0-9]+\\):\\([^ ]+\\):0x.+\n",
       NULL,
!      {2, -1, 4, 7, 6, -1}	
      },
      /* bell */
--- 311,317 ----
      },
      /* up, down */
!     {"\\(.*\n\\)*\\(#[0-9]+[ ]+\\(0x[^ ]+[ ]+in[ ]+\\)?\\([^ ]+\\)[^\032]*\\)\032\032\\([^ ]+\\):\\([0-9]+\\):\\([0-9]+\\):\\([^ ]+\\):0x.+\n",
       NULL,
!      {2, -1, 4, 6, 5, -1}	
      },
      /* bell */
***************
*** 379,382 ****
--- 384,392 ----
       { 2, -1, -1, -1, -1, -1}
      },
+     /* core-file */
+     {"\\(.*\n\\)*\\(Program terminated with signal \\([-]?[0-9]+\\), [^ ]+.*\n\\)\\(.*\n\\)*",
+ 	NULL,
+      {  2, 3, -1, -1, -1, -1}
+     },
      NULL 
  };
***************
*** 386,390 ****
  	To simplify the patterns, I used for example :
  	
! 		"fr[ame]*" instead of "frame\\|fram\\|fra||fr".
  		
  	This will cause 'frmeame' to be accepted. But this is
--- 396,400 ----
  	To simplify the patterns, I used for example :
  	
! 		"f[rame]*" instead of "frame\\|fram\\|fra||fr".
  		
  	This will cause 'frmeame' to be accepted. But this is
***************
*** 396,400 ****
  	/* run -r - cont - c - next - n - step - s - nexti - ni - stepi - si - return
  	jump - until - u */
!     {"[ ]*\\(run\\|r\\|cont\\|c\\|next\\|n\\|step\\|s\\|nexti\\|stepi\\|ni\\|si\\|ret[urn]*\\|j[ump]*\\|unt[il]*\\|u\\)\\( .*\\)?\n",
  											NULL, {-1, -1, -1, -1, -1, -1}},
  	/* break - tbreak */
--- 406,412 ----
  	/* run -r - cont - c - next - n - step - s - nexti - ni - stepi - si - return
  	jump - until - u */
! 	/* CRL mod 22 4/5/91 GWC - added attach to this list for gdbvx */
! 	
!     {"[ ]*\\(run\\|r\\|cont\\|c\\|next\\|n\\|step\\|s\\|nexti\\|stepi\\|ni\\|si\\|ret[urn]*\\|j[ump]*\\|unt[il]*\\|u\\|at[tach]*\\)\\( .*\\)?\n",
  											NULL, {-1, -1, -1, -1, -1, -1}},
  	/* break - tbreak */
***************
*** 405,410 ****
      /* 'frame' is special case of 'frame n' since it does not change the
      current frame. Else 'frame n' is like up or down. */
!     {"[ ]*fr[ame]*[ ]*\n",					NULL, {-1, -1, -1, -1, -1, -1}},
!     {"[ ]*\\(up\\|down\\|dow\\|do\\|fr[ame]*\\)\\( .*\\)?\n", 
  											NULL, {-1, -1, -1, -1, -1, -1}},
  											
--- 417,423 ----
      /* 'frame' is special case of 'frame n' since it does not change the
      current frame. Else 'frame n' is like up or down. */
! 	/* CRL mod 23 4/5/91 GWC - changed fr[ame] to f[rame] */
!     {"[ ]*f[rame]*[ ]*\n",					NULL, {-1, -1, -1, -1, -1, -1}},
!     {"[ ]*\\(up\\|down\\|dow\\|do\\|f[rame]*\\)\\( .*\\)?\n", 
  											NULL, {-1, -1, -1, -1, -1, -1}},
  											
***************
*** 453,456 ****
--- 466,480 ----
      /* exec-file (just used internally) */
      {"[ ]*exec-file .*\n", 					NULL, {-1, -1, -1, -1, -1, -1}},
+ 
+     /* core-file */
+     {"[ ]*cor[e-file]*.*\n", 				NULL, {-1, -1, -1, -1, -1, -1}},
+ 
+     /* define */
+     {"[ ]*def[ine]*[ ]+[^ ]+\n", 			NULL, {-1, -1, -1, -1, -1, -1}},
+     /* document */
+     {"[ ]*doc[ument]*[ ]+[^ ]+\n", 			NULL, {-1, -1, -1, -1, -1, -1}},
+     /* end of define or document */
+     {"[ ]*end[ ]*.*", 						NULL, {-1, -1, -1, -1, -1, -1}},
+ 
      NULL
  };
diff -rc2 v1.01/global.h v1.03/global.h
*** v1.01/global.h	Tue Jan 15 11:19:14 1991
--- v1.03/global.h	Tue Apr  2 09:00:55 1991
***************
*** 64,67 ****
--- 64,84 ----
   */
  
+ 
+ #ifdef __GNUC__
+ #define alloca __builtin_alloca
+ #endif
+ 
+ #ifndef MAXPATHLEN
+ #define MAXPATHLEN 1024
+ #endif
+ 
+ #ifdef SYSV 
+ #define MAX(a,b)	((a)>(b)?(a):(b))
+ #define MIN(a,b)	((a)>(b)?(b):(a))
+ #ifdef sco
+ #include <unistd.h>
+ #endif
+ #endif
+ 
  #include "defs.h"
  
diff -rc2 v1.01/handler.c v1.03/handler.c
*** v1.01/handler.c	Tue Jan 15 11:19:14 1991
--- v1.03/handler.c	Wed Apr  3 14:13:41 1991
***************
*** 173,177 ****
      if (Token.func == NULL || Token.line == 0) 
  	return; 
!     UpdateMessageWindow(Token.mesg);
      line = Token.line;
      func = XtNewString(Token.func);
--- 173,177 ----
      if (Token.func == NULL || Token.line == 0) 
  	return; 
!     UpdateMessageWindow(Token.mesg,NULL);
      line = Token.line;
      func = XtNewString(Token.func);
***************
*** 219,223 ****
      UpdateArrow(displayedFile);
      UpdateUpdown(displayedFile);
!     UpdateMessageWindow("Ready for execution");
      if (displayedFile == NULL) return;
  #ifdef MIPS
--- 219,223 ----
      UpdateArrow(displayedFile);
      UpdateUpdown(displayedFile);
!     UpdateMessageWindow("Ready for execution",NULL);
      if (displayedFile == NULL) return;
  #ifdef MIPS
***************
*** 439,443 ****
  	ClearStops();
  	UpdateStops(displayedFile);
!         UpdateMessageWindow("Ready for execution");
  	query_dbx("func main\n");
  #ifndef BSD
--- 439,443 ----
  	ClearStops();
  	UpdateStops(displayedFile);
!         UpdateMessageWindow("Ready for execution",NULL);
  	query_dbx("func main\n");
  #ifndef BSD
diff -rc2 v1.01/regex.c v1.03/regex.c
*** v1.01/regex.c	Tue Jan 15 11:19:19 1991
--- v1.03/regex.c	Tue Apr  2 08:58:56 1991
***************
*** 119,122 ****
--- 119,126 ----
  #define FAILURE_STACK   20000           /* max failure stack size */
  
+ #ifdef __GNUC__
+ #define alloca __builtin_alloca
+ #endif
+ 
  #ifdef emacs
  
diff -rc2 v1.01/signals.c v1.03/signals.c
*** v1.01/signals.c	Tue Jan 15 11:19:20 1991
--- v1.03/signals.c	Tue Apr  2 08:59:04 1991
***************
*** 73,77 ****
--- 73,81 ----
  static void quit_handler()
  {
+ #ifdef SYSV 
+     int status;
+ #else
      union wait status;
+ #endif /* SYSV */
  
      /*  wait for the child to report its status; if the child has died, 
***************
*** 78,82 ****
--- 82,91 ----
       *  exit gracefully.
       */
+ #ifdef SYSV 
+     waitpid(&status, NULL , WNOHANG|WUNTRACED);
+ #else
      wait3(&status, WNOHANG|WUNTRACED, NULL);
+ #endif /* SYSV */
+ 
      if ((WIFEXITED(status) || WIFSIGNALED(status)) && !WIFSTOPPED(status)) {
      	exit(1);
diff -rc2 v1.01/source.c v1.03/source.c
*** v1.01/source.c	Tue Jan 15 11:19:20 1991
--- v1.03/source.c	Thu Apr 11 14:33:58 1991
***************
*** 79,82 ****
--- 79,92 ----
  #include "global.h"
  
+ #ifdef SYSV 
+ #ifdef sco
+ #   include <fcntl.h>
+ #endif
+ #endif /* SYSV */
+ 
+ #ifdef GDB
+ #include <string.h>
+ #endif
+ 
  #define	MAXDIRS	256			/* max number of dirs in dirList */
  
***************
*** 575,579 ****
--- 585,593 ----
  
              ++i;
+ #ifdef GDB	/* GDB uses ':' as separator character */
+             s = (char *) strtok(NULL, ": \n");
+ #else
              s = (char *) strtok(NULL, " \n");
+ #endif /* GDB */
          }
          dirList[i] = NULL;
***************
*** 623,626 ****
--- 637,655 ----
  	else
  	     sprintf(pathname, "%s/%s/%s", cwd, dirList[i], filename);
+ 	     
+ #ifdef GDB	/* (PW)11APR91 : replace all "/./" in pathname by "/".
+ 				because sometimes gdb could produce "./filename",
+ 				eg, when a C file is included in another C file. */
+ 	{
+ 	char *s;		
+ 	char *s2;		
+ 	while (s = strstr ( pathname, "/./" ))
+ 		{
+ 		s++;									/* replace "/./" by "/" */
+ 		s2 = s + sizeof("/./") - sizeof("/");
+ 		while ( *(s++) = *(s2++) );
+ 		}
+ 	}
+ #endif /* GDB */
  	if (access(pathname, R_OK) == 0)
  	    return XtNewString(pathname);
diff -rc2 v1.01/windows.c v1.03/windows.c
*** v1.01/windows.c	Tue Jan 15 11:19:21 1991
--- v1.03/windows.c	Wed Apr  3 15:54:34 1991
***************
*** 27,30 ****
--- 27,58 ----
   *  Created:   	March 10, 1989
   *
+  *****************************************************************************
+  * 
+  *  xxgdb - X Window System interface to the gdb debugger
+  *  
+  * 	Copyright 1990 Thomson Consumer Electronics, Inc.
+  *  
+  *  Permission to use, copy, modify, and distribute this software and its
+  *  documentation for any purpose and without fee is hereby granted,
+  *  provided that the above copyright notice appear in all copies and that
+  *  both that copyright notice and this permission notice appear in
+  *  supporting documentation, and that the name of Thomson Consumer
+  *  Electronics (TCE) not be used in advertising or publicity pertaining
+  *  to distribution of the software without specific, written prior
+  *  permission.  TCE makes no representations about the suitability of
+  *  this software for any purpose.  It is provided "as is" without express
+  *  or implied warranty.
+  *
+  *  TCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+  *  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
+  *  SHALL TCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
+  *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+  *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+  *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+  *  SOFTWARE.
+  *
+  *  Adaptation to GDB:  Pierre Willard
+  *  XXGDB Created:   	December, 1990
+  *
   *****************************************************************************/
  
***************
*** 160,166 ****
--- 188,198 ----
      CreateCommandPanel(vpane);
      CreateDialogWindow(vpane);
+ #ifdef GDB
+     CreateDisplayWindow(vpane);
+ #else
  #ifndef BSD
      CreateDisplayWindow(vpane);
  #endif
+ #endif	/* not GDB */
  } 
  
***************
*** 197,213 ****
  }
  
  void UpdateMessageWindow(format, arg)
  char *format, *arg;
  {
!     char 	message[LINESIZ], string[LINESIZ];
      Arg 	args[MAXARGS];
      Cardinal 	n;
  
      strcpy(message, "  ");
!     sprintf(string, format, arg);
!     strcat(message, string);
      n = 0;
      XtSetArg(args[n], XtNlabel, (XtArgVal) message);		n++;
      XtSetValues(messageWindow, args, n);
  }
  
--- 229,265 ----
  }
  
+ /*--------------------------------------------------------------------------+
+ |																			|
+ |	Note : UpdateMessageWindow assumes that the format string				|
+ |			can only contain one %s specifier.								|
+ |		arg is either NULL or is a string.									|
+ |		format is a string (never NULL).									|
+ |																			|
+ +--------------------------------------------------------------------------*/
  void UpdateMessageWindow(format, arg)
  char *format, *arg;
  {
! 	char *message;
! 	char string[LINESIZ];
! 	int fulllength;
      Arg 	args[MAXARGS];
      Cardinal 	n;
  
+ 	fulllength = strlen ("  ") + strlen (format) + 1 + (arg == NULL) ? 0 : strlen (arg);
+ 	
+ 	if (fulllength > LINESIZ)
+ 		message = (char*) XtMalloc (fulllength);
+ 	else
+ 		message = string;
+ 		
      strcpy(message, "  ");
!     sprintf(message + strlen(message), format, arg);
!     
      n = 0;
      XtSetArg(args[n], XtNlabel, (XtArgVal) message);		n++;
      XtSetValues(messageWindow, args, n);
+     
+ 	if (fulllength > LINESIZ)
+ 		XtFree(message);
  }
  
diff -rc2 v1.01/xdbx.c v1.03/xdbx.c
*** v1.01/xdbx.c	Tue Jan 15 11:19:22 1991
--- v1.03/xdbx.c	Tue Apr 16 10:22:40 1991
***************
*** 72,78 ****
  
  #ifdef GDB
! #define XGDBVERSION	"1.01"
  #endif
  
  #include "global.h"
  #include "bitmaps.h"
--- 72,83 ----
  
  #ifdef GDB
! #define XGDBVERSION	"1.03"
  #endif
  
+ #ifdef SYSV 
+ #   include <stdio.h>
+ #   include <sys/param.h>
+ #endif
+ 
  #include "global.h"
  #include "bitmaps.h"
***************
*** 82,85 ****
--- 87,91 ----
  #define Offset(field) (XtOffset(XdbxResources *, field))
  
+ char            cwd[MAXPATHLEN];        /* The current working directory */
  XtAppContext  	app_context; 		/* application context */
  Widget  	toplevel; 		/* top level widget */
***************
*** 99,102 ****
--- 105,115 ----
      {"prompt", "Prompt", XtRString, sizeof(char *), 
  	Offset(prompt), XtRImmediate, (caddr_t)NULL},
+ 	
+ /* CRL mod 4 3/15/91 GWC - added two new application resources */
+     {"db_name", "Prompt", XtRString, sizeof(char *), 
+ 	Offset(db_name), XtRImmediate, (caddr_t)NULL},
+     {"db_prompt", "Prompt", XtRString, sizeof(char *), 
+ 	Offset(db_prompt), XtRImmediate, (caddr_t)NULL},
+ 
      {"delimiters", "Delimiters", XtRString, sizeof(char *), 
  	Offset(delimiters), XtRImmediate, (caddr_t)NULL},
***************
*** 184,187 ****
--- 197,205 ----
      {"-bigicon","bigicon",	XrmoptionNoArg, "True"},
      {"-debug",	"debug",	XrmoptionNoArg, "True"},
+ 
+ /* CRL mod 4 4/1/91 GWC - command line options for db_name and db_prompt */
+     {"-db_name","db_name",      XrmoptionSepArg, NULL},
+     {"-db_prompt","db_prompt",  XrmoptionSepArg, NULL},
+ 
  #ifdef GDB
      {"-d",	"includeDir",	XrmoptionSepArg, NULL},
***************
*** 199,206 ****
      {"-sr",	"tstartup",	XrmoptionSepArg, NULL},
  #endif
- #endif	/* GDB */
  #ifdef MIPS  /* Mips dbx */
      {"-pixie",  "pixie",	XrmoptionNoArg, "True"},
  #endif
  };
  
--- 217,224 ----
      {"-sr",	"tstartup",	XrmoptionSepArg, NULL},
  #endif
  #ifdef MIPS  /* Mips dbx */
      {"-pixie",  "pixie",	XrmoptionNoArg, "True"},
  #endif
+ #endif	/* not GDB */
  };
  
***************
*** 224,228 ****
  #else
  	    "Usage: %s [-toolkitoptions] [-dbxoptions] [objfile [corefile]]\n",
! #endif	/* GDB */
  	    call);
      exit(1);
--- 242,246 ----
  #else
  	    "Usage: %s [-toolkitoptions] [-dbxoptions] [objfile [corefile]]\n",
! #endif	/* not GDB */
  	    call);
      exit(1);
***************
*** 250,254 ****
      XStoreName(display, XtWindow(toplevel), title);
      XSetIconName(display, XtWindow(toplevel), "xdbx");
! #endif	/* GDB */
      wmhints.input = True;
      if (app_resources.bigicon)
--- 268,272 ----
      XStoreName(display, XtWindow(toplevel), title);
      XSetIconName(display, XtWindow(toplevel), "xdbx");
! #endif	/* not GDB */
      wmhints.input = True;
      if (app_resources.bigicon)
***************
*** 279,283 ****
      if (access(xdbxinit, R_OK) == -1) {
      	sprintf(xdbxinit, "%s/%s", (char *) getenv("HOME"), ".dbxinit");
! #endif	/* GDB */
      	if (access(xdbxinit, R_OK) == -1) {
  	    strcpy(xdbxinit, "");
--- 297,301 ----
      if (access(xdbxinit, R_OK) == -1) {
      	sprintf(xdbxinit, "%s/%s", (char *) getenv("HOME"), ".dbxinit");
! #endif	/* not GDB */
      	if (access(xdbxinit, R_OK) == -1) {
  	    strcpy(xdbxinit, "");
***************
*** 299,305 ****
  {
      char **dbxargv;
! #ifdef GDB
!     char *temp = "xxgdb.XXXXXX";
! #else
      char *temp = "xdbx.XXXXXX";
  #endif
--- 317,321 ----
  {
      char **dbxargv;
! #ifndef GDB
      char *temp = "xdbx.XXXXXX";
  #endif
***************
*** 320,327 ****
      if (app_resources->includeDir) {
  #ifdef GDB
! 	dbxargv[i++] = "-d ";
  #else
  	dbxargv[i++] = "-I";
! #endif	/* GDB */
  	dbxargv[i++] = app_resources->includeDir;
      }
--- 336,343 ----
      if (app_resources->includeDir) {
  #ifdef GDB
! 	dbxargv[i++] = "-d";
  #else
  	dbxargv[i++] = "-I";
! #endif	/* not GDB */
  	dbxargv[i++] = app_resources->includeDir;
      }
***************
*** 356,360 ****
  #endif
  	dbxargv[i++] = (char *) mktemp(temp);
! #endif	/* GDB */
      }
      if (app_resources->startup) {	/* overwrites dbxinit */
--- 372,376 ----
  #endif
  	dbxargv[i++] = (char *) mktemp(temp);
! #endif	/* not GDB */
      }
      if (app_resources->startup) {	/* overwrites dbxinit */
***************
*** 366,369 ****
--- 382,386 ----
  	strcpy(xdbxinit, app_resources->tstartup);
      }
+ #ifndef GDB
  #ifdef MIPS
      if (app_resources->pixie) {		/* pixie output */
***************
*** 371,374 ****
--- 388,392 ----
      }
  #endif
+ #endif	/* not GDB */
      dbxargv[i] = NULL;
      *argc = i;
***************
*** 382,385 ****
--- 400,406 ----
      char 	**dbxargv;
  
+ #ifdef SYSV 
+     getcwd((char *)cwd, MAXPATHLEN);
+ #endif
      trap_signals();
  

--
Dan Heller
O'Reilly && Associates       Z-Code Software    Comp-sources-x:
Senior Writer                President          comp-sources.x at uunet.uu.net
argv at ora.com                 argv at zipcode.com



More information about the Comp.sources.x mailing list