Path: uunet!lll-winken!sun-barr!newstop!male!jethro!exodus!tce.COM
From: pierre@tce.COM (Pierre Willard)
Newsgroups: comp.sources.x
Subject: REPOST: v11i043: xxgdb - X front end for gdb, Part02/08
Message-ID: <9285@exodus.Eng.Sun.COM>
Date: 7 Mar 91 08:18:53 GMT
References: <csx-11i042:xxgdb@uunet.UU.NET>
Sender: news@exodus.Eng.Sun.COM
Lines: 1552
Approved: argv@sun.com

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



#! /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 2 (of 8)."
# Contents:  Makefile bitmaps.h calldbx.c dbx.c defs.h global.h
# Wrapped by gilbert@phi on Tue Jan 15 13:12:46 1991
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Makefile'\"
else
echo shar: Extracting \"'Makefile'\" \(10080 characters\)
sed "s/^X//" >'Makefile' <<'END_OF_FILE'
X# Makefile generated by imake - do not edit!
X# $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $
X#
X# The cpp used on this machine replaces all newlines and multiple tabs and
X# spaces in a macro expansion with a single space.  Imake tries to compensate
X# for this, but is not always successful.
X#
X
X###########################################################################
X# Makefile generated from "Imake.tmpl" and <Imakefile>
X# $XConsortium: Imake.tmpl,v 1.77 89/12/18 17:01:37 jim Exp $
X#
X# Platform-specific parameters may be set in the appropriate .cf
X# configuration files.  Site-wide parameters may be set in the file
X# site.def.  Full rebuilds are recommended if any parameters are changed.
X#
X# If your C preprocessor doesn't define any unique symbols, you'll need
X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
X# "make Makefile", "make Makefiles", or "make World").
X#
X# If you absolutely can't get imake to work, you'll need to set the
X# variables at the top of each Makefile as well as the dependencies at the
X# bottom (makedepend will do this automatically).
X#
X
X###########################################################################
X# platform-specific configuration parameters - edit sun.cf to change
X
X# platform:  $XConsortium: sun.cf,v 1.38 89/12/23 16:10:10 jim Exp $
X# operating system:  SunOS 4.1
X
X###########################################################################
X# site-specific configuration parameters - edit site.def to change
X
X# site:  $XConsortium: site.def,v 1.21 89/12/06 11:46:50 jim Exp $
X
X            SHELL = /bin/sh
X
X              TOP = /net/pi/usr/X11R4/mit
X      CURRENT_DIR = .
X
X               AR = ar cq
X  BOOTSTRAPCFLAGS =
X               CC = cc
X
X         COMPRESS = compress
X              CPP = /lib/cpp $(STD_CPP_DEFINES)
X    PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
X          INSTALL = install
X               LD = ld
X             LINT = lint
X      LINTLIBFLAG = -C
X         LINTOPTS = -axz
X               LN = ln -s
X             MAKE = make
X               MV = mv
X               CP = cp
X           RANLIB = ranlib
X  RANLIBINSTFLAGS =
X               RM = rm -f
X     STD_INCLUDES =
X  STD_CPP_DEFINES =
X      STD_DEFINES =
X EXTRA_LOAD_FLAGS =
X  EXTRA_LIBRARIES =
X             TAGS = ctags
X
X    SHAREDCODEDEF = -DSHAREDCODE
X         SHLIBDEF = -DSUNSHLIB
X
X    PROTO_DEFINES =
X
X     INSTPGMFLAGS =
X
X     INSTBINFLAGS = -m 0755
X     INSTUIDFLAGS = -m 4755
X     INSTLIBFLAGS = -m 0664
X     INSTINCFLAGS = -m 0444
X     INSTMANFLAGS = -m 0444
X     INSTDATFLAGS = -m 0444
X    INSTKMEMFLAGS = -m 4755
X
X          DESTDIR =
X
X     TOP_INCLUDES = -I$(TOP)
X
X      CDEBUGFLAGS = -O
X        CCOPTIONS =
X      COMPATFLAGS =
X
X      ALLINCLUDES = $(STD_INCLUDES) $(TOP_INCLUDES) $(INCLUDES) $(EXTRA_INCLUDES)
X       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS)
X           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
X        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
X           LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
X        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS)
X   LDCOMBINEFLAGS = -X -r
X
X        MACROFILE = sun.cf
X           RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
X
X    IMAKE_DEFINES =
X
X         IRULESRC = $(CONFIGSRC)
X        IMAKE_CMD = $(NEWTOP)$(IMAKE) -I$(NEWTOP)$(IRULESRC) $(IMAKE_DEFINES)
X
X     ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
X			$(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
X			$(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
X
X###########################################################################
X# X Window System Build Parameters
X# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
X
X###########################################################################
X# X Window System make variables; this need to be coordinated with rules
X# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
X
X          PATHSEP = /
X        USRLIBDIR = $(DESTDIR)/usr/lib
X           BINDIR = $(DESTDIR)/usr/bin/X11
X          INCROOT = $(DESTDIR)/usr/include
X     BUILDINCROOT = $(TOP)
X      BUILDINCDIR = $(BUILDINCROOT)/X11
X      BUILDINCTOP = ..
X           INCDIR = $(INCROOT)/X11
X           ADMDIR = $(DESTDIR)/usr/adm
X           LIBDIR = $(USRLIBDIR)/X11
X        CONFIGDIR = $(LIBDIR)/config
X       LINTLIBDIR = $(USRLIBDIR)/lint
X
X          FONTDIR = $(LIBDIR)/fonts
X         XINITDIR = $(LIBDIR)/xinit
X           XDMDIR = $(LIBDIR)/xdm
X           AWMDIR = $(LIBDIR)/awm
X           TWMDIR = $(LIBDIR)/twm
X           GWMDIR = $(LIBDIR)/gwm
X          MANPATH = $(DESTDIR)/usr/man
X    MANSOURCEPATH = $(MANPATH)/man
X           MANDIR = $(MANSOURCEPATH)n
X        LIBMANDIR = $(MANSOURCEPATH)3
X      XAPPLOADDIR = $(LIBDIR)/app-defaults
X
X        SOXLIBREV = 4.2
X          SOXTREV = 4.0
X         SOXAWREV = 4.0
X        SOOLDXREV = 4.0
X         SOXMUREV = 4.0
X        SOXEXTREV = 4.0
X
X       FONTCFLAGS = -t
X
X     INSTAPPFLAGS = $(INSTDATFLAGS)
X
X            IMAKE = $(IMAKESRC)/imake
X           DEPEND = $(DEPENDSRC)/makedepend
X              RGB = $(RGBSRC)/rgb
X            FONTC = $(BDFTOSNFSRC)/bdftosnf
X        MKFONTDIR = $(MKFONTDIRSRC)/mkfontdir
X        MKDIRHIER = /bin/sh $(SCRIPTSRC)/mkdirhier.sh
X
X        CONFIGSRC = $(TOP)/config
X        CLIENTSRC = $(TOP)/clients
X          DEMOSRC = $(TOP)/demos
X           LIBSRC = $(TOP)/lib
X          FONTSRC = $(TOP)/fonts
X       INCLUDESRC = $(TOP)/X11
X        SERVERSRC = $(TOP)/server
X          UTILSRC = $(TOP)/util
X        SCRIPTSRC = $(UTILSRC)/scripts
X       EXAMPLESRC = $(TOP)/examples
X       CONTRIBSRC = $(TOP)/../contrib
X           DOCSRC = $(TOP)/doc
X           RGBSRC = $(TOP)/rgb
X        DEPENDSRC = $(UTILSRC)/makedepend
X         IMAKESRC = $(CONFIGSRC)
X         XAUTHSRC = $(LIBSRC)/Xau
X          XLIBSRC = $(LIBSRC)/X
X           XMUSRC = $(LIBSRC)/Xmu
X       TOOLKITSRC = $(LIBSRC)/Xt
X       AWIDGETSRC = $(LIBSRC)/Xaw
X       OLDXLIBSRC = $(LIBSRC)/oldX
X      XDMCPLIBSRC = $(LIBSRC)/Xdmcp
X      BDFTOSNFSRC = $(FONTSRC)/bdftosnf
X     MKFONTDIRSRC = $(FONTSRC)/mkfontdir
X     EXTENSIONSRC = $(TOP)/extensions
X
X  DEPEXTENSIONLIB = $(EXTENSIONSRC)/lib/libXext.a
X     EXTENSIONLIB =   $(DEPEXTENSIONLIB)
X
X          DEPXLIB = $(DEPEXTENSIONLIB)
X             XLIB = $(EXTENSIONLIB) -L$(XLIBSRC) -lX11
X
X      DEPXAUTHLIB = $(XAUTHSRC)/libXau.a
X         XAUTHLIB =  $(DEPXAUTHLIB)
X
X        DEPXMULIB =
X           XMULIB = -L$(XMUSRC) -lXmu
X
X       DEPOLDXLIB =
X          OLDXLIB = -L$(OLDXLIBSRC) -loldX
X
X      DEPXTOOLLIB =
X         XTOOLLIB = -L$(TOOLKITSRC) -lXt
X
X        DEPXAWLIB =
X           XAWLIB = -L$(AWIDGETSRC) -lXaw
X
X LINTEXTENSIONLIB = $(EXTENSIONSRC)/lib/llib-lXext.ln
X         LINTXLIB = $(XLIBSRC)/llib-lX11.ln
X          LINTXMU = $(XMUSRC)/llib-lXmu.ln
X        LINTXTOOL = $(TOOLKITSRC)/llib-lXt.ln
X          LINTXAW = $(AWIDGETSRC)/llib-lXaw.ln
X
X          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
X
X         DEPLIBS1 = $(DEPLIBS)
X         DEPLIBS2 = $(DEPLIBS)
X         DEPLIBS3 = $(DEPLIBS)
X
X###########################################################################
X# Imake rules for building libraries, programs, scripts, and data files
X# rules:  $XConsortium: Imake.rules,v 1.67 89/12/18 17:14:15 jim Exp $
X
X###########################################################################
X# start of Imakefile
X
XDEFGDB =  -DGDB -g
X
X        DEFINES = -DSUNOS4 $(DEFGDB)
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 PROGRAM = xxgdb
X
Xall:: xxgdb
X
Xxxgdb: $(OBJS) $(DEPLIBS)
X	$(RM) $@
X	$(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
X
Xsaber_xxgdb:
X	#load $(ALLDEFINES) $(SRCS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
X
Xosaber_xxgdb:
X	#load $(ALLDEFINES) $(OBJS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
X
Xinstall:: xxgdb
X	$(INSTALL) -c $(INSTPGMFLAGS)   xxgdb $(BINDIR)
X
Xinstall.man:: xxgdb.man
X	$(INSTALL) -c $(INSTMANFLAGS) xxgdb.man $(MANDIR)/xxgdb.n
X
Xdepend:: $(DEPEND)
X
X$(DEPEND):
X	@echo "checking $@ over in $(DEPENDSRC) first..."; \
X	cd $(DEPENDSRC); $(MAKE); \
X	echo "okay, continuing in $(CURRENT_DIR)"
X
Xdepend::
X	$(DEPEND) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
X
Xlint:
X	$(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
Xlint1:
X	$(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
X
Xclean::
X	$(RM) $(PROGRAM)
X
Xinstall:: XDbx.ad
X	$(INSTALL) -c $(INSTAPPFLAGS) XDbx.ad $(XAPPLOADDIR)/XDbx
X
Xhandler.o: gdb_handler.c
X
Xparser.o: gdb_parser.c gdb_regex.h
X
X###########################################################################
X# common rules for all Makefiles - do not edit
X
Xemptyrule::
X
Xclean::
X	$(RM_CMD) \#*
X
XMakefile:: $(IMAKE)
X
X$(IMAKE):
X	@(cd $(IMAKESRC); if [ -f Makefile ]; then \
X	echo "checking $@ in $(IMAKESRC) first..."; $(MAKE) all; else \
X	echo "bootstrapping $@ from Makefile.ini in $(IMAKESRC) first..."; \
X	$(MAKE) -f Makefile.ini BOOTSTRAPCFLAGS=$(BOOTSTRAPCFLAGS); fi; \
X	echo "okay, continuing in $(CURRENT_DIR)")
X
XMakefile::
X	-@if [ -f Makefile ]; then \
X	echo "	$(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
X	$(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
X	else exit 0; fi
X	$(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
X
Xtags::
X	$(TAGS) -w *.[ch]
X	$(TAGS) -xw *.[ch] > TAGS
X
Xsaber:
X	#load $(ALLDEFINES) $(SRCS)
X
Xosaber:
X	#load $(ALLDEFINES) $(OBJS)
X
X###########################################################################
X# empty rules for directories that do not have SUBDIRS - do not edit
X
Xinstall::
X	@echo "install in $(CURRENT_DIR) done"
X
Xinstall.man::
X	@echo "install.man in $(CURRENT_DIR) done"
X
XMakefiles::
X
Xincludes::
X
X###########################################################################
X# dependencies generated by makedepend
X
END_OF_FILE
if test 10080 -ne `wc -c <'Makefile'`; then
    echo shar: \"'Makefile'\" unpacked with wrong size!
fi
# end of 'Makefile'
fi
if test -f 'bitmaps.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'bitmaps.h'\"
else
echo shar: Extracting \"'bitmaps.h'\" \(8509 characters\)
sed "s/^X//" >'bitmaps.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:   	April 9, 1990
X *
X *****************************************************************************/
X
X/*  bitmaps.h
X *
X *    Contain bitmap data for a 48x48 and a 64x64 xdbx icon, and the 
X *	stop sign, execution arrow, up-down arrow, and bomb sign used 
X *	in the source window.
X */
X
X/* bitmap data for 48x48 xdbx icon */
X
X#define xdbx48_width 48
X#define xdbx48_height 48
Xstatic char xdbx48_bits[] = {
X   0xff, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0xf0,
X   0xfc, 0x3f, 0x00, 0x00, 0x00, 0x78, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x3c,
X   0xf8, 0x7f, 0x00, 0x02, 0x00, 0x3c, 0xf0, 0xff, 0x00, 0x02, 0x00, 0x1e,
X   0xe0, 0xff, 0x01, 0x04, 0x00, 0x0f, 0xe0, 0xff, 0x01, 0x04, 0x80, 0x07,
X   0xc0, 0xff, 0xe3, 0xff, 0xc0, 0x03, 0x80, 0xff, 0x1f, 0x01, 0xc7, 0x03,
X   0x00, 0xff, 0x27, 0x01, 0xf8, 0x01, 0x00, 0xff, 0xcf, 0x60, 0xf0, 0x10,
X   0x00, 0xfe, 0x1f, 0x90, 0xf8, 0x10, 0x00, 0xfc, 0x3f, 0x90, 0xbc, 0x08,
X   0x00, 0xfc, 0x7f, 0x60, 0x3c, 0x07, 0x00, 0xfe, 0xff, 0x03, 0x1e, 0x02,
X   0x00, 0xfe, 0xff, 0x04, 0x0f, 0x02, 0x00, 0xff, 0xff, 0x85, 0x07, 0x04,
X   0x80, 0xff, 0xff, 0xc3, 0xc3, 0x04, 0x80, 0xdf, 0xff, 0xe7, 0x23, 0x05,
X   0x84, 0x9f, 0xff, 0xef, 0x25, 0x09, 0xc8, 0x19, 0xff, 0xf7, 0xc4, 0x08,
X   0xf0, 0x18, 0xfe, 0x7b, 0x03, 0x08, 0xc0, 0x1f, 0xfc, 0x3d, 0x00, 0x08,
X   0xc0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xc0, 0x1f, 0x78, 0x7f, 0x00, 0x08,
X   0xf0, 0x98, 0xbd, 0xff, 0x00, 0x08, 0xc8, 0x59, 0xde, 0xff, 0x61, 0x08,
X   0x84, 0x5f, 0xef, 0xff, 0x91, 0x04, 0x80, 0x9f, 0xc7, 0xff, 0x93, 0x04,
X   0x80, 0x9f, 0x87, 0xff, 0x67, 0x04, 0x00, 0xdf, 0x03, 0xff, 0x0f, 0x02,
X   0x00, 0xfe, 0x19, 0xfe, 0x1f, 0x02, 0x00, 0xfe, 0x24, 0xfe, 0x1f, 0x07,
X   0x00, 0x7c, 0x24, 0xfc, 0xff, 0x08, 0x00, 0x78, 0x18, 0xfa, 0x7f, 0x10,
X   0x00, 0x3c, 0x00, 0xf2, 0xff, 0x10, 0x00, 0xde, 0x00, 0xfc, 0xff, 0x00,
X   0x00, 0x8f, 0x0f, 0xe0, 0xff, 0x01, 0x80, 0x87, 0xf0, 0xff, 0xff, 0x03,
X   0x80, 0x87, 0x00, 0x84, 0xff, 0x07, 0xc0, 0x43, 0x00, 0x84, 0xff, 0x07,
X   0xe0, 0x21, 0x00, 0x02, 0xff, 0x0f, 0xf0, 0x00, 0x00, 0x02, 0xfe, 0x1f,
X   0x78, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x78, 0x00, 0x00, 0x00, 0xfc, 0x3f,
X   0x3c, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x1e, 0x00, 0x00, 0x00, 0xf0, 0xff};
X
X
X/* bitmap data for 64x64 xdbx icon */
X
X#define xdbx64_width 64
X#define xdbx64_height 64
Xstatic char xdbx64_bits[] = {
X   0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xfe, 0xff, 0x01, 0x00,
X   0x00, 0x00, 0x00, 0xf8, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x7c,
X   0xf8, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x3e, 0xf8, 0xff, 0x07, 0x00,
X   0x00, 0x00, 0x00, 0x1f, 0xf0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x80, 0x0f,
X   0xe0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x80, 0x0f, 0xc0, 0xff, 0x3f, 0x00,
X   0x00, 0x00, 0xc0, 0x07, 0xc0, 0xff, 0x3f, 0x00, 0x01, 0x00, 0xe0, 0x03,
X   0x80, 0xff, 0x7f, 0x00, 0x02, 0x00, 0xf0, 0x01, 0x00, 0xff, 0xff, 0x00,
X   0x04, 0x00, 0xf8, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x04, 0x00, 0xf8, 0x00,
X   0x00, 0xfe, 0xff, 0x01, 0x04, 0x00, 0x7c, 0x00, 0x00, 0xfc, 0xff, 0xff,
X   0xff, 0x01, 0x3e, 0x04, 0x00, 0xf8, 0xff, 0x07, 0x00, 0x1e, 0x1f, 0x04,
X   0x00, 0xf0, 0xff, 0x0f, 0x00, 0xe0, 0x0f, 0x04, 0x00, 0xf0, 0xff, 0x0f,
X   0x80, 0x81, 0x07, 0x02, 0x00, 0xe0, 0xff, 0x1f, 0x40, 0xc2, 0x07, 0x01,
X   0x00, 0xc0, 0xff, 0xbf, 0x41, 0xe2, 0x8b, 0x01, 0x00, 0xc0, 0xff, 0x7f,
X   0x82, 0xf1, 0xd1, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x02, 0xf8, 0x60, 0x00,
X   0x00, 0xf0, 0xff, 0xff, 0x01, 0x7c, 0x40, 0x00, 0x00, 0xf8, 0xfe, 0xff,
X   0x01, 0x7c, 0x80, 0x00, 0x00, 0xfc, 0xfc, 0xff, 0x03, 0x3e, 0x80, 0x00,
X   0x00, 0xfc, 0xfc, 0xff, 0x03, 0x1f, 0x00, 0x01, 0x00, 0xfe, 0xf8, 0xff,
X   0x87, 0x0f, 0x03, 0x01, 0x00, 0xff, 0xf0, 0xff, 0xcf, 0x87, 0x04, 0x02,
X   0x08, 0xff, 0xe0, 0xff, 0xcf, 0x87, 0x04, 0x02, 0x10, 0xe7, 0xe0, 0xff,
X   0xe7, 0x03, 0x03, 0x02, 0xe0, 0xe3, 0xc0, 0xff, 0xf3, 0x01, 0x00, 0x04,
X   0x80, 0xff, 0x80, 0xff, 0xf9, 0x00, 0x00, 0x04, 0x80, 0xff, 0x00, 0xff,
X   0xfc, 0x00, 0x00, 0x04, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07,
X   0x80, 0xff, 0x00, 0x7e, 0xfe, 0x01, 0x00, 0x04, 0x80, 0xff, 0x00, 0x3e,
X   0xff, 0x1b, 0x00, 0x04, 0xe0, 0xe3, 0x00, 0x9f, 0xff, 0x27, 0x00, 0x04,
X   0x10, 0xe7, 0xb0, 0xcf, 0xff, 0x2f, 0x30, 0x02, 0x08, 0xff, 0xc8, 0xe7,
X   0xff, 0x1f, 0x48, 0x02, 0x00, 0xff, 0xe8, 0xe7, 0xff, 0x1f, 0x48, 0x02,
X   0x00, 0xfe, 0xf0, 0xc3, 0xff, 0x3f, 0x30, 0x01, 0x00, 0xfc, 0xf0, 0xc1,
X   0xff, 0x3f, 0x00, 0x01, 0x00, 0xfc, 0xf8, 0x80, 0xff, 0x7f, 0x80, 0x00,
X   0x00, 0xf8, 0x7c, 0x00, 0xff, 0xff, 0x80, 0x00, 0x00, 0xf0, 0x7c, 0x18,
X   0xfe, 0xff, 0xc1, 0x00, 0x00, 0xe0, 0x3e, 0x24, 0xfe, 0xff, 0x61, 0x00,
X   0x00, 0xc0, 0x1f, 0x24, 0xfc, 0xff, 0xd3, 0x00, 0x00, 0x80, 0x0f, 0x18,
X   0xf8, 0xff, 0x8f, 0x01, 0x00, 0xc0, 0x07, 0x00, 0xf4, 0xff, 0x0f, 0x01,
X   0x00, 0xe0, 0x0f, 0x00, 0xe4, 0xff, 0x1f, 0x02, 0x00, 0xf0, 0x39, 0x00,
X   0xf8, 0xff, 0x1f, 0x04, 0x00, 0xf0, 0xc9, 0x03, 0xc0, 0xff, 0x3f, 0x04,
X   0x00, 0xf8, 0x08, 0xfc, 0xff, 0xff, 0x7f, 0x04, 0x00, 0x7c, 0x04, 0x00,
X   0x01, 0xff, 0x7f, 0x00, 0x00, 0x3e, 0x02, 0x00, 0x01, 0xff, 0xff, 0x00,
X   0x00, 0x3e, 0x00, 0x00, 0x01, 0xfe, 0xff, 0x01, 0x00, 0x1f, 0x00, 0x80,
X   0x00, 0xfc, 0xff, 0x03, 0x80, 0x0f, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x03,
X   0xc0, 0x07, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x07, 0xe0, 0x03, 0x00, 0x00,
X   0x00, 0xf0, 0xff, 0x0f, 0xe0, 0x03, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x1f,
X   0xf0, 0x01, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x1f, 0xf8, 0x00, 0x00, 0x00,
X   0x00, 0xc0, 0xff, 0x3f, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f,
X   0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff};
X
X
X/* bitmap data for stop sign */
X
X#define stop_width 16
X#define stop_height 16
X#define stop_x_hot -1
X#define stop_y_hot -1
Xstatic char stop_bits[] = {
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xd0, 0x01, 0x5c, 0x07,
X   0x54, 0x05, 0x54, 0x05, 0x14, 0x04, 0x0c, 0x04, 0x08, 0x04, 0x18, 0x06,
X   0xf0, 0x03, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00};
X
X
X/* bitmap data for arrow sign */
X
X#define arrow_width 16
X#define arrow_height 16
X#define arrow_x_hot -1
X#define arrow_y_hot -1
Xstatic char arrow_bits[] = {
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x01, 0x80, 0x03,
X   0xff, 0x07, 0xff, 0x0f, 0xff, 0x0f, 0xff, 0x07, 0x80, 0x03, 0x80, 0x01,
X   0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
X
X
X/* bitmap data for up-down (outlined arrow) sign */
X
X#define updown_width 16
X#define updown_height 16
X#define updown_x_hot -1
X#define updown_y_hot -1
Xstatic char updown_bits[] = {
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x01, 0x80, 0x03,
X   0xff, 0x06, 0x01, 0x0c, 0x01, 0x0c, 0xff, 0x06, 0x80, 0x03, 0x80, 0x01,
X   0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
X
X
X/* bitmap data for bomb sign */
X
X#define bomb_width 16
X#define bomb_height 16
Xstatic char bomb_bits[] = {
X   0x00, 0x00, 0x69, 0x00, 0x94, 0x00, 0x8a, 0x00, 0xc0, 0x01, 0xc5, 0x01,
X   0xf0, 0x07, 0xf0, 0x07, 0xf8, 0x0f, 0xf8, 0x0d, 0xf8, 0x0d, 0xf8, 0x0d,
X   0xf0, 0x06, 0xf0, 0x07, 0xc0, 0x01, 0x00, 0x00};
END_OF_FILE
if test 8509 -ne `wc -c <'bitmaps.h'`; then
    echo shar: \"'bitmaps.h'\" unpacked with wrong size!
fi
# end of 'bitmaps.h'
fi
if test -f 'calldbx.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'calldbx.c'\"
else
echo shar: Extracting \"'calldbx.c'\" \(7598 characters\)
sed "s/^X//" >'calldbx.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 *  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/*  calldbx.c
X *
X *    Set up communication between dbx and xdbx using pseudo terminal, and
X *    call dbx.
X *
X *    open_master():	Open the master side of pty.
X *    open_slave(): 	Open the slave side of pty.
X *    calldbx(): 	Invoke dbx.
X */
X
X#include	<termio.h>
X#include	"global.h"
X
XFILE   	    	*dbxfp = NULL;		/* file pointer to dbx */
Xint    	    	dbxpid = 0;		/* dbx process id */
X
Xstatic int	dbxInputId;		/* dbx input id */
Xstatic char 	pty[11] = "/dev/pty??";	/* master side of pseudo-terminal */
Xstatic char 	tty[11] = "/dev/tty??";	/* slave side of pseudo-terminal */
Xextern char	*dbxprompt;
X
X/*
X *  Xdbx talks to dbx through a pseudo terminal which is a pair of master
X *  and slave devices: /dev/pty?? and /dev/tty??, where ?? goes from p0 to
X *  sf (system dependent).  The pty is opened for both read and write.
X */
Xstatic int open_master()
X{
X    int  i, master; 
X    char c;
X
X    for (c='p'; c<='s'; c++) {
X	pty[8] = c;
X	for (i=0; i<16; i++) {
X	    pty[9] = "0123456789abcdef"[i];
X	    if ((master = open(pty, O_RDWR)) != -1) 
X		return (master); 
X	}
X    }
X#ifdef GDB
X    fprintf(stderr, "xxgdb: all ptys in use\n");
X#else
X    fprintf(stderr, "xdbx: all ptys in use\n");
X#endif
X    exit(1);
X}
X
Xstatic int open_slave()
X{
X    int slave;
X
X    tty[8] = pty[8];
X    tty[9] = pty[9];
X    if ((slave = open(tty, O_RDWR)) != -1)
X	return (slave);
X    fprintf(stderr, "open: cannot open slave pty %s", tty);
X    exit(1);
X}
X
X/* ARGSUSED */
Xvoid calldbx(argc, argv)
Xint argc;
Xchar *argv[];
X{
X    struct termio Termio;
X    int  	  master;		/* file descriptor of master pty */
X    int  	  slave; 		/* file descriptor of slave pty */
X    int		  fd; 			/* file descriptor of controlling tty */
X    int		  pid;			/* process id */
X    int		  pgrp;			/* process group id */
X    char 	  *debugger; 		/* name of executable debugger */
X    char	  errmsg[LINESIZ];
X
X#ifdef GDB	/* for GDB, we use XXGDB_DEBUGGER instead */
X    debugger = (char *) getenv("XXGDB_DEBUGGER");	/* first looks up env var */
X#else
X    debugger = (char *) getenv("DEBUGGER");	/* first looks up env var */
X#endif
X    if (debugger == NULL)
X	debugger = XtNewString(DEBUGGER);
X  
X    /* construct dbx prompt string based on the name of debugger invoked */
X    if (dbxprompt == NULL) {
X	dbxprompt = XtMalloc((4+strlen(debugger)) * sizeof(char));
X	sprintf(dbxprompt, "(%s) ", debugger);
X    }
X  
X    /*
X     * Clear controlling tty.  Do this now, so that open_slave and
X     * open_master will cause the selected pty to become the
X     * controlling tty.
X     */
X    if ((fd = open("/dev/tty", O_RDWR)) > 0) {
X	ioctl(fd, TIOCNOTTY, 0);
X	close(fd);
X    }
X
X    master = open_master();
X    slave = open_slave();
X
X    dbxpid = fork();
X    if (dbxpid == -1) {
X#ifdef GDB
X	perror("xxgdb error: cannot fork process");
X#else
X	perror("xdbx error: cannot fork process");
X#endif
X	exit(1);
X    }
X    else if (dbxpid) { 
X	/* 
X	 * Parent : close the slave side of pty
X	 *	    close stdin and stdout
X	 *	    set the dbx file descriptor to nonblocking mode
X	 *	    open file pointer with read/write access to dbx
X	 *	    set line buffered mode
X	 *	    register dbx input with X
X	 */
X	close(slave);
X	close(0);
X	close(1);
X	fcntl(master, F_SETFL, FNDELAY);
X    	dbxfp = fdopen(master, "r+");
X	setlinebuf(dbxfp);
X	dbxInputId = XtAppAddInput(app_context, master, XtInputReadMask, 
X				   read_dbx, NULL);
X    }
X    else { 
X	/* 
X	 * Child : close master side of pty
X	 * 	   redirect stdin, stdout, stderr of dbx to pty
X	 *	   unbuffer output data from dbx
X	 *	   exec dbx with arguments
X	 */
X	close(master);
X
X	/*
X	 * Modify local and output mode of slave pty
X	 */
X	ioctl(slave, TCGETA, &Termio);
X	Termio.c_lflag &= ~ECHO;	/* No echo */
X	Termio.c_oflag &= ~ONLCR;	/* Do not map NL to CR-NL on output */
X	ioctl(slave, TCSETA, &Termio);
X
X	dup2(slave, 0);
X	dup2(slave, 1);
X	dup2(slave, 2);
X	if (slave > 2)
X	    close(slave);
X	fcntl(1, F_SETFL, FAPPEND);
X	setbuf(stdout, NULL);
X
X	/*
X	 * Set our process group to that of the terminal,
X	 * so we can change the group of the terminal.
X	 */
X	ioctl(0, TIOCGPGRP, &pgrp);
X	setpgrp(0, pgrp);
X
X	/*
X	 * Now set the process group of the terminal and of us
X	 * to our process id.  This clears us from the control
X	 * of the other process group.
X	 */
X	pid = getpid();
X	ioctl(0, TIOCSPGRP, &pid);
X	setpgrp(0, pid);
X
X	argv[0] = debugger;
X	execvp(debugger, argv);
X#ifdef GDB
X	sprintf(errmsg, "xxgdb error: cannot exec %s", debugger);
X#else
X	sprintf(errmsg, "xdbx error: cannot exec %s", debugger);
X#endif
X	perror(errmsg);
X	exit(1);
X    }
X}
END_OF_FILE
if test 7598 -ne `wc -c <'calldbx.c'`; then
    echo shar: \"'calldbx.c'\" unpacked with wrong size!
fi
# end of 'calldbx.c'
fi
if test -f 'dbx.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'dbx.c'\"
else
echo shar: Extracting \"'dbx.c'\" \(7409 characters\)
sed "s/^X//" >'dbx.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 *  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/*
X *  dbx.c
X *
X *    Handle dbx command initialization file (.dbxinit) and communication 
X *    between dbx and xdbx.
X *
X *    dbx_init():	Handle .dbxinit
X *    debug_init():	
X *    read_dbx():	Read dbx output, parse and filter it before displaying
X *			onto the dialog window.
X *    write_dbx():	Send a command to dbx.
X *    query_dbx():	Send a command to dbx and process it.
X */
X
X#include "global.h"
X
XBoolean	Prompt;			/* True when dbx prompt arrives */
Xchar 	*concat();
Xchar	*dbxprompt; 
Xchar	*xdbxprompt;
X
X/*  Given a dbx command initialization file, this routine executes each dbx 
X *  command in the file.  It sends the command to dbx, and calls read_dbx() 
X *  directly to process output returned from dbx.
X */
X 
Xstatic void dbx_init(xdbxinit)
Xchar *xdbxinit;
X{
X    FILE *fp;
X    char s[LINESIZ];
X
X    if (strcmp(xdbxinit, "") == NULL)
X	return;
X    if (fp = fopen(xdbxinit, "r")) {
X	while (fgets(s, LINESIZ, fp)) {
X#ifdef GDB
X		/* if GDB:
X			Check for comment line,
X			DO NOT SEND '\n',
X			Take care of source command.
X		*/
X		if ((*s != '#') && strcmp(s,"\n") && (!gdb_source_command(s,TRUE))) {	
X#endif /* GDB */
X	    send_command(s);
X	    AppendDialogText(s);
X	    Prompt = False;
X	    while (!Prompt)
X		read_dbx();
X#ifdef GDB
X		}
X#endif /* GDB */
X	}
X	close(fp);
X    }
X}
X
X/*
X *  This routine is called after getting the first dbx prompt.  
X *  > check the use list to create a list of directories for searching
X *    source files.
X *  > ask dbx for the source file and display it if it exists.
X *  > open the command initialization file and executed the commands;
X *    if Tstartup is true, remove the initialization file.
X */
Xvoid debug_init()
X{
X    static visited = False;
X
X    if (!visited) {
X	visited = True;
X	dbx_init(xdbxinit);
X	if (Tstartup)
X	    unlink(xdbxinit);
X	strcpy(xdbxinit, "");
X    }
X}
X
X/*
X *  This is a callback procedure invoked everytime when input is pending
X *  on the file descriptor to dbx.
X *  o reads all the data available on the file descriptor line by line
X *    into local variable 'string' and global variable 'output'.
X *    'output' records the entire dbx output whereas 'string' records
X *    only the data read in this invocation of read_dbx().
X *  o in Echo mode, the contents in 'string' is edited by filter()
X *    before it gets displayed on the dialog window.
X *  o once the dbx prompt is read, calls parse() to analyse the dbx output
X *    and take appropriate action.
X */
X/* ARGSUSED */
Xvoid read_dbx(master, source, id)
XXtPointer master;
Xint 	  *source;
XXtInputId *id;
X{
X    static char *output = NULL; 	/* buffer for dbx output */
X    static char *next_string = NULL;
X    static char *command;
X    char 	*string = NULL;
X    char 	s[LINESIZ];
X    Boolean 	more;
X	
X    more = True;
X    while (more) {
X	Prompt = False;
X	/* keep reading until no more or until prompt arrives */
X	while (more = fgets(s, LINESIZ, dbxfp) && !Prompt) {
X	    if (debug)
X		fprintf(stderr, "=>%s", s);
X	    /* receive prompt? */
X	    if (strncmp(s, dbxprompt, strlen(dbxprompt)) == NULL) {
X		Prompt = True;
X		/* more stuff behind prompt? */
X		if (s[strlen(dbxprompt)])
X		    /* remember it */
X		    next_string = XtNewString(s+strlen(dbxprompt));
X		/* destroy contents */
X		strcpy(s, "");
X	    }
X	    string = concat(string, s);
X	    strcpy(s, "");
X	}
X	output = concat(output, string);
X	command = get_command();
X		
X	if (Echo) {
X	    filter(string, output, command);
X	    if (Prompt) AppendDialogText(xdbxprompt);
X	}
X	if (string) {
X	    XtFree(string);
X	    string = NULL;
X	}
X	if (next_string) {
X	    string = concat(string, next_string);
X	    XtFree(next_string);
X	    next_string = NULL;
X	}
X	if (Prompt) {
X	    parse(output, command);
X	    delete_command();
X	    XtFree(output);
X	    output = NULL;
X	}
X    }
X}
X
X/*  Write string s to dbx, and flush the output.  */
X
Xvoid write_dbx(s)
Xchar *s;
X{
X	if (debug)
X		fprintf(stderr, ">>%s", s);		/* (PW) see what is sent to GDB */
X		
X    fputs(s, dbxfp);
X	fflush(dbxfp);
X}
X
X/*  Sends a command to dbx and read the corresponding output, directly
X *  invoking the Xt input procedure, read_dbx().
X */
Xvoid query_dbx(command)
Xchar *command;
X{
X    write_dbx(command);
X    insert_command(command);
X
X    Echo = False;
X    Prompt = False;
X    while (!Prompt)
X        read_dbx();
X
X    Parse = True;	/* Always reset Parse and Echo to True */
X    Echo = True;
X}
END_OF_FILE
if test 7409 -ne `wc -c <'dbx.c'`; then
    echo shar: \"'dbx.c'\" unpacked with wrong size!
fi
# end of 'dbx.c'
fi
if test -f 'defs.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'defs.h'\"
else
echo shar: Extracting \"'defs.h'\" \(9786 characters\)
sed "s/^X//" >'defs.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/*  defs.h
X *
X *    Contain #includes, #defines and typedefs
X */
X
X#include <stdio.h>
X#include <sys/param.h>
X#include <X11/Xos.h>
X#include <X11/IntrinsicP.h>
X#include <X11/StringDefs.h>
X#include <X11/Xaw/Cardinals.h>
X#include <X11/Xatom.h>
X#include <X11/Shell.h>
X#include <X11/Xaw/Paned.h>
X#include <X11/Xaw/Grip.h>
X#include <X11/Xaw/Form.h>
X#include <X11/Xaw/MenuButton.h>
X#include <X11/Xaw/SimpleMenu.h>
X#include <X11/Xaw/SmeBSB.h>
X#include <X11/Xaw/AsciiText.h>
X#include <X11/Xaw/TextP.h>
X#include <X11/Xaw/TextSrc.h>
X#include <X11/Xaw/Box.h>
X#include <X11/Xaw/Dialog.h>
X#include <X11/Xaw/List.h>
X#include <X11/Xaw/Command.h>
X#include <X11/Xaw/Label.h>
X#include <X11/cursorfont.h>
X
X/* incompatibility of header file with X11R4 documentation */
X#define XawChainTop	XtChainTop
X#define XawChainBottom	XtChainBottom
X#define XawChainLeft	XtChainLeft
X#define XawChainRight	XtChainRight
X
X#ifndef AssignMax
X#define AssignMax(x, y) 	if ((y) > (x)) x = (y)
X#endif
X#ifndef AssignMin
X#define AssignMin(x, y) 	if ((y) < (x)) x = (y)
X#endif
X
X#define LINESIZ         512		/* input line length */
X#define MAXNAME         256		/* max identifier length */
X#define MAXARGS 	20		/* max number of args */
X#define ADD_SIZE 	16		/* # of files added during Realloc */
X#define CHARS_PER_LINE  20		/* estimated number of chars per line */
X#define ADD_LINES       50		/* # of lines to be added in realloc */
X#define NTOKENS		6		/* number of tokens */
X#ifdef GDB
X#define DEBUGGER      	"gdb"		/* name of executable */
X#define XDBXPROMPT  	"(xxgdb) "	/* xdbx prompt string */
X#else
X#define DEBUGGER      	"dbx"		/* name of executable */
X#define XDBXPROMPT  	"(xdbx) "	/* xdbx prompt string */
X#endif	/* GDB */
X#define DELIMITERS	" !%^&*()+=~|;:{},/#<?\"\n\t"
X
X#ifdef GDB
X#define BREAK_HELP	"Please select a function name or an address, or put cursor on a line to break at"
X#else
X#define STOP_AT_HELP	"Please select a line to stop at"
X#define STOP_IN_HELP	"Please select a function to stop in"
X#endif /* GDB */
X#define DELETE_HELP	"Please select a stop sign to delete"
X#define PRINT_HELP	"Please select an expression to print"
X#ifdef GDB
X#define UNDISPLAY_HELP	"Please select a number to undisplay"
X#else
X#define UNDISPLAY_HELP	"Please select an expression to undisplay"
X#endif /* GDB */
X#define SEARCH_HELP	"Nothing to search"
X
X#define	LASTCH(s)	(s[strlen(s)-1])
X#define	SECLASTCH(s)	(s[strlen(s)-2])
X
X#ifdef SUNOS4
Xtypedef struct dirent 	Directory;
X#else
Xtypedef struct direct 	Directory;
X#endif
X
Xtypedef struct {
X    Boolean   bell;		/* if True, bell on */
X    Boolean   displayWindow;	/* if True, display window on startup */
X    String    delimiters;	/* set of delimiters for word selection */
X    String    prompt;		/* prompt string for xdbx */
X
X    Pixel     stop_color;	/* color of stop sign */
X    Pixel     arrow_color;	/* color of arrow sign */
X    Pixel     updown_color;	/* color of updown sign */
X    Pixel     bomb_color;	/* color of bomb sign */
X
X    Dimension dataDpyMaxHeight;	/* data display window maximum height */
X    Dimension dataDpyMaxWidth;	/* data display window maximum width */
X
X    Boolean   bigicon;		/* xdbx option -bigicon */
X    Boolean   debug;		/* xdbx option -debug */
X
X    Boolean   dbxopt_r;		/* dbx option -r */
X    Boolean   dbxopt_i;		/* dbx option -i */
X    String    includeDir;	/* dbx option -I includeDir */
X    Boolean   dbxopt_k;		/* dbx option -k */
X    String    cfile;		/* Berkeley  dbx option -c file */
X    Boolean   dbxopt_kbd;	/* Sun dbx option -kbd */
X    String    fcount;		/* SunOS 4.0 dbx option -f fcount */
X    String    startup;		/* SunOS 4.0 dbx option -s startup */
X    String    tstartup;		/* SunOS 4.0 dbx option -sr tstartup */
X    Boolean   pixie;		/* Mips dbx option -pixie */
X} XdbxResources;
X
Xtypedef struct {
X    char 		*filename;	/* name of file */
X    char 		*pathname;	/* full path name of file */
X    char 		*buf;		/* buffer holding source file */
X    long		filesize;	/* size of file in bytes */
X    time_t		mtime;		/* time last modified */
X    int	 		lines;		/* # of lines on display */
X    int	 		currentline;	/* line where caret is */
X    int	 		topline;	/* top line number in the window */
X    int	 		bottomline;	/* bottom line number in window */
X    int	 		lastline;	/* number of lines in source file */
X    XawTextPosition 	topPosition;	/* top display position of buffer */
X    XawTextPosition 	*linepos;	/* array of text pos for each newline */
X} FileRec, *FileRecPtr;
X
Xtypedef struct {
X    char	*mesg;			/* part of matched string */
X    unsigned	stop;			/* stop number */
X    char 	*func;			/* function name */
X    int		line;			/* line number */
X    char	*file;			/* file name */
X    char	*display;		/* variable display output */
X} Tokens;
X
Xtypedef struct dataDpyList {
X    struct dataDpyRec	*dataDpy;
X    struct dataDpyList	*next;
X} DataDpyList;
X
Xtypedef struct dataDpyRec {
X    int			id;
X    Widget              popupshell;             /* parent of popup */
X    Widget              popup;                  /* form widget */
X    Widget              label;                  /* label widget */
X    Widget              dataDpyWindow;          /* window for displaying data */
X    char                *buf;                   /* text buffer */
X    int                 buflen;
X    XawTextPosition     *linepos;
X    int                 numlines;
X    int                 maxLineLength;
X    int			state;			/* EMPTY, UNUSED, USED */
X    struct dataDpyRec	*parent;		/* pointer to parent */
X    struct dataDpyList	*childlist;		/* list of children */
X} DataDpyRec, *DataDpyRecPtr;
X
Xtypedef struct {
X    char			*pat;		/* regular expression */
X    struct re_pattern_buffer	*buf;		/* buffer for compile regex */
X    int				reg_token[NTOKENS];	/* register number */
X} PatternRec, *PatternRecPtr;
X
Xtypedef struct commandRec {
X    char		*command;
X    struct commandRec	*next;
X} CommandRec, *CommandRecPtr;
X
Xtypedef struct {
X    Cardinal	i;			/* index to arrowsign[] */
X    char	file[MAXNAME];		/* file associated with */
X    int	 	line;			/* line number */
X    char 	func[MAXNAME];		/* function name associated with */
X} Arrow;
X
Xtypedef struct {
X    Cardinal	i;			/* index to updownsign[] */
X    char	file[MAXNAME];		/* file associated with */
X    int	 	line;			/* line number */
X    char 	func[MAXNAME];		/* function name associated with */
X} Updown;
X
Xtypedef struct {
X    char	*file;			/* file associated with */
X    int	 	line;			/* line number of stop */
X    unsigned    tag;                    /* used in deleting stops */
X} Stops;
X
Xtypedef struct {
X    Cardinal	i;			/* index to bombsign[] */
X    char	file[MAXNAME];		/* file associated with */
X    int	 	line;			/* line number */
X    char 	func[MAXNAME];		/* function name associated with */
X} Bomb;
END_OF_FILE
if test 9786 -ne `wc -c <'defs.h'`; then
    echo shar: \"'defs.h'\" unpacked with wrong size!
fi
# end of 'defs.h'
fi
if test -f 'global.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'global.h'\"
else
echo shar: Extracting \"'global.h'\" \(8729 characters\)
sed "s/^X//" >'global.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/*  global.h:
X *
X *    Contain extern declarations of variables and functions.
X */
X
X#include "defs.h"
X
X/* calldbx.c */
X
Xextern void		calldbx();		/* fork child, exec dbx */
X
X/* command.c */
X
Xextern void		CreateCommandPanel();
Xextern void		send_command();
Xextern char		*get_command();
Xextern void		insert_command();
Xextern void		delete_command();
X
X/* datadpy.c */
X
Xextern void		print_handler();	/* printing variables */
X
X/* dbx.c */
X
Xextern void		debug_init();		/* initial source display */
Xextern void 		read_dbx();		/* get data from dbx */
Xextern void 		write_dbx();		/* send data to dbx */
Xextern void		query_dbx();		/* ask dbx for info */
X
X/* dialog.c */
X
Xextern void		DeleteLine();		/* delete line action proc */
Xextern void		DeleteWord();		/* delete word action proc */
Xextern void		CreateDialogWindow();
Xextern void 		AppendDialogText();	/* append text to buffer */
X
X/* filemenu.c */
X
Xextern void		File();			/* file button callback */
X
X/* handler.c */
X
Xextern void		TextSetTopPosition();	/* sets topDisplayPosition */
Xextern void 		AdjustText();		/* adjust display position */
Xextern void 		exec_handler();		/* run, cont, next, step */
Xextern void 		done_handler();		/* run, cont, next, step */
Xextern void 		stop_at_handler();	/* stop at line */
Xextern void 		stop_in_handler();	/* stop in function */
Xextern void 		updown_handler();	/* move up/down the stack */
Xextern void 		delete_handler();	/* delete stop signs */
Xextern void 		func_handler();		/* display function */
Xextern void 		file_handler();		/* display file */
Xextern void 		debug_handler();	/* debug program */
Xextern void 		cd_handler();		/* change directory */
Xextern void 		pwd_handler();		/* print working directory */
Xextern void 		use_handler();		/* update use directory list */
Xextern void 		search_handler();	/* display searched string */
Xextern void 		list_handler();		/* list source code */
Xextern void 		display_handler();	/* show display variables */
X
X/* parser.c */
X
Xextern void		parser_init();		/* initialization */
Xextern void		parse();		/* parse dbx output */
Xextern void		filter();		/* modify dbx output */
X
X/* signals.c */
Xextern void		trap_signals();		/* signal handling for xdbx */
X
X/* signs.c */
X
Xextern void		signs_init();		/* initilalize routine */
Xextern void 		DisplayStop();		/* show stop sign */
Xextern void 		UpdateStops();		/* update position of stops */
Xextern void 		ClearStops();		/* mark all stops invalid */
Xextern void 		RemoveStop();		/* undisplay stop sign */
Xextern void 		UpdateArrow();		/* update position of arrow */
Xextern void 		UpdateUpdown();		/* update position of updown */
Xextern void 		UpdateBomb();		/* update position of bomb */
X
X/* source.c */
X
Xextern void		SelectStart();		/* modified select-start */
Xextern void		SelectEnd();		/* modified select-end */
Xextern void		SelectWord();		/* my select word */
Xextern void		PrintSelection();	/* select variable and print */
Xextern void		Update();		/* update line label */
Xextern void		source_init();		/* init routine */
Xextern void 		CreateSourceWindow();
Xextern int 		LoadFile();		/* display source file */
Xextern int 		LoadCurrentFile();	/* display source file */
Xextern char		*GetPathname();		/* get full path name of file */
Xextern void		MakeDirList();		/* maintain list of dirs */
X
X/* utils.c */
X
Xextern XawTextPosition	TextGetLastPos();	/* get last pos of text */
Xextern int 		TextPositionToLine();	/* convert line # to text pos */
Xextern int		LineToStop_no();	/* convert line # to stop # */
Xextern void 		DisableWindowResize();  /* do not allow window resize */
Xextern void 		bell();			/* sound bell */
Xextern char 		*concat();		/* substring search */
X
X/* windows.c */
X
Xextern void 		CreateSubWindows();	/* all subwindows of xdbx */
Xextern void 		UpdateFileLabel();	/* update current file name */
Xextern void 		UpdateLineLabel();	/* update current line num */
Xextern void 		UpdateMessageWindow();	/* update xdbx message */
X
X/* extern variables */
X
Xextern Display	*display;
Xextern XtAppContext 	app_context;
Xextern Widget	toplevel, fileWindow, 
X        	sourceForm, sourceWindow, messageWindow, commandWindow, 
X		dialogWindow, searchWindow, separator, displayWindow;
X
Xextern Cursor	watch;			/* XC_watch cursor */
Xextern XdbxResources app_resources;	/* application resources */
Xextern char	xdbxinit[];		/* initialization filename */
Xextern char	*dbxprompt;		/* dbx prompt string */
Xextern char	*xdbxprompt;		/* xdbx prompt string */
Xextern Boolean	Tstartup;
Xextern Boolean	debug;
X
Xextern FileRec   	*displayedFile;	/* pointer to current file info */
Xextern Tokens		Token;		/* token structure */
Xextern PatternRec       dataPattern[]; 	/* data display pattern */
X
Xextern Boolean 	Echo;			/* echo dbx output onto window ? */
Xextern Boolean	Prompt;			/* command or program input ? */
Xextern Boolean	Parse;			/* flag for parser */
Xextern Boolean	FalseSignal;		/* real/false signal ? */
Xextern Boolean	PopupMode;		/* True if graphical display */
Xextern int	dbxpid;			/* dbx process id */
Xextern FILE	*dbxfp;			/* file pointer to dbx process */
X
Xextern char 	CurrentFile[];		/* string for dbx output */
Xextern char 	cwd[];			/* current working directory of dbx */
X
Xextern Arrow    arrow;			/* arrow widget and mapped info */
Xextern Updown   updown;			/* updown widget and mapped info */
Xextern Stops    stops[];		/* stop widget and mapped info */
Xextern Bomb	bomb;			/* bomb widget and mapped info */
Xextern Cardinal nstops;			/* number of stops */
X
X#ifdef GDB
Xextern void 		display_info_handler();
Xextern void 		break_handler();
Xextern void 		info_dir_handler();
Xextern void 		directory_handler();
Xextern void 		info_line_handler();
Xextern void 		info_break_handler();
X#endif
END_OF_FILE
if test 8729 -ne `wc -c <'global.h'`; then
    echo shar: \"'global.h'\" unpacked with wrong size!
fi
# end of 'global.h'
fi
echo shar: End of archive 2 \(of 8\).
cp /dev/null ark2isdone
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
