home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-07-17 | 40.1 KB | 1,122 lines |
- Newsgroups: alt.sources
- From: jtsillas@sprite.ma30.bull.com (James Tsillas)
- Subject: mxgdb Part 8/9
- Date: 16 Jul 91 13:14:52
- Message-ID: <JTSILLAS.91Jul16131452@sprite.ma30.bull.com>
-
-
-
- ---- Cut Here and feed the following to sh ----
- #!/bin/sh
- # this is mxgdb.08 (part 8 of a multipart archive)
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file mxgdb/patchlevel.h continued
- #
- if test ! -r _shar_seq_.tmp; then
- echo 'Please unpack part 1 first!'
- exit 1
- fi
- (read Scheck
- if test "$Scheck" != 8; then
- echo Please unpack part "$Scheck" next!
- exit 1
- else
- exit 0
- fi
- ) < _shar_seq_.tmp || exit 1
- if test ! -f _shar_wnt_.tmp; then
- echo 'x - still skipping mxgdb/patchlevel.h'
- else
- echo 'x - continuing file mxgdb/patchlevel.h'
- sed 's/^X//' << 'SHAR_EOF' >> 'mxgdb/patchlevel.h' &&
- X
- #define PATCHLEVEL 2
- SHAR_EOF
- echo 'File mxgdb/patchlevel.h is complete' &&
- chmod 0664 mxgdb/patchlevel.h ||
- echo 'restore of mxgdb/patchlevel.h failed'
- Wc_c="`wc -c < 'mxgdb/patchlevel.h'`"
- test 91 -eq "$Wc_c" ||
- echo 'mxgdb/patchlevel.h: original size 91, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= mxgdb/global.h ==============
- if test -f 'mxgdb/global.h' -a X"$1" != X"-c"; then
- echo 'x - skipping mxgdb/global.h (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting mxgdb/global.h (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'mxgdb/global.h' &&
- /* $Id: global.h,v 1.9 1991/07/16 14:51:57 jtsillas Exp $ */
- 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 * Modifications for use under System V
- X *
- X * Copyright 1990 Bull Worldwide Information Systems, 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 Bull Worldwide
- X * Information Systems not be used in advertising or publicity pertaining
- X * to distribution of the software without specific, written prior
- X * permission. Bull 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 * BULL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
- X * SHALL BULL 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 SYSV: James Tsillas
- X * XXGDB Created: March, 1991
- X *
- X *****************************************************************************/
- X
- /* global.h:
- X *
- X * Contain extern declarations of variables and functions.
- X */
- X
- #ifdef __GNUC__
- # define alloca __builtin_alloca
- #endif
- X
- #ifndef MAXPATHLEN
- #define MAXPATHLEN 1024
- #endif
- X
- X
- X
- #ifdef SYSV
- # define MAX(a,b) ((a)>(b)?(a):(b))
- # define MIN(a,b) ((a)>(b)?(b):(a))
- #ifdef SCO
- # include <unistd.h>
- #endif
- #endif
- X
- #include "defs.h"
- X
- /* calldbx.c */
- X
- extern void calldbx(); /* fork child, exec dbx */
- X
- /* command.c */
- X
- extern void Break();
- extern void DoIt();
- extern void Print();
- extern void Display_();
- extern void Undisplay();
- extern void Clear();
- extern void Quit();
- extern void Help();
- extern void PopupSearch();
- extern void CreateCommandPanel();
- extern void send_command();
- extern char *get_command();
- extern void insert_command();
- extern void delete_command();
- X
- /* dbx.c */
- extern void debug_init(); /* initial source display */
- extern void read_dbx(); /* get data from dbx */
- extern void write_dbx(); /* send data to dbx */
- extern void query_dbx(); /* ask dbx for info */
- X
- /* dialog.c */
- X
- extern void CreateDialogWindow();
- extern void AppendDialogText(); /* append text to buffer */
- X
- /* filemenu.c */
- X
- extern void File(); /* file button callback */
- extern void OKCallBack();
- extern void CancelCallBack();
- X
- /* handler.c */
- X
- extern void TextSetTopPosition(); /* sets topDisplayPosition */
- extern void AdjustText(); /* adjust display position */
- extern void exec_handler(); /* run, cont, next, step */
- extern void done_handler(); /* run, cont, next, step */
- extern void stop_at_handler(); /* stop at line */
- extern void stop_in_handler(); /* stop in function */
- extern void updown_handler(); /* move up/down the stack */
- extern void clear_handler(); /* clear stop signs */
- extern void func_handler(); /* display function */
- extern void file_handler(); /* display file */
- extern void debug_handler(); /* debug program */
- extern void cd_handler(); /* change directory */
- extern void pwd_handler(); /* print working directory */
- extern void use_handler(); /* update use directory list */
- extern void search_handler(); /* display searched string */
- extern void list_handler(); /* list source code */
- extern void display_handler(); /* show display variables */
- extern void help_handler();
- X
- extern Widget helplabels[];
- extern Widget helpbuttons[];
- X
- /* parser.c */
- X
- extern void parser_init(); /* initialization */
- extern void parse(); /* parse dbx output */
- extern void filter(); /* modify dbx output */
- X
- /* signals.c */
- extern void trap_signals(); /* signal handling for xdbx */
- X
- /* signs.c */
- X
- extern void signs_init(); /* initilalize routine */
- extern void DisplayStop(); /* show stop sign */
- extern void UpdateStops(); /* update position of stops */
- extern void ClearStops(); /* mark all stops invalid */
- extern void RemoveStop(); /* undisplay stop sign */
- extern void UpdateArrow(); /* update position of arrow */
- extern void UpdateUpdown(); /* update position of updown */
- extern void UpdateBomb(); /* update position of bomb */
- X
- /* source.c */
- X
- extern void SelectStart(); /* modified select-start */
- extern void SelectEnd(); /* modified select-end */
- extern void SelectWord(); /* my select word */
- extern void PrintSelection(); /* select variable and print */
- extern void Update(); /* update line label */
- extern void source_init(); /* init routine */
- extern void CreateSourceWindow();
- extern int LoadFile(); /* display source file */
- extern int LoadCurrentFile(); /* display source file */
- extern char *GetPathname(); /* get full path name of file */
- extern void MakeDirList(); /* maintain list of dirs */
- X
- /* utils.c */
- X
- extern XmTextPosition TextGetLastPos(); /* get last pos of text */
- extern int TextPositionToLine(); /* convert line # to text pos */
- extern int LineToStop_no(); /* convert line # to stop # */
- extern void bell(); /* sound bell */
- extern char *concat(); /* substring search */
- X
- /* windows.c */
- X
- extern void CreateSubWindows(); /* all subwindows of xdbx */
- extern void UpdateFileLabel(); /* update current file name */
- extern void UpdateLineLabel(); /* update current line num */
- extern void UpdateMessageWindow(); /* update xdbx message */
- extern void CreateSearchPopup();
- X
- /* extern variables */
- X
- extern Display *display;
- extern XtAppContext app_context;
- extern Widget toplevel, fileWindow,
- X sourceForm, sourceScroll, sourceWindow, messageWindow,
- X commandWindow, dialogWindow, searchWindow, separator,
- X displayWindow, fileSel, displayFD, scrollV, scrollH,
- X searchText, pageRbutton, pageLbutton, breakbutton,
- X stepbutton, nextbutton, printbutton, downbutton, upbutton,
- X stackbutton, contbutton, finishbutton, runbutton,
- X dispbutton, undispbutton, clearbutton, printsbutton,
- X argsbutton, localsbutton, helpFD, helpselectscroll,
- X helpupbutton;
- X
- X
- X
- extern XdbxResources app_resources; /* application resources */
- extern char xdbxinit[]; /* initialization filename */
- extern char *dbxprompt; /* dbx prompt string */
- extern char *xdbxprompt; /* xdbx prompt string */
- extern Boolean Tstartup;
- extern Boolean debug;
- X
- extern FileRec *displayedFile; /* pointer to current file info */
- extern Tokens Token; /* token structure */
- extern PatternRec dataPattern[]; /* data display pattern */
- X
- extern Boolean Echo; /* echo dbx output onto window ? */
- extern Boolean Prompt; /* command or program input ? */
- extern Boolean Parse; /* flag for parser */
- extern Boolean FalseSignal; /* real/false signal ? */
- extern int dbxpid; /* dbx process id */
- extern FILE *dbxfp; /* file pointer to dbx process */
- X
- extern char CurrentFile[]; /* string for dbx output */
- extern char cwd[]; /* current working directory of dbx */
- X
- extern Arrow arrow; /* arrow widget and mapped info */
- extern Updown updown; /* updown widget and mapped info */
- extern Stops stops[]; /* stop widget and mapped info */
- extern Bomb bomb; /* bomb widget and mapped info */
- extern Cardinal nstops; /* number of stops */
- extern ArrowSign arrowsign[];
- extern UpdownSign updownsign[];
- extern StopSign stopsign[];
- extern BombSign bombsign[];
- X
- #ifdef GDB
- extern void display_info_handler();
- extern void break_handler();
- extern void info_dir_handler();
- extern void directory_handler();
- extern void info_line_handler();
- extern void info_break_handler();
- #endif
- SHAR_EOF
- chmod 0664 mxgdb/global.h ||
- echo 'restore of mxgdb/global.h failed'
- Wc_c="`wc -c < 'mxgdb/global.h'`"
- test 11137 -eq "$Wc_c" ||
- echo 'mxgdb/global.h: original size 11137, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= mxgdb/regex.h ==============
- if test -f 'mxgdb/regex.h' -a X"$1" != X"-c"; then
- echo 'x - skipping mxgdb/regex.h (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting mxgdb/regex.h (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'mxgdb/regex.h' &&
- /* $Id: regex.h,v 1.1.1.1 1991/05/16 21:42:41 jtsillas Exp $ */
- X
- /* Definitions for data structures callers pass the regex library.
- X Copyright (C) 1985 Free Software Foundation, Inc.
- X
- X NO WARRANTY
- X
- X BECAUSE THIS PROGRAM IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY
- NO WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW. EXCEPT
- WHEN OTHERWISE STATED IN WRITING, FREE SOFTWARE FOUNDATION, INC,
- RICHARD M. STALLMAN AND/OR OTHER PARTIES PROVIDE THIS PROGRAM "AS IS"
- WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
- BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY
- AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
- DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
- CORRECTION.
- X
- X IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M.
- STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., AND/OR ANY OTHER PARTY
- WHO MAY MODIFY AND REDISTRIBUTE THIS PROGRAM AS PERMITTED BELOW, BE
- LIABLE TO YOU FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES, OR
- OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
- USE OR INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR
- DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR
- A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS) THIS
- PROGRAM, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
- DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
- X
- X GENERAL PUBLIC LICENSE TO COPY
- X
- X 1. You may copy and distribute verbatim copies of this source file
- as you receive it, in any medium, provided that you conspicuously and
- appropriately publish on each copy a valid copyright notice "Copyright
- (C) 1985 Free Software Foundation, Inc."; and include following the
- copyright notice a verbatim copy of the above disclaimer of warranty
- and of this License. You may charge a distribution fee for the
- physical act of transferring a copy.
- X
- X 2. You may modify your copy or copies of this source file or
- any portion of it, and copy and distribute such modifications under
- the terms of Paragraph 1 above, provided that you also do the following:
- X
- X a) cause the modified files to carry prominent notices stating
- X that you changed the files and the date of any change; and
- X
- X b) cause the whole of any work that you distribute or publish,
- X that in whole or in part contains or is a derivative of this
- X program or any part thereof, to be licensed at no charge to all
- X third parties on terms identical to those contained in this
- X License Agreement (except that you may choose to grant more extensive
- X warranty protection to some or all third parties, at your option).
- X
- X c) You may charge a distribution fee for the physical act of
- X transferring a copy, and you may at your option offer warranty
- X protection in exchange for a fee.
- X
- Mere aggregation of another unrelated program with this program (or its
- derivative) on a volume of a storage or distribution medium does not bring
- the other program under the scope of these terms.
- X
- X 3. You may copy and distribute this program (or a portion or derivative
- of it, under Paragraph 2) in object code or executable form under the terms
- of Paragraphs 1 and 2 above provided that you also do one of the following:
- X
- X a) accompany it with the complete corresponding machine-readable
- X source code, which must be distributed under the terms of
- X Paragraphs 1 and 2 above; or,
- X
- X b) accompany it with a written offer, valid for at least three
- X years, to give any third party free (except for a nominal
- X shipping charge) a complete machine-readable copy of the
- X corresponding source code, to be distributed under the terms of
- X Paragraphs 1 and 2 above; or,
- X
- X c) accompany it with the information you received as to where the
- X corresponding source code may be obtained. (This alternative is
- X allowed only for noncommercial distribution and only if you
- X received the program in object code or executable form alone.)
- X
- For an executable file, complete source code means all the source code for
- all modules it contains; but, as a special exception, it need not include
- source code for modules which are standard libraries that accompany the
- operating system on which the executable file runs.
- X
- X 4. You may not copy, sublicense, distribute or transfer this program
- except as expressly provided under this License Agreement. Any attempt
- otherwise to copy, sublicense, distribute or transfer this program is void and
- your rights to use the program under this License agreement shall be
- automatically terminated. However, parties who have received computer
- software programs from you with this License Agreement will not have
- their licenses terminated so long as such parties remain in full compliance.
- X
- X 5. If you wish to incorporate parts of this program into other free
- programs whose distribution conditions are different, write to the Free
- Software Foundation at 675 Mass Ave, Cambridge, MA 02139. We have not yet
- worked out a simple rule that can be stated here, but we will often permit
- this. We will be guided by the two goals of preserving the free status of
- all derivatives of our free software and of promoting the sharing and reuse of
- software.
- X
- X
- In other words, you are welcome to use, share and improve this program.
- You are forbidden to forbid anyone else to use, share and improve
- what you give them. Help stamp out software-hoarding! */
- X
- X
- #ifndef RE_NREGS
- #define RE_NREGS 10
- #endif
- X
- /* This data structure is used to represent a compiled pattern. */
- X
- struct re_pattern_buffer
- X {
- X char *buffer; /* Space holding the compiled pattern commands. */
- X int allocated; /* Size of space that buffer points to */
- X int used; /* Length of portion of buffer actually occupied */
- X char *fastmap; /* Pointer to fastmap, if any, or zero if none. */
- X /* re_search uses the fastmap, if there is one,
- X to skip quickly over totally implausible characters */
- X char *translate; /* Translate table to apply to all characters
- X before comparing.
- X Or zero for no translation.
- X The translation is applied to a pattern when it is compiled
- X and to data when it is matched. */
- X char fastmap_accurate;
- X /* Set to zero when a new pattern is stored,
- X set to one when the fastmap is updated from it. */
- X char can_be_null; /* Set to one by compiling fastmap
- X if this pattern might match the null string.
- X It does not necessarily match the null string
- X in that case, but if this is zero, it cannot.
- X 2 as value means can match null string
- X but at end of range or before a character
- X listed in the fastmap. */
- X };
- X
- /* Structure to store "register" contents data in.
- X
- X Pass the address of such a structure as an argument to re_match, etc.,
- X if you want this information back.
- X
- X start[i] and end[i] record the string matched by \( ... \) grouping i,
- X for i from 1 to RE_NREGS - 1.
- X start[0] and end[0] record the entire string matched. */
- X
- struct re_registers
- X {
- X int start[RE_NREGS];
- X int end[RE_NREGS];
- X };
- X
- /* These are the command codes that appear in compiled regular expressions,
- X one per byte.
- X Some command codes are followed by argument bytes.
- X A command code can specify any interpretation whatever for its arguments.
- X Zero-bytes may appear in the compiled regular expression. */
- X
- enum regexpcode
- X {
- X unused,
- X exactn, /* followed by one byte giving n, and then by n literal bytes */
- X begline, /* fails unless at beginning of line */
- X endline, /* fails unless at end of line */
- X jump, /* followed by two bytes giving relative address to jump to */
- X on_failure_jump, /* followed by two bytes giving relative address of place
- X to resume at in case of failure. */
- X finalize_jump, /* Throw away latest failure point and then
- X jump to address. */
- X maybe_finalize_jump, /* Like jump but finalize if safe to do so.
- X This is used to jump back to the beginning
- X of a repeat. If the command that follows
- X this jump is clearly incompatible with the
- X one at the beginning of the repeat, such that
- X we can be sure that there is no use backtracking
- X out of repetitions already completed,
- X then we finalize. */
- X dummy_failure_jump, /* jump, and push a dummy failure point.
- X This failure point will be thrown away
- X if an attempt is made to use it for a failure.
- X A + construct makes this before the first repeat. */
- X anychar, /* matches any one character */
- X charset, /* matches any one char belonging to specified set.
- X First following byte is # bitmap bytes.
- X Then come bytes for a bit-map saying which chars are in.
- X Bits in each byte are ordered low-bit-first.
- X A character is in the set if its bit is 1.
- X A character too large to have a bit in the map
- X is automatically not in the set */
- X charset_not, /* similar but match any character that is NOT one
- X of those specified */
- X start_memory, /* starts remembering the text that is matched
- X and stores it in a memory register.
- X followed by one byte containing the register number.
- X Register numbers must be in the range 0 through NREGS. */
- X stop_memory, /* stops remembering the text that is matched
- X and stores it in a memory register.
- X followed by one byte containing the register number.
- X Register numbers must be in the range 0 through NREGS. */
- X duplicate, /* match a duplicate of something remembered.
- X Followed by one byte containing the index of the memory register. */
- X before_dot, /* Succeeds if before dot */
- X at_dot, /* Succeeds if at dot */
- X after_dot, /* Succeeds if after dot */
- X begbuf, /* Succeeds if at beginning of buffer */
- X endbuf, /* Succeeds if at end of buffer */
- X wordchar, /* Matches any word-constituent character */
- X notwordchar, /* Matches any char that is not a word-constituent */
- X wordbeg, /* Succeeds if at word beginning */
- X wordend, /* Succeeds if at word end */
- X wordbound, /* Succeeds if at a word boundary */
- X notwordbound, /* Succeeds if not at a word boundary */
- X syntaxspec, /* Matches any character whose syntax is specified.
- X followed by a byte which contains a syntax code, Sword
- X or such like */
- X notsyntaxspec /* Matches any character whose syntax differs from
- X the specified. */
- X };
- X
- extern char *re_compile_pattern ();
- /* Is this really advertised? */
- extern void re_compile_fastmap ();
- extern int re_search (), re_search_2 ();
- extern int re_match (), re_match_2 ();
- X
- /* 4.2 bsd compatibility (yuck) */
- extern char *re_comp ();
- extern int re_exec ();
- X
- #ifdef SYNTAX_TABLE
- extern char *re_syntax_table;
- #endif
- SHAR_EOF
- chmod 0664 mxgdb/regex.h ||
- echo 'restore of mxgdb/regex.h failed'
- Wc_c="`wc -c < 'mxgdb/regex.h'`"
- test 10897 -eq "$Wc_c" ||
- echo 'mxgdb/regex.h: original size 10897, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= mxgdb/signals.c ==============
- if test -f 'mxgdb/signals.c' -a X"$1" != X"-c"; then
- echo 'x - skipping mxgdb/signals.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting mxgdb/signals.c (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'mxgdb/signals.c' &&
- static char rcsid[] = "$Id: signals.c,v 1.1.1.1 1991/05/16 21:42:44 jtsillas Exp $";
- 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
- /* 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
- #include <signal.h>
- #include <sys/wait.h>
- #include "global.h"
- X
- /* Kill the dbx child process and then exits. */
- /* ARGSUSED */
- static void kill_handler(sig, code, scp, addr)
- X int sig, code;
- X struct sigcontext *scp;
- X char *addr;
- {
- 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
- static void quit_handler()
- {
- X
- X int status;
- X int pid;
- X /* wait for the child to report its status; if the child has died,
- X * exit gracefully.
- X */
- X if(dbxpid)
- X {
- X pid = waitpid(dbxpid, &status , WNOHANG|WUNTRACED);
- X if (dbxpid == pid && (WIFEXITED(status) || WIFSIGNALED(status)) &&
- X !WIFSTOPPED(status))
- X {
- X exit(1);
- X }
- X }
- }
- X
- X
- static void stop_handler()
- {
- X if (dbxpid)
- X kill(dbxpid, SIGSTOP); /* stop dbx process */
- X kill(0, SIGSTOP); /* stop own process */
- }
- X
- X
- static void cont_handler()
- {
- X if (dbxpid) {
- X sleep(1); /* we need this */
- X kill(dbxpid, SIGCONT); /* continue dbx after stop */
- X }
- }
- X
- X
- /*
- X * Trap signals to xdbx so that the child process can be handled properly.
- X */
- void trap_signals()
- {
- X sigset(SIGINT, kill_handler);
- X sigset(SIGQUIT, kill_handler);
- X sigset(SIGILL, kill_handler);
- X sigset(SIGBUS, kill_handler);
- X sigset(SIGSEGV, kill_handler);
- X sigset(SIGTERM, kill_handler);
- X
- X sigset(SIGTSTP, stop_handler); /* stop signal from keyboard */
- X sigset(SIGCONT, cont_handler); /* continue after stop */
- X sigset(SIGCHLD, quit_handler); /* child status has changed */
- }
- SHAR_EOF
- chmod 0664 mxgdb/signals.c ||
- echo 'restore of mxgdb/signals.c failed'
- Wc_c="`wc -c < 'mxgdb/signals.c'`"
- test 4097 -eq "$Wc_c" ||
- echo 'mxgdb/signals.c: original size 4097, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= mxgdb/signs.c ==============
- if test -f 'mxgdb/signs.c' -a X"$1" != X"-c"; then
- echo 'x - skipping mxgdb/signs.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting mxgdb/signs.c (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'mxgdb/signs.c' &&
- static char rcsid[] = "$Id: signs.c,v 1.2 1991/07/10 01:39:41 jtsillas Exp $";
- 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
- /* signs.c
- X *
- X * This file contains all the routines for the creation and manipulation of
- X * symbols used in xdbx. There are 3 different signs:
- X * arrow - a solid right arrow to indicate the current execution point.
- X * updown - an outlined right arrow to indicate position in stack trace.
- X * stop - a stop hand symbol to indicate a breakpoint is set.
- X * bomb - a bomb symbol to indicate the point of segmentation fault.
- X *
- X * To display a sign on a given line in the source window, it is first
- X * created and mapped. To undisplay it, the sign is unmapped. It can
- X * be mapped again when the sign is needed. Note that the sign is never
- X * moved, so that there can be as many signs created (but not mapped) as
- X * the number of lines in the source window.
- X * For arrow and updown, there can be at most one of each mapped at a time.
- X * For stop, there can be more than one mapped at the same time.
- X */
- X
- #include "global.h"
- #include "bitmaps.h"
- #include <Xm/Xm.h>
- #include <Xm/Label.h>
- X
- #define MAXSTOPS 256 /* max number of stops */
- #define MAXSIGNS 256 /* max number of signs */
- #define OFFSET 2 /* offset for displaying signs */
- X
- ArrowSign arrowsign[MAXSIGNS];
- UpdownSign updownsign[MAXSIGNS];
- StopSign stopsign[MAXSIGNS];
- BombSign bombsign[MAXSIGNS];
- X
- Arrow arrow;
- Updown updown;
- Stops stops[MAXSTOPS]; /* array of stops */
- Bomb bomb;
- Cardinal nstops; /* number of stops */
- X
- /* Initialize data structures */
- X
- void signs_init()
- {
- X int i;
- X
- X for (i=0; i<MAXSIGNS; i++) {
- X arrowsign[i].w = NULL;
- X arrowsign[i].mapped = FALSE;
- X }
- X for (i=0; i<MAXSIGNS; i++) {
- X stopsign[i].w = NULL;
- X stopsign[i].mapped = FALSE;
- X }
- X arrow.i = 0;
- X arrow.line = 0;
- X strcpy(arrow.file, "");
- X updown.i = 0;
- X updown.line = 0;
- X strcpy(updown.file, "");
- X nstops = 0;
- X bomb.i = 0;
- X bomb.line = 0;
- X strcpy(bomb.file, "");
- }
- X
- X
- /* Create an arrow symbol, updown symbol or stop symbol:
- X * calculate the position of the symbol based on i, the number of lines
- X * from the top line.
- X * create the pixmap of the symbol
- X * display the symbol as a bitmap in a label widget.
- X */
- static Widget CreateSign(parent, sign, i)
- X Widget parent;
- X char *sign;
- X Cardinal i;
- {
- X Arg args[15];
- X Cardinal n;
- X Dimension source_height, height, width;
- X char *bits;
- X Pixel fg, bg;
- X int horizDistance, vertDistance, height_per_line;
- X int screen;
- X
- X if (displayedFile == NULL) return NULL;
- X
- X /* Get height and background pixel values of parent window */
- X XtSetArg(args[0], XmNheight, &source_height);
- X XtSetArg(args[1], XmNbackground, &bg);
- X XtGetValues(parent, args, 2);
- X
- X height_per_line = source_height/displayedFile->lines;
- X vertDistance = OFFSET + (i * height_per_line);
- X
- X screen = DefaultScreen(display);
- X
- X if (sign && !strcmp(sign, "arrow")) {
- X bits = arrow_bits;
- X width = arrow_width;
- X height = arrow_height;
- X horizDistance = 0;
- X fg = app_resources.arrow_color;
- X }
- X else if (sign && !strcmp(sign, "updown")) {
- X bits = updown_bits;
- X width = updown_width;
- X height = updown_height;
- X horizDistance = 0;
- X fg = app_resources.updown_color;
- X }
- X else if (sign && !strcmp(sign, "stop")) {
- X bits = stop_bits;
- X width = stop_width;
- X height = stop_height;
- X horizDistance = arrow_width;
- X fg = app_resources.stop_color;
- X }
- X else if (sign && !strcmp(sign, "bomb")) {
- X bits = bomb_bits;
- X width = bomb_width;
- X height = bomb_height;
- X horizDistance = 0;
- X fg = app_resources.bomb_color;
- X };
- X
- X n = 0;
- X XtSetArg(args[n], XmNborderWidth, 0); n++;
- X XtSetArg(args[n], XmNwidth, (XtArgVal) width); n++;
- X XtSetArg(args[n], XmNheight, (XtArgVal) height); n++;
- X XtSetArg(args[n], XmNlabelType, XmPIXMAP); n++;
- X XtSetArg(args[n], XmNlabelPixmap, XCreatePixmapFromBitmapData (
- X display, DefaultRootWindow(display), bits, width, height,
- X fg, bg, DefaultDepth(display, screen))); n++;
- X
- X XtSetArg(args[n], XmNx, (XtArgVal) horizDistance+5);
- X n++;
- X XtSetArg(args[n], XmNy, (XtArgVal) vertDistance+3); n++;
- X XtSetArg(args[n], XmNmappedWhenManaged, False); n++;
- X
- X return XtCreateManagedWidget(sign, xmLabelWidgetClass, parent, args, n);
- }
- X
- /*
- X * Given a line number, displays a stop sign if that line is viewable.
- X * If the stop widget for that line does not exist, create one and map it.
- X * If the stop widget exists but not mapped, map it.
- X */
- void DisplayStop(file, line)
- FileRec *file;
- int line;
- {
- X Cardinal i;
- X
- X if (line >= file->topline && line <= file->bottomline) {
- X i = line - file->topline;
- X if (stopsign[i].w == NULL) { /* widget does not exist */
- X
- X stopsign[i].w = CreateSign(sourceForm, "stop", i);
- X XtMapWidget(stopsign[i].w);
- X stopsign[i].mapped = 1;
- X }
- X else if (!stopsign[i].mapped) { /* widget not mapped */
- X XtMapWidget(stopsign[i].w);
- X stopsign[i].mapped = 1;
- X }
- X }
- }
- X
- /*
- X * Unmap all stop signs and then display only those stops that are viewable.
- X */
- void UpdateStops(file, reason)
- FileRec *file;
- int reason;
- {
- X Cardinal i;
- X int line;
- X Position vert;
- X Dimension source_height;
- X Arg args[1];
- X
- X
- X if (file == NULL) return;
- X for (i=0; i<file->lines; i++)
- X if (stopsign[i].w && stopsign[i].mapped) {
- X XtUnmapWidget(stopsign[i].w);
- X stopsign[i].mapped = 0;
- X }
- X
- X for (i=1; i<=nstops; i++)
- X if (stops[i].file && !strcmp(stops[i].file, file->pathname) &&
- X (line=stops[i].line) && line >= file->topline &&
- X line <= file->bottomline) {
- X DisplayStop(file, line);
- X }
- }
- X
- /*
- X * Given a line number, unmap the stop sign associated with that line.
- X */
- void RemoveStop(line)
- int line;
- {
- X Cardinal i;
- X char command[30];
- X
- X if (displayedFile && line >= displayedFile->topline &&
- X line <= displayedFile->bottomline) {
- X i = line - displayedFile->topline;
- X if (stopsign[i].w && stopsign[i].mapped) {
- X XtUnmapWidget(stopsign[i].w);
- X stopsign[i].mapped = 0;
- X
- X sprintf(command, "clear %d\n", line);
- X send_command(command);
- X Echo = False;
- X Parse = False;
- X Prompt = False;
- X while(!Prompt) read_dbx();
- X
- X }
- X }
- }
- X
- void ClearStops()
- {
- X int i;
- X
- X for (i=1; i<=nstops; i++) {
- X stops[i].file = NULL;
- X stops[i].line = 0;
- X }
- }
- X
- /* Unmap the current arrow sign.
- X * Display a new arrow sign if it is viewable.
- X */
- void UpdateArrow(file)
- FileRec *file;
- {
- X Cardinal i;
- X int line;
- X
- X if (file == NULL) return;
- X i = arrow.i;
- X if (i>=0 && i<file->lines)
- X if (arrowsign[i].w && arrowsign[i].mapped) {
- X XtUnmapWidget(arrowsign[i].w);
- X arrowsign[i].mapped = 0;
- X }
- X line = arrow.line;
- X if (arrow.file && !strcmp(arrow.file, file->pathname) &&
- X line >= file->topline && line <= file->bottomline) {
- X i = line - file->topline;
- X arrow.i = i;
- X if (arrowsign[i].w == NULL) {
- X arrowsign[i].w = CreateSign(sourceForm, "arrow", i);
- X XtMapWidget(arrowsign[i].w);
- X arrowsign[i].mapped = TRUE;
- X }
- X else if (!arrowsign[i].mapped) {
- X XtMapWidget(arrowsign[i].w);
- X arrowsign[i].mapped = TRUE;
- X }
- X }
- }
- X
- X
- /* If the new updown is on the same line as the arrow, remove the updown.
- X * Unmap current updown sign.
- X * Display the updown if it is viewable.
- X */
- void UpdateUpdown(file)
- FileRec *file;
- {
- X Cardinal i;
- X int line;
- X
- X if (file == NULL) return;
- X if (updown.file && !strcmp(updown.file, arrow.file) &&
- X !strcmp(updown.func, arrow.func) && (updown.line == arrow.line)) {
- X updown.line = 0;
- X strcpy(updown.file, "");
- X }
- X i = updown.i;
- X if (i>=0 && i<file->lines)
- X if (updownsign[i].w && updownsign[i].mapped) {
- X XtUnmapWidget(updownsign[i].w);
- X updownsign[i].mapped = 0;
- X }
- X line = updown.line;
- X if (updown.file && !strcmp(updown.file, file->pathname) &&
- X line >= file->topline && line <= file->bottomline) {
- X i = line - file->topline;
- X updown.i = i;
- X if (updownsign[i].w == NULL) {
- X updownsign[i].w = CreateSign(sourceForm, "updown", i);
- X XtMapWidget(updownsign[i].w);
- X updownsign[i].mapped = TRUE;
- X }
- X else if (!updownsign[i].mapped) {
- X XtMapWidget(updownsign[i].w);
- X updownsign[i].mapped = TRUE;
- X }
- X }
- }
- X
- /* Unmap the current bomb sign, if any.
- X * Display a new bomb sign.
- X */
- void UpdateBomb(file)
- FileRec *file;
- {
- X Cardinal i;
- X int line;
- X
- X if (file == NULL) return;
- X i = bomb.i;
- X if (i>=0 && i<file->lines)
- X if (bombsign[i].w && bombsign[i].mapped) {
- X XtUnmapWidget(bombsign[i].w);
- X bombsign[i].mapped = 0;
- X }
- X line = bomb.line;
- X if (bomb.file && !strcmp(bomb.file, file->pathname) &&
- X line >= file->topline && line <= file->bottomline) {
- X i = line - file->topline;
- X bomb.i = i;
- X if (bombsign[i].w == NULL) {
- X bombsign[i].w = CreateSign(sourceForm, "bomb", i);
- X XtMapWidget(bombsign[i].w);
- X bombsign[i].mapped = TRUE;
- SHAR_EOF
- true || echo 'restore of mxgdb/signs.c failed'
- fi
- echo 'End of part 8'
- echo 'File mxgdb/signs.c is continued in part 9'
- echo 9 > _shar_seq_.tmp
- exit 0
- --
- == James Tsillas Bull HN Information Systems Inc. ==
- == (508) 294-2937 300 Concord Road 826A ==
- == jtsillas@bubba.ma30.bull.com Billerica, MA 01821 ==
- == ==
- == The opinions expressed above are solely my own and do not reflect ==
- == those of my employer. ==
- -== no solicitations please ==-
-