[comp.sources.x] REPOST: v11i042: xxgdb - X front end for gdb, Part01/08

pierre@tce.COM (Pierre Willard) (03/20/91)

Submitted-by: pierre@tce.COM (Pierre Willard)
Posting-number: Volume 11, Issue 42
Archive-name: xxgdb/part01

[ moderator's note: many archive sites are missing this, so I'm
  reposting it.  Fortunately, I hadn't deleted it yet (I thought I did).
  --dan ]

This is an X interface to gdb.
In fact, it is an adaptation of xdbx (comp.sources.x, volume 8) to gdb.

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 1 (of 8)."
# Contents:  Imakefile README XDBX_README XDbx.ad XXGDB_README
#   bsd_regex.h datadpy.h mips_regex.h patchlevel.h signals.c
#   sun_regex.h utils.c windows.c
# Wrapped by gilbert@phi on Tue Jan 15 13:12:45 1991
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Imakefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Imakefile'\"
else
echo shar: Extracting \"'Imakefile'\" \(1019 characters\)
sed "s/^X//" >'Imakefile' <<'END_OF_FILE'
X
X#define TARGET_IS_GDB 1
X
X#if TARGET_IS_GDB
XDEFGDB =  -DGDB -g
X#else
XDEFGDB =
X#endif
X
X#if defined(SunArchitecture) && OSMajorVersion >= 4
X        DEFINES = -DSUNOS4 $(DEFGDB)
X#endif
X
X#ifdef UltrixArchitecture
X#ifdef MipsArchitecture
X        DEFINES = -DBSD -DMIPS  $(DEFGDB)
X#else
X        DEFINES = -DBSD $(DEFGDB)
X#endif
X#endif
X
X        DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
XLOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
X
X           SRCS = calldbx.c command.c dbx.c dialog.c datadpy.c filemenu.c \
X		  handler.c parser.c regex.c signs.c signals.c source.c \
X		  utils.c windows.c xdbx.c
X
X           OBJS = calldbx.o command.o dbx.o dialog.o datadpy.o filemenu.o \
X		  handler.o parser.o regex.o signs.o signals.o source.o \
X		  utils.o windows.o xdbx.o
X
X#if TARGET_IS_GDB
X
XComplexProgramTarget(xxgdb)
X
X#else
X
XComplexProgramTarget(xdbx)
X
X#endif	/* not GDB */
X
XInstallAppDefaults(XDbx)
X
X#if TARGET_IS_GDB
Xhandler.o: gdb_handler.c
X
Xparser.o: gdb_parser.c gdb_regex.h
X
X#endif	/* GDB */
END_OF_FILE
if test 1019 -ne `wc -c <'Imakefile'`; then
    echo shar: \"'Imakefile'\" unpacked with wrong size!
fi
# end of 'Imakefile'
fi
if test -f 'README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'README'\"
else
echo shar: Extracting \"'README'\" \(569 characters\)
sed "s/^X//" >'README' <<'END_OF_FILE'
X
XThis is the source files for xxgdb v1.01 (and xdbx 2.1 patch level 2)
X----------------------------------------------------------------------
X
X	XXGDB is a X window interface to the GDB debugger.
X	
X	This X window interface has been adapted to GDB from the source
X	distribution files of XDBX version 2.1 (patch level 2) which
X	implements an X window interface to the DBX debugger.
X
X	See XDBX_README for more information on xdbx.
X	
X	See XXGDB_README for more information on xxgdb.
X
X
X	Imakefile defines 'TARGET_IS_GDB' to build xxgdb.
X	Undefine this macro to build xdbx.
X	
END_OF_FILE
if test 569 -ne `wc -c <'README'`; then
    echo shar: \"'README'\" unpacked with wrong size!
fi
# end of 'README'
fi
if test -f 'XDBX_README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'XDBX_README'\"
else
echo shar: Extracting \"'XDBX_README'\" \(968 characters\)
sed "s/^X//" >'XDBX_README' <<'END_OF_FILE'
X
XXdbx Version 2.1
X~~~~~~~~~~~~~~~~
XThis is the source distribution of xdbx, version 2.1 for X11R4 only.
XXdbx implements an X window system interface to the dbx debugger.  It
Xuses X11R4 Xt Intrinsics and Athena widgets.  Xdbx supports dbx on the 
XSun 3, Sun 4 workstations, and the DECstation 3100.
X
XChanges since version 2.0
X  +  conversion to R4
X  +  addition of icon
X  +  text selection behavior
X  +  bug fixes and enhancement
X
XXdbx has been tested on the following platforms:
X  o  Sun 4 running SunOS 4.0.3
X  o  Sun 3 running SunOS 4.1
X  o  Sun 3 running SunOS 4.0.3
X  o  DECStation 3100 running Ultrix 3.1
X  o  OpenWindows 1.1, 2.0
X  o  Window managers: mwm, twm, olwm
X
XBugs:
X  o  xdbx may get into an infinte loop while running on the DECstation 3100
X
XPlease send comments and bug reports to:
X
X    Po Cheung
X    cheung@sw.mcc.com	
X    Microelectronics and Computer Technology Corporation
X      -- or --
X    po@cerc.utexas.edu 	
X    University of Texas at Austin
X
END_OF_FILE
if test 968 -ne `wc -c <'XDBX_README'`; then
    echo shar: \"'XDBX_README'\" unpacked with wrong size!
fi
# end of 'XDBX_README'
fi
if test -f 'XDbx.ad' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'XDbx.ad'\"
else
echo shar: Extracting \"'XDbx.ad'\" \(1734 characters\)
sed "s/^X//" >'XDbx.ad' <<'END_OF_FILE'
X#
X# Xdbx 2.1 Application defaults file
X#
X
X*background: 				snow1
X*foreground: 				black
X*fileWindow*background:			snow2
X*messageWindow.background:		snow2
X*commandWindow.background: 		snow2
X*Scrollbar.foreground: 			snow3
X
X*allowShellResize:              	True
X*borderWidth:				1
X*font:                          	fixed
X*vpane.width:                   	550
X*fileWindow*font:     			variable
X*fileLabel.width:     			500
X*lineLabel.width:     			50
X*sourceForm.preferredPaneSize:  	320
X*sourceWindow.leftMargin:       	35
X*sourceWindow.scrollHorizontal:		whenNeeded
X*sourceWindow.translations:		#override \n\
X	<Btn1Down>:             SelectStart() SelectWord() \n\
X	Shift<Btn1Up>:          Update() SelectEnd() PrintSelection() \n\
X	<Btn1Up>:               Update() SelectEnd() \n
X*messageWindow*font:  			variable
X*messageWindow.min:  			30
X*messageWindow.max:  			30
X*dialogWindow.preferredPaneSize:	200
X*dialogWindow.resizeToPreferred:	True
X*dialogWindow.translations:		#override \n\
X	<Btn1Down>:     SelectStart() SelectWord() \n\
X	Shift<Btn1Up>:  SelectEnd() PrintSelection() \n\
X	<Btn1Up>:       SelectEnd() \n
X*commandWindow.preferredPaneSize:	106
X*commandWindow.skipAdjust:		True
X*commandWindow.hSpace:			14
X*commandWindow.vSpace:			10
X*Command.height:                	20
X*Command.width:                 	60
X*List.columnSpacing:            	10
X*displayWindow.preferredPaneSize:	50
X*displayWindow.skipAdjust:      	True
X*displayWindow.scrollVertical:		whenNeeded
X*displayWindow.scrollHorizontal:	whenNeeded
X*displayWindow.translations:		#override \n\
X	<Btn1Down>:             SelectStart() SelectWord() \n\
X	Shift<Btn1Up>:          SelectEnd() PrintSelection() \n\
X	<Btn1Up>:               SelectEnd() \n
X*popup*showGrip:			False
END_OF_FILE
if test 1734 -ne `wc -c <'XDbx.ad'`; then
    echo shar: \"'XDbx.ad'\" unpacked with wrong size!
