home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-07-17 | 36.5 KB | 1,209 lines |
- Newsgroups: alt.sources
- From: jtsillas@sprite.ma30.bull.com (James Tsillas)
- Subject: mxgdb Part 9/9
- Date: 16 Jul 91 13:15:27
- Message-ID: <JTSILLAS.91Jul16131527@sprite.ma30.bull.com>
-
-
-
- ---- Cut Here and feed the following to sh ----
- #!/bin/sh
- # this is mxgdb.09 (part 9 of a multipart archive)
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file mxgdb/signs.c continued
- #
- if test ! -r _shar_seq_.tmp; then
- echo 'Please unpack part 1 first!'
- exit 1
- fi
- (read Scheck
- if test "$Scheck" != 9; 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/signs.c'
- else
- echo 'x - continuing file mxgdb/signs.c'
- sed 's/^X//' << 'SHAR_EOF' >> 'mxgdb/signs.c' &&
- X }
- X else if (!bombsign[i].mapped) {
- X XtMapWidget(bombsign[i].w);
- X bombsign[i].mapped = TRUE;
- X }
- X }
- }
- SHAR_EOF
- echo 'File mxgdb/signs.c is complete' &&
- chmod 0664 mxgdb/signs.c ||
- echo 'restore of mxgdb/signs.c failed'
- Wc_c="`wc -c < 'mxgdb/signs.c'`"
- test 10723 -eq "$Wc_c" ||
- echo 'mxgdb/signs.c: original size 10723, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= mxgdb/utils.c ==============
- if test -f 'mxgdb/utils.c' -a X"$1" != X"-c"; then
- echo 'x - skipping mxgdb/utils.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting mxgdb/utils.c (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'mxgdb/utils.c' &&
- static char rcsid[] = "$Id: utils.c,v 1.1.1.1 1991/05/16 21:42:53 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
- /* utils.c
- X *
- X * Contain common routines used by other functions.
- X *
- X * TextGetLastPos(): Get the last insertion position of text.
- X * TextPositionToLine(): Return text position give a line number.
- X * LineToStopNo(): Return the stop number given a line number.
- X * DisableWindowResize(): Fix the size of a window inside vpane.
- X * bell(): Ring the bell.
- X * concat(): Concatenate two strings together
- X */
- X
- #include "global.h"
- #include <Xm/Xm.h>
- #include <Xm/Text.h>
- X
- X
- XXmTextPosition TextGetLastPos(w)
- X Widget w;
- {
- X Arg args[MAXARGS];
- X XmTextPosition cursorPos;
- X
- X XtSetArg(args[0], XmNcursorPosition, &cursorPos);
- X XtGetValues(w, args, 1);
- X return(cursorPos);
- }
- X
- /*
- X * Get the line number where the caret is.
- X */
- int TextPositionToLine(pos)
- XXmTextPosition pos;
- {
- X int line;
- X
- X if (displayedFile) {
- X if (pos >= displayedFile->linepos[displayedFile->topline]) {
- X for (line = displayedFile->topline;
- X pos > displayedFile->linepos[line]; line++);
- X return (pos == displayedFile->linepos[line] ? line : line-1);
- X }
- X else {
- X for (line = 1; pos > displayedFile->linepos[line]; line++);
- X return (pos == displayedFile->linepos[line] ? line : line-1);
- X }
- X }
- X else
- X return 0;
- }
- X
- /*
- X * Return the stop number associated with a given line number.
- X * Return 0 if stop number not found.
- X */
- int LineToStop_no(line)
- int line;
- {
- X int i;
- X
- X for (i=1; i <= nstops; i++)
- X if (stops[i].line == line && stops[i].file && displayedFile &&
- X !strcmp(stops[i].file, displayedFile->pathname)) {
- X return i;
- X }
- X return 0;
- }
- X
- void bell(volume)
- int volume;
- {
- X XBell(XtDisplay(toplevel), volume);
- }
- X
- /* append string s2 to end of string s1 and return the result */
- X
- char *concat(s1, s2)
- char *s1, *s2;
- {
- X if (s2) {
- X if (s1 == NULL) {
- X s1 = XtMalloc((strlen(s2)+1)*sizeof(char));
- X strcpy(s1, s2);
- X }
- X else {
- X s1 = XtRealloc(s1, strlen(s1)+strlen(s2)+2);
- X strcat(s1, s2);
- X }
- X }
- #if 0 /*(PW)4DEC90 : bug ! if s2 is null, there is no reason to set s1 to 0 */
- X else
- X s1 = NULL;
- #endif
- X return (s1);
- }
- SHAR_EOF
- chmod 0664 mxgdb/utils.c ||
- echo 'restore of mxgdb/utils.c failed'
- Wc_c="`wc -c < 'mxgdb/utils.c'`"
- test 3928 -eq "$Wc_c" ||
- echo 'mxgdb/utils.c: original size 3928, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= mxgdb/gdb_handler.c ==============
- if test -f 'mxgdb/gdb_handler.c' -a X"$1" != X"-c"; then
- echo 'x - skipping mxgdb/gdb_handler.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting mxgdb/gdb_handler.c (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'mxgdb/gdb_handler.c' &&
- /* $Id: gdb_handler.c,v 1.5 1991/07/11 21:14:13 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
- /* gdb_handler.c
- X *
- X * WARNING : gdb_handler.c is included by handler.c for GDB.
- X *
- X * Contain action handlers for the parser to invoke upon a dbx command.
- X *
- X * updown_handler(): Update file, line label, updown arrow position.
- X * debug_handler(): Check directory use list, display main source file.
- X * pwd_handler(): Update current working directory.
- X * search_handler(): Adjust source file to display matched line.
- X * display_info_handler(): Update display window.
- X * break_handler(): Place stop sign on line or function or address specified.
- X * info_dir_handler(): Update search directory list.
- X * directory_handler(): Update search directory list.
- X * list_handler(): Adjust source file to display result.
- X * info_line_handler(): Update current file.
- X * clear_handler(): Remove stop sign.
- X * display_handler(): Update display window.
- X * info_break_handler(): Update stop signs.
- X * cd_handler(): Record current working directory.
- X * frame_curr_handler(): Update current function name.
- X * exec_handler(): Update file, line label, arrow position.
- X * done_handler(): Progrm execution completed, clear breakpoints
- X * source_handler(): Exec commands of source file specified.
- X * query_dbx_echo(): Send command with echo on.
- X */
- X
- #include <Xm/Xm.h>
- #include <Xm/Label.h>
- #include <Xm/PushB.h>
- X
- #ifdef SYSV
- # include <signal.h>
- #endif
- X
- void query_dbx_echo();
- X
- /*
- X * Display an outlined arrow to locate the calling routine in a stack
- X * frame. BSD and SUN dbx have slightly different output semantics here.
- X * The appropriate file with the calling routine is displayed and the
- X * file variable is set accordingly.
- X */
- void updown_handler()
- {
- X char command[LINESIZ], *func, *file;
- X int line;
- X
- X line = Token.line;
- X func = XtNewString(Token.func);
- #ifdef MIPS
- X LoadCurrentFile();
- #endif
- #ifdef BSD
- X file = GetPathname(Token.file);
- #else
- X if (line <= 0) line = 1;
- X LoadCurrentFile();
- X if (displayedFile)
- X file = displayedFile->pathname;
- #endif
- X
- X if (line <= 0 || func == NULL || file == NULL)
- X {
- X XtFree(func);
- X return;
- X }
- X
- X if (displayedFile && strcmp(file, displayedFile->pathname)) {
- X LoadFile(file);
- X }
- X updown.line = line;
- X strcpy(updown.func, func);
- X if (displayedFile)
- X strcpy(updown.file, displayedFile->pathname);
- X AdjustText(line);
- X XtFree(func);
- }
- X
- /* ARGSUSED */
- void debug_handler()
- {
- X /* debug_handler is executed at start-up and with 'symbol-file' command */
- X query_dbx("set screensize 0\n");
- X query_dbx("set prettyprint on\n");
- X query_dbx("info directories\n");
- X displayedFile = NULL; /* force reloading of source file */
- X
- X /* here we use query_dbx_echo instead of query_dbx so that any
- X error message will be displayed ! */
- X
- X query_dbx_echo("list ,main\n"); /* tell gdb to use main file
- X and get line number of main(). (,main will end at main) */
- X
- X if (LoadCurrentFile() == 0)
- X {
- X arrow.line = 0; /* clear arrow sign */
- X updown.line = 0; /* clear updown sign */
- X bomb.line = 0; /* clear bomb sign */
- X UpdateArrow(displayedFile);
- X UpdateUpdown(displayedFile);
- X UpdateBomb(displayedFile);
- X ClearStops();
- X UpdateStops(displayedFile, -1);
- X }
- X
- X UpdateMessageWindow("Ready for execution", NULL);
- X query_dbx("display\n"); /* clear display window */
- }
- X
- /* ARGSUSED */
- void pwd_handler(s)
- char *s;
- {
- X strcpy(cwd, (char *)strtok(s, "\n"));
- }
- X
- /* ARGSUSED */
- void search_handler()
- {
- X AdjustText(Token.line);
- }
- X
- /* ARGSUSED */
- /* Show output on the display window.
- X * If output is null but the display window is managed, replace contents of
- X * the display window with the null string.
- X */
- void display_info_handler()
- {
- X Arg args[MAXARGS];
- X Cardinal n;
- X
- X if (!Token.display || !strcmp(Token.display, "")) {
- X if (!XtIsManaged(displayFD))
- X return;
- X else {
- X XtFree(Token.display);
- X Token.display = XtNewString("");
- X }
- X }
- X
- X n = 0;
- X XtSetArg(args[n], XmNvalue, (XtArgVal) Token.display); n++;
- X XtSetValues(displayWindow, args, n);
- X XtFree(Token.display);
- X Token.display = 0; /*(PW)14JAN91 */
- }
- X
- /* Place a stop sign next to the line specified on the source file window
- X * if it is to be viewable.
- X */
- void break_handler()
- {
- char * file;
- int line;
- int stop;
- X
- X if (Token.stop == 0 || Token.line == 0 || Token.file == 0)
- X return;
- X
- X line = Token.line;
- X stop = Token.stop;
- X
- X if (Token.stop >= 256) /* see MAXSTOPS in signs.c */
- X {
- X fprintf(stderr,"Too many breakpoints\n");
- X return;
- X }
- X
- X /* load & display file if none is displayed */
- X
- X file = GetPathname(Token.file);
- X
- X if (file == NULL)
- X return; /* (PW)11JAN91 */
- X
- X if (displayedFile == NULL)
- X {
- X LoadFile(file);
- X AdjustText(line);
- X }
- X
- X stops[stop].file = file;
- X stops[stop].line = line;
- X stops[stop].tag = 0;
- X nstops = stop;
- X
- X /* display breakpoint sign if file is displayed */
- X
- X if (displayedFile)
- X {
- X if (!strcmp(file, displayedFile->pathname))
- X DisplayStop(displayedFile, line);
- X }
- }
- X
- /* info directories
- X */
- void info_dir_handler()
- {
- X if (Token.file)
- X MakeDirList(Token.file);
- }
- X
- /* ARGSUSED */
- void directory_handler(output)
- char *output;
- {
- X /* Note : for GDB, the 'directory' command with no
- X parameter will reset search directories to current
- X directory only. GDB requires confirmation */
- X
- X query_dbx("info directories\n");
- }
- X
- void list_handler()
- {
- X int line;
- X
- X line = Token.line;
- X
- X if (line)
- X {
- X /* We will display the last line listed.
- X Since we used 'list ,main' we will effectively display main in that case. */
- X
- X LoadCurrentFile(line);
- X AdjustText(line);
- X }
- X else
- X {
- X AppendDialogText("Error list command\n");
- X bell(0);
- X }
- }
- X
- /* ARGSUSED */
- void info_line_handler() /* Command was 'info line' */
- {
- X if (Token.file)
- X strcpy(CurrentFile, Token.file);
- X else
- X strcpy(CurrentFile, "");
- }
- X
- /*
- X * Clear handler remove the stop specified and undisplayed the stopsign
- X * if it's visible.
- X * It calls the dbx status command to find out what stops are left, and
- X * then update the array of stops accordingly.
- X */
- /* ARGSUSED */
- X
- void clear_handler()
- {
- X query_dbx("info break\n"); /* update breakpoints */
- }
- X
- void display_handler() /* display or undisplay */
- {
- X query_dbx("display\n"); /* update display */
- }
- X
- /*
- (gdb) info break
- Breakpoints:
- Num Enb Address Where
- #1 y 0x000022f4 in main (pw.c line 34)
- #2 y 0x000022a0 in foo (pw.c line 5)
- (gdb) info break
- No breakpoints.
- */
- X
- void info_break_handler(output_string)
- char *output_string;
- {
- int i;
- int line;
- char c;
- X
- X
- X if (!output_string)
- X return;
- X
- X while(*output_string)
- X {
- X if (*(output_string++) == '#')
- X {
- X if (sscanf(output_string, "%d %c", &i,&c) == 2)
- X if (i > 0 && i <= nstops && stops[i].line > 0 &&
- X (c == 'y' || c == 'o'))
- X stops[i].tag = 1;
- X }
- X }
- X
- X for (i=1; i<=nstops; i++)
- X if (stops[i].line > 0)
- X {
- X if (stops[i].tag)
- X stops[i].tag = 0;
- X else
- X {
- X
- X line = stops[i].line;
- X stops[i].line = 0;
- X stops[i].file = NULL;
- X if (LineToStop_no(line) == 0)
- X RemoveStop(line);
- X }
- X }
- }
- X
- /* ARGSUSED */
- void cd_handler(s)
- char *s;
- {
- X strcpy(cwd,s);
- }
- X
- /* this handler justs update the function name.
- Because the function name is not always displayed
- after next,step ... */
- X
- static char* funcname = 0;
- X
- void frame_curr_handler()
- {
- X if (Token.func == NULL)
- X return;
- X
- X if (funcname)
- X {
- X XtFree(funcname);
- X funcname = 0;
- X }
- X
- X funcname = XtNewString(Token.func);
- }
- X
- /* Handle dbx output of run, cont, next, step, return commands.
- X * Result of output parsing is returned in a set of tokens.
- X *
- X * If message is not 0, this is an important message and should
- X * be displayed instead of Token.mesg.
- X * This message will hold the Bus error and segmentation violation errors.
- X * signal is the signal number received (if any).
- X */
- void exec_handler(message,signal)
- char *message;
- int signal;
- {
- X int line, status;
- X char *func;
- X
- X /* Print "stopped in ..." line in message window
- X * Adjust text displayed
- X */
- X if (Token.line == 0)
- X return;
- X
- X if (message)
- X UpdateMessageWindow(message, NULL);
- X else
- X UpdateMessageWindow(Token.mesg, NULL);
- X
- X line = Token.line;
- X func = (Token.func) ? XtNewString(Token.func) : 0;
- X
- X if (Token.file)
- X status = LoadFile(Token.file);
- X
- X display_info_handler(); /* uses Token.display ! */
- X
- X /* because of tbreak, we have to call info break here */
- X
- X query_dbx("info break\n"); /* update breakpoints */
- X
- X if (func == NULL)
- X {
- X query_dbx("frame\n"); /* this will just update funcname (see frame_curr_handler) */
- X func = funcname;
- X if (func == NULL)
- X return;
- X funcname = 0; /* tell frame_curr_handler WE are going to XtFree it */
- X }
- X
- X arrow.line = line; /* update arrow sign position */
- X strcpy(arrow.func, func);
- X
- X updown.line = 0; /* remove updown, if any */
- X if (displayedFile) {
- X strcpy(arrow.file, displayedFile->pathname);
- X }
- X
- X /* Display bomb sign if segmentation fault occurs in source code */
- X
- X if (status != -1 && message && signal == SIGSEGV) {
- X arrow.line = 0;
- X bomb.line = line;
- X if (func)
- X strcpy(bomb.func, func);
- X if (displayedFile) strcpy(bomb.file, displayedFile->pathname);
- X }
- X else
- X bomb.line = 0;
- X
- X AdjustText(line);
- X XtFree(func);
- }
- X
- /* Remove all the arrow and updown signs, print message, then
- X * change the file variable to the file name displayed.
- X */
- void done_handler(message,signal)
- char *message;
- int signal;
- {
- X char command[LINESIZ];
- X
- X arrow.line = 0;
- X updown.line = 0;
- X UpdateArrow(displayedFile);
- X UpdateUpdown(displayedFile);
- X UpdateMessageWindow("Ready for execution", NULL);
- }
- X
- /* WARNING : source_handler() is NOT called by the parser.
- It is called by gdb_source_command() in gdb_parser.c.
- This is because 'source' command is NEVER sent to gdb,
- instead xxgdb sends the commands in the specified file
- one by one. */
- X
- void source_handler()
- {
- char *file;
- FILE *fp;
- char s[LINESIZ];
- X
- X if (!Token.file || !strcmp(Token.file, ""))
- X {
- X XtFree(Token.file);
- X Token.file = XtNewString(".gdbinit"); /* default is .gdbinit */
- X }
- X
- X file = GetPathname(Token.file);
- X
- X if (file == NULL)
- X return; /* (PW)11JAN91 */
- X
- X if (fp = fopen(file, "r"))
- X {
- X while (fgets(s, LINESIZ, fp))
- X {
- X /* DO NOT SEND \n and Take care of source command */
- X if ((*s != '#') && strcmp(s,"\n"))
- X {
- X if ((!gdb_source_command(s,TRUE))
- X && (!gdb_define_command(s,fp)))
- X {
- X write_dbx(s);
- X insert_command(s);
- X AppendDialogText(s);
- X }
- X Prompt = False;
- X while (!Prompt)
- X read_dbx();
- X }
- X }
- X close((int)fp);
- X }
- }
- X
- /* Sends a command to dbx and read the corresponding output, directly
- X * invoking the Xt input procedure, read_dbx().
- X *
- X * Same as query_dbx() in dbx.c except that Echo = True.
- X */
- void query_dbx_echo(command)
- char *command;
- {
- X write_dbx(command);
- X insert_command(command);
- X
- X Echo = True;
- X Prompt = False;
- X while (!Prompt)
- X read_dbx();
- X
- X Parse = True; /* Always reset Parse and Echo to True */
- X Echo = True;
- }
- X
- Widget helpbuttons[NHELPBUTTONS];
- char callbackargs[NHELPBUTTONS][40];
- Widget helplabels[NHELPLABELS];
- char helpstack[5][40];
- int helpstackidx=0;
- char help_buttons_use_flag = 0;
- X
- void HelpButtonActivate(w, helpname, call_data)
- X Widget w;
- X char *helpname;
- X XmPushButtonCallbackStruct *call_data;
- {
- X char command[256];
- X
- X strcpy(helpstack[helpstackidx++], helpname);
- X sprintf(command, "help %s\n", helpname);
- X help_buttons_use_flag = 1;
- X query_dbx(command);
- X help_buttons_use_flag = 0;
- }
- X
- void help_handler(command,output)
- char *command;
- char *output;
- {
- X Arg args[10];
- X int index=0;
- X int nlabel=0;
- X int nbutton=0;
- X Boolean isbutton;
- X char buttonstring[256];
- X char labelstring[256];
- X char *useforlabel;
- X int buttonindex=0;
- X int labelindex=0;
- X int atline=0;
- X Cardinal nargs=0;
- X
- X
- X
- X if(!XtIsManaged(helpFD))XtManageChild(helpFD);
- X if(help_buttons_use_flag == 0)
- X helpstackidx = 0;
- X
- X XtUnmanageChild(helpselectscroll);
- X
- X if(helpstackidx > 0)
- X XtManageChild(helpupbutton);
- X
- X if(helpstackidx < 1)
- X XtUnmanageChild(helpupbutton);
- X
- X
- X for(nlabel = 0; nlabel < NHELPLABELS; nlabel++)
- X if(helplabels[nlabel] && XtIsManaged(helplabels[nlabel]))
- X XtUnmanageChild(helplabels[nlabel]);
- X nlabel = 0;
- X
- X for(nbutton = 0; nbutton < NHELPBUTTONS; nbutton++)
- X if(helpbuttons[nbutton] && XtIsManaged(helpbuttons[nbutton]))
- X XtUnmanageChild(helpbuttons[nbutton]);
- X nbutton = 0;
- X
- X while(output[index])
- X {
- X buttonindex = 0;
- X labelindex=0;
- X isbutton = False;
- X while(output[index] != '\n')
- X {
- X if(isbutton == False)
- X buttonstring[buttonindex++] = output[index];
- X else
- X labelstring[labelindex++] = output[index];
- X index++;
- X if((output[index] == '-') && (output[index+1] == '-'))
- X {
- X isbutton = True;
- X buttonstring[buttonindex-1] = '\0';
- X }
- X }
- X if(isbutton == True)
- X {
- X labelstring[labelindex] = '\0';
- X useforlabel = labelstring;
- X strcpy(callbackargs[nbutton], buttonstring);
- X
- X XtSetArg(args[0], XmNlabelString,
- X XmStringCreateLtoR(buttonstring,
- X XmSTRING_DEFAULT_CHARSET));
- X XtSetArg(args[1], XmNleftAttachment, XmATTACH_FORM);
- X XtSetArg(args[2], XmNtopAttachment, XmATTACH_WIDGET);
- X XtSetArg(args[3], XmNhighlightOnEnter, True);
- X if(!nbutton)
- X XtSetArg(args[4], XmNtopWidget, helplabels[nlabel-1]);
- X else
- X XtSetArg(args[4], XmNtopWidget, helpbuttons[nbutton-1]);
- X if(!helpbuttons[nbutton])
- X {
- X helpbuttons[nbutton] =
- X XtCreateManagedWidget("helpbutton", xmPushButtonWidgetClass,
- X helpselectscroll, args, 5);
- X }
- X else
- X {
- X XtRemoveCallback(helpbuttons[nbutton], XmNactivateCallback,
- X HelpButtonActivate, callbackargs[nbutton]);
- X XtSetValues(helpbuttons[nbutton], args, 5);
- X XtManageChild(helpbuttons[nbutton]);
- X }
- X XtAddCallback(helpbuttons[nbutton], XmNactivateCallback,
- X HelpButtonActivate, callbackargs[nbutton]);
- X
- X nbutton++;
- X }
- X else
- X {
- X buttonstring[buttonindex] = '\0';
- X useforlabel = buttonstring;
- X }
- X XtSetArg(args[0], XmNlabelString,
- X XmStringCreateLtoR(useforlabel,
- X XmSTRING_DEFAULT_CHARSET));
- X XtSetArg(args[1], XmNrightAttachment, XmATTACH_FORM);
- X
- X if(isbutton == True)
- X {
- X XtSetArg(args[2], XmNleftAttachment, XmATTACH_WIDGET);
- X XtSetArg(args[3], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET);
- X XtSetArg(args[4], XmNbottomWidget, helpbuttons[nbutton-1]);
- X XtSetArg(args[5], XmNleftWidget, helpbuttons[nbutton-1]);
- X XtSetArg(args[6], XmNtopAttachment, XmATTACH_NONE);
- X XtSetArg(args[7], XmNalignment, XmALIGNMENT_BEGINNING);
- X nargs = 8;
- X }
- X else
- X {
- X XtSetArg(args[2], XmNleftAttachment, XmATTACH_FORM);
- X XtSetArg(args[3], XmNbottomAttachment, XmATTACH_NONE);
- X XtSetArg(args[4], XmNalignment, XmALIGNMENT_CENTER);
- X if(!nlabel)
- X {
- X XtSetArg(args[5], XmNtopAttachment, XmATTACH_FORM);
- X nargs = 6;
- X }
- X else
- X {
- X XtSetArg(args[5], XmNtopAttachment, XmATTACH_WIDGET);
- X XtSetArg(args[6], XmNtopWidget, helplabels[nlabel-1]);
- X nargs = 7;
- X }
- X }
- X if(!helplabels[nlabel])
- X helplabels[nlabel] = XtCreateManagedWidget("helplabel",
- X xmLabelWidgetClass,
- X helpselectscroll,
- X args, nargs);
- X else
- X {
- X XtSetValues(helplabels[nlabel], args, nargs);
- X XtManageChild(helplabels[nlabel]);
- X }
- X nlabel++;
- X
- X index++;
- X atline++;
- X }
- X XtManageChild(helpselectscroll);
- }
- X
- X
- X
- SHAR_EOF
- chmod 0664 mxgdb/gdb_handler.c ||
- echo 'restore of mxgdb/gdb_handler.c failed'
- Wc_c="`wc -c < 'mxgdb/gdb_handler.c'`"
- test 18708 -eq "$Wc_c" ||
- echo 'mxgdb/gdb_handler.c: original size 18708, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= mxgdb/Mxgdb.ad ==============
- if test -f 'mxgdb/Mxgdb.ad' -a X"$1" != X"-c"; then
- echo 'x - skipping mxgdb/Mxgdb.ad (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting mxgdb/Mxgdb.ad (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'mxgdb/Mxgdb.ad' &&
- Mxgdb*allowShellResize: True
- Mxgdb*vpane.sashWidth: 30
- Mxgdb*fileSel.borderWidth: 1
- Mxgdb*fileWindow.height: 15
- Mxgdb*fileLabel.borderWidth: 0
- Mxgdb*fileLabel.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*lineLabel.borderWidth: 0
- Mxgdb*lineLabel.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*helpbutton.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*fileCButton.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*filePbutton.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*searchPbutton.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*helpPbutton.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*quitPbutton.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*commandsCButton.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*runningCB.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*dataCB.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*breakpointsCB.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*stackCB.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*infoCB.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*runPMB.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*contPMB.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*nextPMB.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*stepPMB.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*finishPMB.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*printPMB.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*displayPMB.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*undisplayPMB.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*breakPMB.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*clearPMB.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*tbreakPMB.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*upPMB.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*downPMB.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*ilocalsPMB.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*iargsPMB.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*istackPMB.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*helpPMB.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*helpCButton.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*helpquitbutton.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*helpquitbutton.leftOffset: 5
- Mxgdb*helpquitbutton.topOffset: 5
- Mxgdb*helpupbutton.rightOffset: 5
- Mxgdb*helpupbutton.topOffset: 5
- Mxgdb*helpFD.borderWidth: 0
- Mxgdb*helpFD.shadowThickness: 0
- Mxgdb*scrollselect.topOffset: 40
- Mxgdb*scrollselect.bottomOffset: 5
- Mxgdb*scrollselect.leftOffset: 5
- Mxgdb*scrollselect.rightOffset: 5
- Mxgdb*scrollselect.height: 300
- Mxgdb*scrollselect.width: 400
- Mxgdb*sourceScroll.paneMinimum: 100
- Mxgdb*sourceForm.borderWidth: 0
- Mxgdb*sourceForm.shadowThickness: 0
- Mxgdb*sourceForm.width: 500
- Mxgdb*sourceWindow.borderWidth: 0
- Mxgdb*sourceWindow.highlightThickness: 0
- Mxgdb*sourceWindow.shadowThickness: 0
- Mxgdb*sourceWindow.rows: 19
- Mxgdb*sourceWindow.leftOffset: 50
- Mxgdb*sourceWindow.rightOffset: 65
- Mxgdb*sourceWindow.marginWidth: 5
- Mxgdb*sourceWindow.fontList: 6x13
- Mxgdb*sourceWindow.translations: #override \
- X Shift<Btn1Down>,Shift<Btn1Up>: SelectWord() Update(warp) \n\
- X <Btn1Down>: SelectStart() \n\
- X <Btn1Motion>: SelectAdjust() \n\
- X <Btn1Up>: SelectEnd() Update(warp) \n\
- X <Key>osfUp: process-up() Update() \n\
- X <Key>osfDown: process-down() Update() \n\
- X <Key>osfLeft: backward-character() Update() \n\
- X <Key>osfRight: forward-character() Update() \n\
- X <Key>osfPageDown: next-page() Update(warp) \n\
- X <Key>osfPageUp: previous-page() Update(warp) \n\
- X Ctrl<Key>osfPageUp: page-left() Update(warp) \n\
- X Ctrl<Key>osfPageDown: page-right() Update(warp) \n\
- X Ctrl<Key>osfBeginLine: beginning-of-file() Update() \n\
- X Ctrl<Key>osfEndLine: end-of-file() Update()
- Mxgdb*sourceForm.fractionBase: 100
- Mxgdb*messageWindow.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*messageWindow.height: 25
- Mxgdb*dialogWindowSW.paneMinimum: 50
- Mxgdb*dialogWindow.highlightOnEnter: True
- Mxgdb*dialogWindow.borderWidth: 1
- Mxgdb*dialogWindow.highlightThickness: 2
- Mxgdb*dialogWindow.shadowThickness: 2
- Mxgdb*dialogWindow.height: 200
- Mxgdb*dialogWindow.fontList: 6x13
- Mxgdb*dialogWindow.translations: #override \
- X Shift<Btn1Down>,Shift<Btn1Up>: SelectWord() \n\
- X <Btn1Down>: SelectStart() \n\
- X <Btn1Motion>: SelectAdjust() \n\
- X <Btn1Up>: SelectEnd()\n\
- X <Btn2Down>: InsertSelection() copy-primary() \n\
- X Ctrl<Key>C: SigInt()\n\
- X Ctrl<Key>D: SigEof()\n\
- X Ctrl<Key>|: SigQuit()\n\
- X <Key>osfBackSpace: InsertSpace() delete-previous-character() \n\
- X <Key>Return: end-of-file() newline() Dispatch() \n\
- X <Key>: end-of-file() self-insert()
- Mxgdb*displayWindow.translations: #override \n\
- X <Btn1Up>: set-insertion-point() SelectVar()
- Mxgdb*displayWindow.height: 150
- Mxgdb*displayWindow.borderWidth: 1
- Mxgdb*displayWindow.highlightThickness: 1
- Mxgdb*displayWindow.shadowThickness: 1
- Mxgdb*displayWindow.scrollHorizontal: False
- Mxgdb*displayWindow.fontList: 6x13
- Mxgdb*searchPopupShell.height: 150
- Mxgdb*searchPopupShell.width: 300
- Mxgdb*searchText.width: 265
- Mxgdb*searchText.height: 35
- Mxgdb*searchText.topPosition: 20
- Mxgdb*searchText.leftPosition: 5
- Mxgdb*searchText.rightPosition: 95
- Mxgdb*searchText.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*searchText.highlightOnEnter: True
- Mxgdb*arrowL.width: 40
- Mxgdb*arrowL.height: 40
- Mxgdb*arrowL.bottomPosition: 90
- Mxgdb*arrowL.leftPosition: 5
- Mxgdb*arrowL.highlightOnEnter: True
- Mxgdb*arrowL.borderWidth: 0
- Mxgdb*arrowL.shadowThickness: 3
- Mxgdb*arrowR.width: 40
- Mxgdb*arrowR.height: 40
- Mxgdb*arrowR.bottomPosition: 90
- Mxgdb*arrowR.leftPosition: 23
- Mxgdb*arrowR.highlightOnEnter: True
- Mxgdb*arrowR.borderWidth: 0
- Mxgdb*arrowR.shadowThickness: 3
- Mxgdb*cancelButton.x: 135
- Mxgdb*cancelButton.width: 65
- Mxgdb*cancelButton.height: 40
- Mxgdb*cancelButton.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*cancelButton.bottomPosition: 90
- Mxgdb*cancelButton.rightPosition: 65
- Mxgdb*cancelButton.highlightOnEnter: True
- Mxgdb*cancelButton.borderWidth: 0
- Mxgdb*cancelButton.shadowThickness: 3
- Mxgdb*helpButton.width: 65
- Mxgdb*helpButton.height: 40
- Mxgdb*helpButton.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*helpButton.bottomPosition: 90
- Mxgdb*helpButton.rightPosition: 95
- Mxgdb*helpButton.highlightOnEnter: True
- Mxgdb*helpButton.borderWidth: 0
- Mxgdb*helpButton.shadowThickness: 3
- Mxgdb*searchLabel.y: 5
- Mxgdb*searchLabel.fontList: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
- Mxgdb*searchLabel.borderWidth: 0
- Mxgdb*searchLabel.leftPosition: 5
- Mxgdb*searchLabel.topPosition: 5
- Mxgdb*pageLbutton.bottomPosition: 99
- Mxgdb*pageLbutton.topPosition: 88
- Mxgdb*undispbutton.bottomPosition: 99
- Mxgdb*undispbutton.topPosition: 88
- Mxgdb*undispbutton.rightOffset: 32
- Mxgdb*pageRbutton.bottomPosition: 88
- Mxgdb*pageRbutton.topPosition: 77
- Mxgdb*dispbutton.bottomPosition: 88
- Mxgdb*dispbutton.topPosition: 77
- Mxgdb*dispbutton.rightOffset: 32
- Mxgdb*breakbutton.bottomPosition: 77
- Mxgdb*breakbutton.topPosition: 66
- Mxgdb*clearbutton.bottomPosition: 77
- Mxgdb*clearbutton.topPosition: 66
- Mxgdb*clearbutton.rightOffset: 32
- Mxgdb*stepbutton.bottomPosition: 66
- Mxgdb*stepbutton.topPosition: 55
- Mxgdb*finishbutton.topPosition: 55
- Mxgdb*finishbutton.bottomPosition: 66
- Mxgdb*finishbutton.rightOffset: 32
- Mxgdb*nextbutton.bottomPosition: 55
- Mxgdb*nextbutton.topPosition: 44
- Mxgdb*contbutton.topPosition: 44
- Mxgdb*contbutton.bottomPosition: 55
- Mxgdb*contbutton.rightOffset: 32
- Mxgdb*printbutton.bottomPosition: 44
- Mxgdb*printbutton.topPosition: 33
- Mxgdb*printsbutton.bottomPosition: 44
- Mxgdb*printsbutton.topPosition: 33
- Mxgdb*printsbutton.rightOffset: 32
- Mxgdb*downbutton.bottomPosition: 33
- Mxgdb*downbutton.topPosition: 22
- Mxgdb*argsbutton.bottomPosition: 33
- Mxgdb*argsbutton.topPosition: 22
- Mxgdb*argsbutton.rightOffset: 32
- Mxgdb*upbutton.bottomPosition: 22
- Mxgdb*upbutton.topPosition: 11
- Mxgdb*localsbutton.bottomPosition: 22
- Mxgdb*localsbutton.topPosition: 11
- Mxgdb*localsbutton.rightOffset: 32
- Mxgdb*stackbutton.bottomPosition: 11
- Mxgdb*stackbutton.topPosition: 0
- Mxgdb*runbutton.topPosition: 0
- Mxgdb*runbutton.bottomPosition: 11
- Mxgdb*runbutton.rightOffset: 32
- SHAR_EOF
- chmod 0664 mxgdb/Mxgdb.ad ||
- echo 'restore of mxgdb/Mxgdb.ad failed'
- Wc_c="`wc -c < 'mxgdb/Mxgdb.ad'`"
- test 9020 -eq "$Wc_c" ||
- echo 'mxgdb/Mxgdb.ad: original size 9020, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= mxgdb/README ==============
- if test -f 'mxgdb/README' -a X"$1" != X"-c"; then
- echo 'x - skipping mxgdb/README (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting mxgdb/README (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'mxgdb/README' &&
- X
- 7-16-91
- X
- This is an alpha release of a Motif translation of xxgdb.
- During translation alot has been changed to fit the Motif style
- and my own personal preference. You may not agree with some of the
- changes and I ask that you let me know; I'll listen at the very least.
- X
- A bug which is in this version and which I have no time to fix
- is with the handling of the vertical scroll bar for the source
- window. Some source files may cause the scroll bar to fail. If you
- notice this problem please let me know and give some details as
- to how you found it.
- X
- I am ready to make additions and changes to the GUI. I am thinking of
- adding a vertically split source window with one window containing C code
- and the other containing corresponding _assembly code_. This sounds
- like a very neat feature but I'm wondering how useful.
- X
- The 'display' window command could also be spruced up. Send comments on
- this.
- X
- When writing GUI's its a big help if you know what the final look will be
- before you start so I am eager to hear from people who wish to see a
- particular look.
- X
- I have included a very big Mxgdb.ad resource file so that you can customize
- lots of stuff. This file will get froxen into the source in the beta-version.
- X
- Enjoy.
- X
- -Jim.
- SHAR_EOF
- chmod 0644 mxgdb/README ||
- echo 'restore of mxgdb/README failed'
- Wc_c="`wc -c < 'mxgdb/README'`"
- test 1231 -eq "$Wc_c" ||
- echo 'mxgdb/README: original size 1231, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- rm -f _shar_seq_.tmp
- echo You have unpacked the last part
- 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 ==-
-