fi
# end of 'XDbx.ad'
fi
if test -f 'XXGDB_README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'XXGDB_README'\"
else
echo shar: Extracting \"'XXGDB_README'\" \(5701 characters\)
sed "s/^X//" >'XXGDB_README' <<'END_OF_FILE'
X/*****************************************************************************
X *
X *  xdbx - X Window System interface to the dbx debugger
X *
X *  Copyright 1989 The University of Texas at Austin
X *  Copyright 1990 Microelectronics and Computer Technology Corporation
X *
X *  Permission to use, copy, modify, and distribute this software and its
X *  documentation for any purpose and without fee is hereby granted,
X *  provided that the above copyright notice appear in all copies and that
X *  both that copyright notice and this permission notice appear in
X *  supporting documentation, and that the name of The University of Texas
X *  and Microelectronics and Computer Technology Corporation (MCC) not be 
X *  used in advertising or publicity pertaining to distribution of
X *  the software without specific, written prior permission.  The
X *  University of Texas and MCC makes no representations about the 
X *  suitability of this software for any purpose.  It is provided "as is" 
X *  without express or implied warranty.
X *
X *  THE UNIVERSITY OF TEXAS AND MCC DISCLAIMS ALL WARRANTIES WITH REGARD TO
X *  THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
X *  FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF TEXAS OR MCC BE LIABLE FOR
X *  ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
X *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
X *  CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
X *  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
X *
X *  Author:  	Po Cheung
X *  Created:   	March 10, 1989
X * 
X *****************************************************************************
X * 
X *  xxgdb - X Window System interface to the gdb debugger
X *  
X * 	Copyright 1990 Thomson Consumer Electronics, Inc.
X *  
X *  Permission to use, copy, modify, and distribute this software and its
X *  documentation for any purpose and without fee is hereby granted,
X *  provided that the above copyright notice appear in all copies and that
X *  both that copyright notice and this permission notice appear in
X *  supporting documentation, and that the name of Thomson Consumer
X *  Electronics (TCE) not be used in advertising or publicity pertaining
X *  to distribution of the software without specific, written prior
X *  permission.  TCE makes no representations about the suitability of
X *  this software for any purpose.  It is provided "as is" without express
X *  or implied warranty.
X *
X *  TCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
X *  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
X *  SHALL TCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
X *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
X *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
X *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
X *  SOFTWARE.
X *
X *  Adaptation to GDB:  Pierre Willard
X *  XXGDB Created:   	December, 1990
X *
X *****************************************************************************/
X
XPlease send XDBX comments and bug reports to:
X
X    Po Cheung
X    cheung@sw.mcc.com	
X    Microelectronics and Computer Technology Corporation
X      -- or --
X    po@cerc.utexas.edu 	
X    University of Texas at Austin
X
XPlease send XXGDB comments and bug reports to:
X
X	Pierre Willard
X	pierre@tce.com
X	Thomson Consumer Electronics, Inc.
X
XXXGDB version 1.0
X-----------------
X
X	>> SEE ALSO XDBX DOCUMENTATION <<
X	
X	XXGDB is a X window interface to the GDB debugger.
X	
X	GDB must be accessible in the current path.
X	
X	This X window interface has been adapted to GDB from the source
X	distribution files of XDBX version 2.1 (patch level 2) which
X	implements an X window interface to the DBX debugger.
X	
X	See the XDBX_README file for more information on XDBX.
X	
X	XXGDB has been tested on SUN 4 running OS 4.1
X		
X	- The name of the debugger called by xxgdb is by default 'gdb'.
X	It can be overridden with the environment variable XXGDB_DEBUGGER.
X	
X	- XXGDB changes the GDB default 'set prettyprint' to ON. This is
X	necessary to be able to display the pointed object when clicking
X	a pointer value in a popup window (see also 'Displaying C Data
X	Structures' in xdbx documentation). Except for this feature,
X	xxgdb works with 'set prettyprint off'.
X	
X	- XXGDB changes the GDB default 'set screensize' to 0.
X
X	- With the 'list' command, XXGDB will put the cursor at the last 
X	listed line and will make sure that this last line is visible
X	in the source window.
X		
X	To build xxgdb, 'Imakefile' defines :
X	
X#define TARGET_IS_GDB 1
X
X
XXXGDB version BUG LIST
X----------------------
X
XThis version of XXGDB is pretty much working. 
XThe following bugs will probably be fixed in future versions.
X
X	- 'define' command of GDB is NOT supported by xxgdb.
X	
X	- 'source' command of XXGDB behaves slighlty differently from 
X	the one in GDB. The specified file is read line by line by xxgdb
X	and each line is sent to gdb. Thus gdb will ask confirmation of
X	some commands. 
X	This is also the case for the execution of the '.gdbinit' file.
X	
X	- Repeat command of XXGDB behaves slighlty differently from the one
X	in GDB.
X	
X	- Clicking too rapidly on the buttons will sometimes hang gdb.
X	It is WISE to wait for the completion of the previous command
X	before sending any new command to gdb. Note that sending the
X	SIGCONT (19) signal to gdb seems to fix this problem.
X	
X
XXXGDB history
X-------------
X
X	1.0		December 1990.
X	1.01	January 1991.
X				Fix bug with display command (when displaying structures).
X				Fix bug with undisplay command (display window went blank).
X				Add XXGDB no warranty message at start-up.
X
X				--------------------------
END_OF_FILE
if test 5701 -ne `wc -c <'XXGDB_README'`; then
    echo shar: \"'XXGDB_README'\" unpacked with wrong size!
fi
# end of 'XXGDB_README'
fi
if test -f 'bsd_regex.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'bsd_regex.h'\"
else
echo shar: Extracting \"'bsd_regex.h'\" \(5064 characters\)
sed "s/^X//" >'bsd_regex.h' <<'END_OF_FILE'
X/*****************************************************************************
X *
X *  xdbx - X Window System interface to the dbx debugger
X *
X *  Copyright 1989 The University of Texas at Austin
X *  Copyright 1990 Microelectronics and Computer Technology Corporation
X *
X *  Permission to use, copy, modify, and distribute this software and its
X *  documentation for any purpose and without fee is hereby granted,
X *  provided that the above copyright notice appear in all copies and that
X *  both that copyright notice and this permission notice appear in
X *  supporting documentation, and that the name of The University of Texas
X *  and Microelectronics and Computer Technology Corporation (MCC) not be 
X *  used in advertising or publicity pertaining to distribution of
X *  the software without specific, written prior permission.  The
X *  University of Texas and MCC makes no representations about the 
X *  suitability of this software for any purpose.  It is provided "as is" 
X *  without express or implied warranty.
X *
X *  THE UNIVERSITY OF TEXAS AND MCC DISCLAIMS ALL WARRANTIES WITH REGARD TO
X *  THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
X *  FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF TEXAS OR MCC BE LIABLE FOR
X *  ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
X *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
X *  CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
X *  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
X *
X *  Author:  	Po Cheung
X *  Created:   	March 10, 1989
X *
X *****************************************************************************/
X
X/*  bsd_regex.h
X *
X *  Regular expression pattern matching for Berkeley dbx.
X *
X *  The reg_token array indicates the register no. for each token type.
X *      reg_token[0] : message
X *      reg_token[1] : stop number
X *      reg_token[2] : function name
X *      reg_token[3] : line number
X *      reg_token[4] : file name
X *      reg_token[5] : display command output
X */
X
X#define TK_MESG         0
X#define TK_STOP         1
X#define TK_FUNC         2
X#define TK_LINE         3
X#define TK_FILE         4
X#define TK_DISP		5
X
X#define O_EXEC          0
X#define O_DONE          1
X#define O_STOPAT        2
X#define O_STOPIN        3
X#define O_UPDOWN        4
X#define O_BELL          5
X#define O_LIST          6
X#define O_FILE          7
X#define O_SEARCH        8
X#define O_PRINT         9
X#define O_DEBUG         10
X
X#define C_ANY		-1
X#define C_EXEC          0
X#define C_STOPAT        1
X#define C_STOPIN        2
X#define C_UPDOWN        3
X#define C_DELETE        4
X#define C_FUNC          5
X#define C_FILE          6
X#define C_USE          	7
X#define C_LIST         	8
X#define C_SEARCH        9
X#define C_PRINT		10
X#define C_STATUS        11
X
X
Xstatic PatternRec output_pattern[] = {
X    /* exec */
X    {"\\(.*\n\\)*.*\\(\[[0-9]+\\] \\)?\\(\\(stopped\\|Bus error\\|Segmentation \
Xfault\\|Interrupt\\) in \\([^ ]+\\) at line \
X\\([0-9]+\\)\\( in file \"\\([^ ]+\\)\"\\)?\\)\n", 
X     NULL,
X     {3, -1, 5, 6, 8, -1}
X    },
X    /* done */
X    {"\\(.*\n\\)*execution completed",
X     NULL,
X     {-1, -1, -1, -1, -1, -1}
X    },
X    /* stop at */
X    {"\\[\\([0-9]+\\)\\] stop at \\(\"\\([^ ]+\\)\":\\)?\\([0-9]+\\)\n",
X     NULL,
X     {-1, 1, -1, 4, 3, -1}
X    },
X    /* stop in */
X    {"\\[\\([0-9]+\\)\\] stop in \\([^ ]+\\)\n",
X     NULL,
X     {-1, 1, 2, -1, -1, -1}
X    },
X    /* up, down */
X    {"\\([^ ]+\\)(.*), line \\([0-9]+\\) in \"\\([^ ]+\\)\"\n",
X     NULL,
X     {-1, -1, 1, 2, 3, -1}
X    },
X    /* bell */
X    {"\\(not that many levels\n\\|can't continue execution\n\\)",
X     NULL,
X     {-1, -1, -1, -1, -1, -1}
X    },
X    /* list */
X    {"\\([ ]*[0-9]+.*\n\\)*[ ]+\\([0-9]+\\)[ ]+{.*\n",
X     NULL,
X     {-1, -1, -1, 2, -1, -1}
X    },
X    /* file */
X    {"\\([^ ]*\\)\n",
X     NULL,
X     {-1, -1, -1, -1, 1, -1}
X    },
X    /* search */
X    {"[ ]*\\([0-9]+\\).*\n",
X     NULL,
X     {-1, -1, -1, 1, -1, -1}
X    },
X    /* print, display */
X    {"\\(warning: .*\n\\)?\\(\\(.*\\) = .*\n\\(.*\n\\)*\\)",
X     NULL,
X     { 3, -1, -1, -1, -1, 2}
X    },
X    NULL
X};
X
Xstatic PatternRec command_pattern[] = {
X    {"[ ]*\\(run\\|r\\|cont\\|c\\|next\\|n\\|step\\|s\\|return\\)",
X						NULL, {-1, -1, -1, -1, -1, -1}},
X    {"[ ]*\\(stop\\|st\\)[ ]+at[ ]+[0-9]+",   	NULL, {-1, -1, -1, -1, -1, -1}},
X    {"[ ]*\\(stop\\|st\\)[ ]+in[ ]+[^ ]+",      NULL, {-1, -1, -1, -1, -1, -1}},
X    {"[ ]*\\(where\\|up\\|down\\)",             NULL, {-1, -1, -1, -1, -1, -1}},
X    {"[ ]*\\(delete\\|d\\)",                  	NULL, {-1, -1, -1,  1, -1, -1}},
X    {"[ ]*func[ ]*\\([^ ]+\\)[ ]*",           	NULL, {-1, -1,  1, -1, -1, -1}},
X    {"[ ]*file[ ]*",           			NULL, {-1, -1, -1, -1,  1, -1}},
X    {"[ ]*use[ ]*",           			NULL, {-1, -1, -1, -1,  1, -1}},
X    {"[ ]*list[ ]*",           			NULL, {-1, -1, -1, -1,  1, -1}},
X    {"[ ]*\\(/\\|\?\\)",                      	NULL, {-1, -1, -1, -1, -1, -1}},
X    {"[ ]*print[ ]*[^ ]+",                      NULL, {-1, -1, -1, -1, -1, -1}},
X    NULL
X};
END_OF_FILE
if test 5064 -ne `wc -c <'bsd_regex.h'`; then
    echo shar: \"'bsd_regex.h'\" unpacked with wrong size!
fi
# end of 'bsd_regex.h'
fi
if test -f 'datadpy.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'datadpy.h'\"
else
echo shar: Extracting \"'datadpy.h'\" \(4425 characters\)
sed "s/^X//" >'datadpy.h' <<'END_OF_FILE'
X/*****************************************************************************
X *
X *  xdbx - X Window System interface to the dbx debugger
X *
X *  Copyright 1989 The University of Texas at Austin
X *  Copyright 1990 Microelectronics and Computer Technology Corporation
X *
X *  Permission to use, copy, modify, and distribute this software and its
X *  documentation for any purpose and without fee is hereby granted,
X *  provided that the above copyright notice appear in all copies and that
X *  both that copyright notice and this permission notice appear in
X *  supporting documentation, and that the name of The University of Texas
X *  and Microelectronics and Computer Technology Corporation (MCC) not be 
X *  used in advertising or publicity pertaining to distribution of
X *  the software without specific, written prior permission.  The
X *  University of Texas and MCC makes no representations about the 
X *  suitability of this software for any purpose.  It is provided "as is" 
X *  without express or implied warranty.
X *
X *  THE UNIVERSITY OF TEXAS AND MCC DISCLAIMS ALL WARRANTIES WITH REGARD TO
X *  THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
X *  FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF TEXAS OR MCC BE LIABLE FOR
X *  ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
X *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
X *  CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
X *  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
X *
X *  Author:  	Po Cheung
X *  Created:   	March 10, 1989
X * 
X *****************************************************************************
X * 
X *  xxgdb - X Window System interface to the gdb debugger
X *  
X * 	Copyright 1990 Thomson Consumer Electronics, Inc.
X *  
X *  Permission to use, copy, modify, and distribute this software and its
X *  documentation for any purpose and without fee is hereby granted,
X *  provided that the above copyright notice appear in all copies and that
X *  both that copyright notice and this permission notice appear in
X *  supporting documentation, and that the name of Thomson Consumer
X *  Electronics (TCE) not be used in advertising or publicity pertaining
X *  to distribution of the software without specific, written prior
X *  permission.  TCE makes no representations about the suitability of
X *  this software for any purpose.  It is provided "as is" without express
X *  or implied warranty.
X *
X *  TCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
X *  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
X *  SHALL TCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
X *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
X *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
X *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
X *  SOFTWARE.
X *
X *  Adaptation to GDB:  Pierre Willard
X *  XXGDB Created:   	December, 1990
X *
X *****************************************************************************/
X
X/*  datadpy.h:
X *
X *  Regular expression pattern matching for C structures
X *
X *  The reg_token array indicates the register no. for each token type.
X *      reg_token[0] : level of indentation
X *      reg_token[2] : field name
X *      reg_token[4] : pointer string
X */
X
X#define TK_INDENT       0
X#define TK_FIELD        2
X#define TK_POINTER      4
X
X#define D_POINTER	0
X#define D_FIELD		1
X#define D_STRUCT	2
X
X#ifdef GDB	/* >>>>>>>>>>>>  GDB ONLY <<<<<<<<<<<<<<<<<< */
X/*
X	Note : for GDB the 'set prettyprint on' must be ON.
X	
X	Exaamples "
X	
X		$3 = (struct toto *) 0x40c0
X		
X		$2 = {
X		  pt = 0x40b4,
X		  u = 5,
X		  v = 6
X		}
X*/
X
XPatternRec dataPattern[] = {
X    {"0x[0-9a-f]+", 				  
X     NULL, {-1, -1, -1, -1, -1, -1}
X    },
X    {"\\([ ]*\\)\\(.*[^ ]+\\)[ ]* = \\((.*) \\)?\\(0x[0-9a-f]+\\)[,]?[ ]*\n", 
X     NULL, { 1, -1,  2, -1,  4, -1}
X    },
X    {"\\([ ]*\\)\\(.*[^ ]*\\)[ ]* = {\n", 		  
X     NULL, { 1, -1,  2, -1, -1, -1}
X    },
X    NULL
X};
X
X#else		/* >>>>>>>>>>>>  IF NOT GDB <<<<<<<<<<<<<<<<<< */
X
XPatternRec dataPattern[] = {
X    {"0x[0-9a-f]+", 				  
X     NULL, {-1, -1, -1, -1, -1, -1}
X    },
X    {"\\([ ]*\\)\\(.*[^ ]+\\)[ ]* = \\(0x[0-9a-f]+\\)\n", 
X     NULL, { 1, -1,  2, -1,  3, -1}
X    },
X    {"\\([ ]*\\)\\(.*[^ ]*\\)[ ]* = {\n", 		  
X     NULL, { 1, -1,  2, -1, -1, -1}
X    },
X    NULL
X};
X#endif /* NOT GDB */
END_OF_FILE
if test 4425 -ne `wc -c <'datadpy.h'`; then
    echo shar: \"'datadpy.h'\" unpacked with wrong size!
fi
# end of 'datadpy.h'
fi
if test -f 'mips_regex.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'mips_regex.h'\"
else
echo shar: Extracting \"'mips_regex.h'\" \(5442 characters\)
sed "s/^X//" >'mips_regex.h' <<'END_OF_FILE'
X/*****************************************************************************
X *
X *  xdbx - X Window System interface to the dbx debugger
X *
X *  Copyright 1989 The University of Texas at Austin
X *  Copyright 1990 Microelectronics and Computer Technology Corporation
X *
X *  Permission to use, copy, modify, and distribute this software and its
X *  documentation for any purpose and without fee is hereby granted,
X *  provided that the above copyright notice appear in all copies and that
X *  both that copyright notice and this permission notice appear in
X *  supporting documentation, and that the name of The University of Texas
X *  and Microelectronics and Computer Technology Corporation (MCC) not be 
X *  used in advertising or publicity pertaining to distribution of
X *  the software without specific, written prior permission.  The
X *  University of Texas and MCC makes no representations about the 
X *  suitability of this software for any purpose.  It is provided "as is" 
X *  without express or implied warranty.
X *
X *  THE UNIVERSITY OF TEXAS AND MCC DISCLAIMS ALL WARRANTIES WITH REGARD TO
X *  THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
X *  FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF TEXAS OR MCC BE LIABLE FOR
X *  ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
X *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
X *  CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
X *  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
X *
X *  Author:  	Po Cheung
X *  Created:   	November 24, 1989
X *
X *****************************************************************************/
X
X/*  mips_regex.h:
X *
X *  Regular expression pattern matching for dbx on DECStation.
X *
X *  The reg_token array indicates the register no. for each token type.
X *      reg_token[0] : message
X *      reg_token[1] : stop number
X *      reg_token[2] : function name
X *      reg_token[3] : line number
X *      reg_token[4] : file name
X *      reg_token[5] : display command output
X */
X
X#define TK_MESG         0
X#define TK_STOP         1
X#define TK_FUNC         2
X#define TK_LINE         3
X#define TK_FILE         4
X#define TK_DISP		5
X
X#define O_EXEC          0
X#define O_DONE          1
X#define O_STOPAT        2
X#define O_STOPIN        3
X#define O_UPDOWN        4
X#define O_FUNC          4
X#define O_BELL          5
X#define O_LIST          6
X#define O_FILE          7
X#define O_SEARCH        8
X#define O_PRINT         9
X#define O_DEBUG         10
X
X#define C_ANY		-1
X#define C_EXEC          0
X#define C_STOPAT        1
X#define C_STOPIN        2
X#define C_UPDOWN        3
X#define C_DELETE        4
X#define C_FUNC          5
X#define C_FILE          6
X#define C_USE          	7
X#define C_LIST         	8
X#define C_SEARCH        9
X#define C_PRINT		10
X#define C_STATUS	11
X
X
Xstatic PatternRec output_pattern[] = {
X    /* exec */
X    {"\\(.*\n\\)*\\(\\(\\(\\(\[[0-9]+\\] \\)?\\(stopped at \\)?\\)\\|Bus error \
X\\|Segmentation fault \\|Interrupt \\)?\\[\\([^ ]+\\):\\([0-9]+\\).*\\]\\).*\n",
X     NULL,
X     {2, -1, 7, 8, -1, -1}
X    },
X    /* done */
X    {"\\(.*\n\\)*Program terminated normally\n",
X     NULL,
X     {-1, -1, -1, -1, -1, -1}
X    },
X    /* stop at */
X    {"\\[\\([0-9]+\\)\\] stop at \\(\"\\([^ ]+\\)\":\\)?\\([0-9]+\\)\n",
X     NULL,
X     {-1, 1, -1, 4, 3, -1}
X    },
X    /* stop in */
X    {"\\(\\[.*\\]\n\\)*\\[\\([0-9]+\\)\\] stop in \\([^ ]+\\)\n",
X     NULL,
X     {-1, 2, 3, -1, -1, -1}
X    },
X    /* up, down, func */
X    {"\\(.*\n\\)*\\([^ ]+\\):[ ]*\\([0-9]+\\).*\n",
X     NULL,
X     {2, -1, 2, 3, -1, -1}
X    },
X    /* bell */
X    {"\n\\(not that many levels\\|program not active\\|program is not active\\|\
Xcannot read register unless program is active\\|cannot dump unless program is \
Xactive\\)\n",
X     NULL,
X     {-1, -1, -1, -1, -1, -1}
X    },
X    /* list */
X    {"[ ]*\\([0-9]+\\).*\n",
X     NULL,
X     {-1, -1, -1, 1, -1, -1}
X    },
X    /* file */
X    {"\\([^ ]+\\)\n",
X     NULL,
X     {-1, -1, -1, -1, 1, -1}
X    },
X    /* search */
X    {"[ ]*\\([0-9]+\\).*\n",
X     NULL,
X     {-1, -1, -1, 1, -1, -1}
X    },
X    /* print */
X    {"\\(.+\n\\(.*\n\\)*\\)",
X     NULL,
X     { 1, -1, -1, -1, -1, -1}
X    },
X    /* dbx init */
X    {"\\(.*\n\\)*.*\\(dbx version .*\nType 'help' for help.\nreading symbolic \
Xinformation ...\n\\)\\(\nwarning: .*\n\\)?\\([^ ]+\\):[ ]*\\([0-9]+\\).*\n",
X     NULL,
X     {-1, -1, 4, 5, -1, -1}
X    },
X    NULL
X};
X
Xstatic PatternRec command_pattern[] = {
X    {"[ ]*\\(run\\|r\\|cont\\|c\\|next\\|n\\|step\\|s\\|return\\)\\( \\|\n\\)",
X						NULL, {-1, -1, -1, -1, -1, -1}},
X    {"[ ]*\\(stop\\|st\\)[ ]+at[ ]+[0-9]+",   	NULL, {-1, -1, -1, -1, -1, -1}},
X    {"[ ]*\\(stop\\|st\\)[ ]+in[ ]+[^ ]+",      NULL, {-1, -1, -1, -1, -1, -1}},
X    {"[ ]*\\(up\\|down\\)",                   	NULL, {-1, -1, -1, -1, -1, -1}},
X    {"[ ]*\\(delete\\|d\\)",                  	NULL, {-1, -1, -1,  1, -1, -1}},
X    {"[ ]*func[ ]*\\([^ ]+\\)[ ]*",           	NULL, {-1, -1,  1, -1, -1, -1}},
X    {"[ ]*file[ ]*",           			NULL, {-1, -1, -1, -1,  1, -1}},
X    {"[ ]*use[ ]*",           			NULL, {-1, -1, -1, -1,  1, -1}},
X    {"[ ]*list[ ]*",           			NULL, {-1, -1, -1, -1,  1, -1}},
X    {"[ ]*\\(/\\|\?\\)",                      	NULL, {-1, -1, -1, -1, -1, -1}},
X    {"[ ]*\\(print\\|p\\)[ ]*[^ ]+",            NULL, {-1, -1, -1, -1, -1, -1}},
X    {"[ ]*status[ ]*",         			NULL, {-1, -1, -1, -1,  1, -1}},
X    NULL
X};
END_OF_FILE
if test 5442 -ne `wc -c <'mips_regex.h'`; then
    echo shar: \"'mips_regex.h'\" unpacked with wrong size!
fi
# end of 'mips_regex.h'
fi
if test -f 'patchlevel.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'patchlevel.h'\"
else
echo shar: Extracting \"'patchlevel.h'\" \(21 characters\)
sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
X#define PATCHLEVEL 2
END_OF_FILE
if test 21 -ne `wc -c <'patchlevel.h'`; then
    echo shar: \"'patchlevel.h'\" unpacked with wrong size!
fi
# end of 'patchlevel.h'
fi
if test -f 'signals.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'signals.c'\"
else
echo shar: Extracting \"'signals.c'\" \(3952 characters\)
sed "s/^X//" >'signals.c' <<'END_OF_FILE'
X/*****************************************************************************
X *
X *  xdbx - X Window System interface to the dbx debugger
X *
X *  Copyright 1989 The University of Texas at Austin
X *  Copyright 1990 Microelectronics and Computer Technology Corporation
X *
X *  Permission to use, copy, modify, and distribute this software and its
X *  documentation for any purpose and without fee is hereby granted,
X *  provided that the above copyright notice appear in all copies and that
X *  both that copyright notice and this permission notice appear in
X *  supporting documentation, and that the name of The University of Texas
X *  and Microelectronics and Computer Technology Corporation (MCC) not be 
X *  used in advertising or publicity pertaining to distribution of
X *  the software without specific, written prior permission.  The
X *  University of Texas and MCC makes no representations about the 
X *  suitability of this software for any purpose.  It is provided "as is" 
X *  without express or implied warranty.
X *
X *  THE UNIVERSITY OF TEXAS AND MCC DISCLAIMS ALL WARRANTIES WITH REGARD TO
X *  THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
X *  FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF TEXAS OR MCC BE LIABLE FOR
X *  ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
X *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
X *  CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
X *  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
X *
X *  Author:  	Po Cheung
X *  Created:   	March 10, 1989
X *
X *****************************************************************************/
X
X/* signals.c
X *
X *   Signal handling for xdbx and dbx.
X *
X *   kill_hanlder():	For SIGINT, SIGQUIT, SIGILL, SIGBUS, SIGTERM
X *			print error message and exit with signal status.
X *   quit_handler():	SIGCHLD, wait for dbx to die and exit gracefully.
X *   stop_handler():	SIGTSTP, stop dbx process, then stop own process.
X *   cont_handler():	SIGCONT, continue dbx process.
X *   trap_signals():	Install signal handlers.
X */
X
X#include <signal.h>
X#include <sys/wait.h>
X#include "global.h"
X
X/*  Kill the dbx child process and then exits. */
X/*  ARGSUSED */
Xstatic void kill_handler(sig, code, scp, addr)
X    int sig, code;
X    struct sigcontext *scp;
X    char *addr;
X{
X    if (FalseSignal) {
X	FalseSignal = FALSE;
X	return;
X    }
X    kill(dbxpid, SIGKILL);
X    switch (sig) {
X      case SIGINT  : fprintf(stderr, "Interrupt\n"); break;
X      case SIGQUIT : fprintf(stderr, "Quit\n"); break;
X      case SIGILL  : fprintf(stderr, "Illegal instruction\n"); break;
X      case SIGBUS  : fprintf(stderr, "Bus error\n"); break;
X      case SIGSEGV : fprintf(stderr, "Segmentation violation\n"); break;
X      case SIGTERM : fprintf(stderr, "Soft kill\n"); break;
X    }
X    exit(sig);
X}
X
X
Xstatic void quit_handler()
X{
X    union wait status;
X
X    /*  wait for the child to report its status; if the child has died, 
X     *  exit gracefully.
X     */
X    wait3(&status, WNOHANG|WUNTRACED, NULL);
X    if ((WIFEXITED(status) || WIFSIGNALED(status)) && !WIFSTOPPED(status)) {
X    	exit(1);
X    }
X}
X
X
Xstatic void stop_handler()
X{
X    if (dbxpid)
X	kill(dbxpid, SIGSTOP);	/* stop dbx process */
X    kill(0, SIGSTOP);		/* stop own process */
X}
X
X
Xstatic void cont_handler()
X{
X    if (dbxpid) {
X	sleep(1);		/* we need this */
X	kill(dbxpid, SIGCONT);	/* continue dbx after stop */
X    }
X}
X
X
X/*
X *  Trap signals to xdbx so that the child process can be handled properly.
X */
Xvoid trap_signals()
X{
X    signal(SIGINT,  kill_handler);
X    signal(SIGQUIT, kill_handler);
X    signal(SIGILL,  kill_handler);
X    signal(SIGBUS,  kill_handler);
X    signal(SIGSEGV, kill_handler);
X    signal(SIGTERM, kill_handler);
X
X    signal(SIGTSTP, stop_handler);	/* stop signal from keyboard */
X    signal(SIGCONT, cont_handler);	/* continue after stop */
X    signal(SIGCHLD, quit_handler);	/* child status has changed */
X}
END_OF_FILE
if test 3952 -ne `wc -c <'signals.c'`; then
    echo shar: \"'signals.c'\" unpacked with wrong size!
fi
# end of 'signals.c'
fi
if test -f 'sun_regex.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'sun_regex.h'\"
else
echo shar: Extracting \"'sun_regex.h'\" \(5571 characters\)
sed "s/^X//" >'sun_regex.h' <<'END_OF_FILE'
X/*****************************************************************************
X *
X *  xdbx - X Window System interface to the dbx debugger
X *
X *  Copyright 1989 The University of Texas at Austin
X *  Copyright 1990 Microelectronics and Computer Technology Corporation
X *
X *  Permission to use, copy, modify, and distribute this software and its
X *  documentation for any purpose and without fee is hereby granted,
X *  provided that the above copyright notice appear in all copies and that
X *  both that copyright notice and this permission notice appear in
X *  supporting documentation, and that the name of The University of Texas
X *  and Microelectronics and Computer Technology Corporation (MCC) not be 
X *  used in advertising or publicity pertaining to distribution of
X *  the software without specific, written prior permission.  The
X *  University of Texas and MCC makes no representations about the 
X *  suitability of this software for any purpose.  It is provided "as is" 
X *  without express or implied warranty.
X *
X *  THE UNIVERSITY OF TEXAS AND MCC DISCLAIMS ALL WARRANTIES WITH REGARD TO
X *  THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
X *  FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF TEXAS OR MCC BE LIABLE FOR
X *  ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
X *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
X *  CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
X *  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
X *
X *  Author:  	Po Cheung
X *  Created:   	March 10, 1989
X *
X *****************************************************************************/
X
X/*  sun_regex.h:
X *
X *  Regular expression pattern matching for Sun dbx.
X *  
X *  The reg_token array indicates the register no. for each token type.
X *      reg_token[0] : message
X *      reg_token[1] : stop number
X *      reg_token[2] : function name
X *      reg_token[3] : line number
X *      reg_token[4] : file name
X *      reg_token[5] : display command output
X */
X
X#define	TK_MESG 	0
X#define TK_STOP		1
X#define TK_FUNC 	2
X#define TK_LINE 	3
X#define TK_FILE 	4
X#define TK_DISP 	5
X
X#define	O_EXEC		0
X#define O_DONE		1
X#define O_STOPAT 	2
X#define O_STOPIN 	3
X#define O_UPDOWN 	4
X#define O_BELL		5
X#define O_LIST		6
X#define O_SEARCH        6
X#define O_FILE		7
X#define O_PRINT         8
X#define O_DEBUG         9
X
X#define	C_ANY		-1
X#define C_EXEC		0
X#define C_STOPAT	1
X#define C_STOPIN	2
X#define C_UPDOWN	3
X#define C_DELETE	4
X#define C_FUNC		5
X#define C_FILE		6
X#define C_DEBUG		7
X#define C_CD		8
X#define C_USE           9
X#define C_PWD           10
X#define C_LIST          11
X#define C_SEARCH        12
X#define C_DISPLAY       13
X#define C_PRINT         14
X
Xstatic PatternRec output_pattern[] = {
X    /* exec */
X    {"\\(.*\n\\)*.*\\(\\(stopped\\|Bus error\\|Segmentation fault\\|\
XInterrupt\\|signal.*\\) in \\([^ ]+\\) at line \\([0-9]+\\)\\( in file\
X \"\\([^ ]+\\)\"\\)?\\)\n\\(.*\n\\)?\\(\\(.*\n\\)*\\)", 
X     NULL,
X     {2, -1, 4, 5, 7, 9}
X    },
X    /* done */
X    {"\\(.*\n\\)*\\(execution completed\\|program exited with [0-9]+\\)",
X     NULL,
X     {-1, -1, -1, -1, -1, -1}
X    },
X    /* stop at */
X    {"(\\([0-9]+\\)) stop at \\(\"\\([^ ]+\\)\":\\)?\\([0-9]+\\)\n",
X     NULL,
X     {-1, 1, -1, 4, 3, -1}
X    },
X    /* stop in */
X    {"(\\([0-9]+\\)) stop in \\([^ ]+\\)\n",
X     NULL,
X     {-1, 1, 2, -1, -1, -1}
X    },
X    /* up, down */
X    {"\\(.*\n\\)?\\(Current function is \\([^ ]+\\)\n\\)\\([ ]*\\([0-9]+\\).*\n\\)",
X     NULL,
X     {2, -1, 3, 5, -1, -1}
X    },
X    /* bell */
X    {"\\(Already at the \\(top\\|bottom\\) call level\n\\|\
XNo active stack frames\n\\|no program to run\n\\|no process to run\n\\|\
Xprogram is not active\n\\|can't continue execution\n\\|\
X.*\ncan't write to process.*\n\\|\
X\\(Top\\|End\\)-of-file; did not find search string:.*\n\\)",
X     NULL,
X     {-1, -1, -1, -1, -1}
X    },
X    /* list, search */
X    {"[ ]*\\([0-9]+\\).*\n",
X     NULL,
X     {-1, -1, -1, 1, -1, -1}
X    },
X    /* file */
X    {"\\(\\([^ ]*\\)\\|No current source file\\)\n",
X     NULL,
X     {-1, -1, -1, -1, 2, -1}
X    },
X    /* print, display */
X    {"\\(warning: .*\n\\)?\\(\\(.*\\) = .*\n\\(.*\n\\)*\\)",
X     NULL,
X     { 3, -1, -1, -1, -1, 2}
X    },
X    /* debug */
X    {"Reading symbolic information...\nRead [0-9]+ symbols\n",
X     NULL,
X     { -1, -1, -1, -1, -1, -1}
X    },
X    NULL 
X};
X
X
Xstatic PatternRec command_pattern[] = {
X    {"[ ]*\\(run\\|rerun\\|cont\\|next\\|step\\)\\( [0-9]+\\)?[ ]*", 	
X						NULL, {-1, -1, -1, -1, -1, -1}},
X    {"[ ]*stop[ ]+at[ ]+\\(\"[^ ]+\":\\)?[0-9]+[ ]*\n", 		
X						NULL, {-1, -1, -1, -1, -1, -1}},
X    {"[ ]*stop[ ]+in[ ]+[^ ]+[ ]*\n", 		NULL, {-1, -1, -1, -1, -1, -1}},
X    {"[ ]*\\(up\\|down\\)[ ]*\\( [0-9]+\\)?[ ]*\n", 		
X						NULL, {-1, -1, -1, -1, -1, -1}},
X    {"[ ]*\\(delete\\|d\\)[ ]+\\(all\\|[0-9]+\\)",	
X						NULL, {-1, -1, -1,  1, -1, -1}},
X    {"[ ]*func[ ]+\\([^ ]+\\)[ ]*\n", 		NULL, {-1, -1,  1, -1, -1, -1}},
X    {"[ ]*file[ ]*\\([^ ]+\\)?[ ]*\n",		NULL, {-1, -1, -1, -1, -1, -1}},
X    {"[ ]*debug[ ]*[^ ]+[ ]*\n", 		NULL, {-1, -1, -1, -1, -1, -1}},
X    {"[ ]*cd[ ]*[^ ]+[ ]*", 			NULL, {-1, -1, -1, -1, -1, -1}},
X    {"[ ]*use[ ]*", 				NULL, {-1, -1, -1, -1, -1, -1}},
X    {"[ ]*pwd[ ]*\n",				NULL, {-1, -1, -1, -1, -1, -1}},
X    {"[ ]*list[ ]*",				NULL, {-1, -1, -1, -1, -1, -1}},
X    {"[ ]*\\(/\\|\?\\)[ ]*",			NULL, {-1, -1, -1, -1, -1, -1}},
X    {"[ ]*\\(un\\)?display[ ]*[^ ]+[ ]*",	NULL, {-1, -1, -1, -1, -1, -1}},
X    {"[ ]*print[ ]*[^ ]+[ ]*",			NULL, {-1, -1, -1, -1, -1, -1}},
X    NULL
X};
END_OF_FILE
if test 5571 -ne `wc -c <'sun_regex.h'`; then
    echo shar: \"'sun_regex.h'\" unpacked with wrong size!
fi
# end of 'sun_regex.h'
fi
if test -f 'utils.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'utils.c'\"
else
echo shar: Extracting \"'utils.c'\" \(4029 characters\)
sed "s/^X//" >'utils.c' <<'END_OF_FILE'
X/*****************************************************************************
X *
X *  xdbx - X Window System interface to the dbx debugger
X *
X *  Copyright 1989 The University of Texas at Austin
X *  Copyright 1990 Microelectronics and Computer Technology Corporation
X *
X *  Permission to use, copy, modify, and distribute this software and its
X *  documentation for any purpose and without fee is hereby granted,
X *  provided that the above copyright notice appear in all copies and that
X *  both that copyright notice and this permission notice appear in
X *  supporting documentation, and that the name of The University of Texas
X *  and Microelectronics and Computer Technology Corporation (MCC) not be 
X *  used in advertising or publicity pertaining to distribution of
X *  the software without specific, written prior permission.  The
X *  University of Texas and MCC makes no representations about the 
X *  suitability of this software for any purpose.  It is provided "as is" 
X *  without express or implied warranty.
X *
X *  THE UNIVERSITY OF TEXAS AND MCC DISCLAIMS ALL WARRANTIES WITH REGARD TO
X *  THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
X *  FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF TEXAS OR MCC BE LIABLE FOR
X *  ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
X *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
X *  CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
X *  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
X *
X *  Author:  	Po Cheung
X *  Created:   	March 10, 1989
X *
X *****************************************************************************/
X
X/*  utils.c
X *
X *    Contain common routines used by other functions.
X *
X *    TextGetLastPos():		Get the last insertion position of text.
X *    TextPositionToLine(): 	Return text position give a line number.
X *    LineToStopNo():		Return the stop number given a line number.
X *    DisableWindowResize():	Fix the size of a window inside vpane.
X *    bell():			Ring the bell.
X *    concat():			Concatenate two strings together
X */
X
X#include "global.h"
X
XXawTextPosition TextGetLastPos(w)
X    Widget w;
X{
X    TextWidget ctx = (TextWidget) w;
X    return (ctx->text.lastPos);
X}
X
X/*
X * Get the line number where the caret is.
X */
Xint TextPositionToLine(pos)
XXawTextPosition pos;
X{
X    int line;
X
X    if (displayedFile) {
X	if (pos >= displayedFile->linepos[displayedFile->topline]) {
X	    for (line = displayedFile->topline;
X		 pos > displayedFile->linepos[line]; line++);
X	    return (pos == displayedFile->linepos[line] ? line : line-1);
X	}
X	else {
X	    for (line = 1; pos > displayedFile->linepos[line]; line++);
X	    return (pos == displayedFile->linepos[line] ? line : line-1);
X	}
X    }
X    else
X        return 0;
X}
X
X/*
X *  Return the stop number associated with a given line number.
X *  Return 0 if stop number not found.
X */
Xint LineToStop_no(line)
Xint line;
X{
X    int i;
X
X    for (i=1; i <= nstops; i++)
X        if (stops[i].line == line && stops[i].file && displayedFile &&
X            strcmp(stops[i].file, displayedFile->pathname) == NULL) {
X            return i;
X        }
X    return 0;
X}
X
X
Xvoid DisableWindowResize(w)
XWidget w;
X{
X    Arg args[MAXARGS];
X    Cardinal n;
X    Dimension height;
X
X    n = 0;
X    XtSetArg(args[n], XtNheight, &height);                       n++;
X    XtGetValues(w, args, n);
X    XawPanedSetMinMax(w, height, height);
X    XawPanedAllowResize(w, False);
X}
X
X
Xvoid bell(volume)
Xint volume;
X{
X    XBell(XtDisplay(toplevel), volume);
X}
X
X/* append string s2 to end of string s1 and return the result */
X
Xchar *concat(s1, s2)
Xchar *s1, *s2;
X{
X    if (s2) {
X        if (s1 == NULL) {
X            s1 = XtMalloc((strlen(s2)+1)*sizeof(char));
X            strcpy(s1, s2);
X        }
X        else {
X            s1 = XtRealloc(s1, strlen(s1)+strlen(s2)+2);
X            strcat(s1, s2);
X        }
X    }
X#if 0	/*(PW)4DEC90 : bug ! if s2 is null, there is no reason to set s1 to 0 */
X    else
X        s1 = NULL;
X#endif
X    return (s1);
X}
END_OF_FILE
if test 4029 -ne `wc -c <'utils.c'`; then
    echo shar: \"'utils.c'\" unpacked with wrong size!
fi
# end of 'utils.c'
fi
if test -f 'windows.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'windows.c'\"
else
echo shar: Extracting \"'windows.c'\" \(6616 characters\)
sed "s/^X//" >'windows.c' <<'END_OF_FILE'
X/*****************************************************************************
X *
X *  xdbx - X Window System interface to dbx
X *
X *  Copyright 1989, 1990 The University of Texas at Austin
X *
X *  Permission to use, copy, modify, and distribute this software and its
X *  documentation for any purpose and without fee is hereby granted,
X *  provided that the above copyright notice appear in all copies and that
X *  both that copyright notice and this permission notice appear in
X *  supporting documentation, and that the name of The University of Texas
X *  not be used in advertising or publicity pertaining to distribution of
X *  the software without specific, written prior permission.  The
X *  University of Texas makes no representations about the suitability of
X *  this software for any purpose.  It is provided "as is" without express
X *  or implied warranty.
X *
X *  THE UNIVERSITY OF TEXAS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
X *  SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
X *  FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF TEXAS BE LIABLE FOR ANY
X *  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
X *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
X *  CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
X *  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
X *
X *  Author:  	Po Cheung, The University of Texas at Austin
X *  Created:   	March 10, 1989
X *
X *****************************************************************************/
X
X/*  windows.c:
X *
X *    CreateTitleBar() :	Create title bar.
X *    CreateFileLabel() :	Create file label in file window.
X *    CreateLineLabel() :	Create line label in file window.
X *    CreateFileWindow() :	Create file window.
X *    CreateMessageWindow() :	Create message window.
X *    CreateDisplayWindow() :	Create display window.
X *    CreateSubWindows() :	Create the subwindows.
X *    UpdateFileLabel() :	Update file label.
X *    UpdateLineLabel() :	Update line label.
X *    UpdateMessageWindow() :	Update message window.
X */
X
X#include "global.h"
X
XWidget	fileWindow,			/* parent of fileLabel and lineLabel */
X	messageWindow,			/* window for displaying messages */
X	separator,			/* separator in vpane */
X	displayWindow;			/* area for displaying variables */
X
Xstatic Widget 	fileLabel,		/* filename of displayed text */
X		lineLabel;		/* line number of caret position */
X
X/*
X *  Private routines for creating various subwindows for xdbx.
X */
X
Xstatic void CreateFileLabel(parent)
XWidget parent;
X{
X    Arg 	args[MAXARGS];
X    Cardinal 	n;
X
X    n = 0;
X    XtSetArg(args[n], XtNlabel, (XtArgVal) "No Source File");           n++;
X    XtSetArg(args[n], XtNborderWidth, (XtArgVal) 0);           		n++;
X    fileLabel = XtCreateManagedWidget("fileLabel", labelWidgetClass, 
X				      parent, args, n);
X}
X
Xstatic void CreateLineLabel(parent)
XWidget parent;
X{
X    Arg 	args[MAXARGS];
X    Cardinal 	n;
X
X    n = 0;
X    XtSetArg(args[n], XtNlabel, (XtArgVal) "");           		n++;
X    XtSetArg(args[n], XtNborderWidth, (XtArgVal) 0);           		n++;
X    XtSetArg(args[n], XtNfromHoriz, (XtArgVal) fileLabel);          	n++;
X    XtSetArg(args[n], XtNhorizDistance, (XtArgVal) 0);          	n++;
X    lineLabel = XtCreateManagedWidget("lineLabel", labelWidgetClass, 
X				      parent, args, n);
X}
X
Xstatic void CreateFileWindow(parent)
XWidget parent;
X{
X    Arg 	args[MAXARGS];
X    Cardinal 	n;
X
X    n = 0;
X    XtSetArg(args[n], XtNshowGrip, (XtArgVal) False);			n++;
X    fileWindow = XtCreateManagedWidget("fileWindow", formWidgetClass, 
X				       parent, args, n);
X    CreateFileLabel(fileWindow);
X    CreateLineLabel(fileWindow);
X}
X
Xstatic void CreateMessageWindow(parent)
XWidget parent;
X{
X    Arg 	args[MAXARGS];
X    Cardinal 	n;
X
X    n = 0;
X    XtSetArg(args[n], XtNlabel, (XtArgVal) ""); 			n++;
X    XtSetArg(args[n], XtNjustify, (XtArgVal) XtJustifyLeft);          	n++;
X    XtSetArg(args[n], XtNshowGrip, (XtArgVal) False);			n++;
X    messageWindow = XtCreateManagedWidget("messageWindow", labelWidgetClass,
X					  parent, args, n);
X}
X
X/*  Create a window for displaying variables as specified by the display
X *  command in dbx.
X */
Xstatic void CreateDisplayWindow(parent)
XWidget parent;
X{
X    Arg 	args[MAXARGS];
X    Cardinal 	n;
X
X    n = 0;
X    XtSetArg(args[n], XtNborderWidth, (XtArgVal) 0);                    n++;
X    XtSetArg(args[n], XtNmin, (XtArgVal) 2); 				n++;
X    XtSetArg(args[n], XtNmax, (XtArgVal) 2); 				n++;
X    XtSetArg(args[n], XtNshowGrip, (XtArgVal) False);			n++;
X    separator = XtCreateWidget("", labelWidgetClass, parent, args, n);
X
X    n = 0;
X    XtSetArg(args[n], XtNeditType, (XtArgVal) XawtextRead);		n++;
X    displayWindow = XtCreateWidget("displayWindow", asciiTextWidgetClass, 
X				   parent, args, n);
X
X    if (app_resources.displayWindow) {
X	XtManageChild(separator);
X	XtManageChild(displayWindow);
X    }
X}
X
X
X/*  PUBLIC ROUTINES */
X/*
X *  Top level function for creating all the xdbx subwindows.
X */
Xvoid CreateSubWindows(parent)
XWidget parent;
X{
X    Widget	vpane;		/* outer widget containing various subwindows */
X    Arg 	args[MAXARGS];
X    Cardinal 	n;
X
X    n = 0;
X    vpane = XtCreateManagedWidget("vpane", panedWidgetClass, parent, args, n);
X
X    CreateFileWindow(vpane);
X    CreateSourceWindow(vpane);
X    CreateMessageWindow(vpane);
X    CreateCommandPanel(vpane);
X    CreateDialogWindow(vpane);
X#ifndef BSD
X    CreateDisplayWindow(vpane);
X#endif
X} 
X
X/*
X *  Routines for updating fields for the filename and line number
X *  in the file window, and the execution status in the message window.
X */
X
Xvoid UpdateFileLabel(string)
Xchar *string;
X{
X    Arg 	args[MAXARGS];
X    Cardinal 	n;
X
X    n = 0;
X    XtSetArg(args[n], XtNlabel, (XtArgVal) string);        		n++;
X    XtSetValues(fileLabel, args, n);
X}
X
Xvoid UpdateLineLabel(line)
XCardinal line;
X{
X    Arg 	args[MAXARGS];
X    Cardinal 	n;
X    char 	string[10];
X
X    n = 0;
X    if (line > 0)
X    	sprintf(string, "%d", line);
X    else
X	strcpy(string, "");
X    XtSetArg(args[n], XtNlabel, (XtArgVal) string);        	n++;
X    XtSetValues(lineLabel, args, n);
X}
X
Xvoid UpdateMessageWindow(format, arg)
Xchar *format, *arg;
X{
X    char 	message[LINESIZ], string[LINESIZ];
X    Arg 	args[MAXARGS];
X    Cardinal 	n;
X
X    strcpy(message, "  ");
X    sprintf(string, format, arg);
X    strcat(message, string);
X    n = 0;
X    XtSetArg(args[n], XtNlabel, (XtArgVal) message);		n++;
X    XtSetValues(messageWindow, args, n);
X}
X
Xvoid ClearMessageWindow()
X{
X    Arg 	args[MAXARGS];
X    Cardinal 	n;
X
X    n = 0;
X    XtSetArg(args[n], XtNlabel, (XtArgVal) "");			n++;
X    XtSetValues(messageWindow, args, n);
X}
X
END_OF_FILE
if test 6616 -ne `wc -c <'windows.c'`; then
    echo shar: \"'windows.c'\" unpacked with wrong size!
fi
# end of 'windows.c'
fi
echo shar: End of archive 1 \(of 8\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 8 archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0

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