📄 xdbx.c
字号:
/***************************************************************************** * * xdbx - X Window System interface to the dbx debugger * * Copyright 1989 The University of Texas at Austin * Copyright 1990 Microelectronics and Computer Technology Corporation * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appear in all copies and that * both that copyright notice and this permission notice appear in * supporting documentation, and that the name of The University of Texas * and Microelectronics and Computer Technology Corporation (MCC) not be * used in advertising or publicity pertaining to distribution of * the software without specific, written prior permission. The * University of Texas and MCC makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * THE UNIVERSITY OF TEXAS AND MCC DISCLAIMS ALL WARRANTIES WITH REGARD TO * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF TEXAS OR MCC BE LIABLE FOR * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Po Cheung * Created: March 10, 1989 * ***************************************************************************** * * xxgdb - X Window System interface to the gdb debugger * * Copyright 1990,1993 Thomson Consumer Electronics, Inc. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appear in all copies and that * both that copyright notice and this permission notice appear in * supporting documentation, and that the name of Thomson Consumer * Electronics (TCE) not be used in advertising or publicity pertaining * to distribution of the software without specific, written prior * permission. TCE makes no representations about the suitability of * this software for any purpose. It is provided "as is" without express * or implied warranty. * * TCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT * SHALL TCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. * * Adaptation to GDB: Pierre Willard * XXGDB Created: December, 1990 * *****************************************************************************//* xdbx.c * * Contain main program and initialization, command line options handling, * and resource database management. * * Syntax(): Print an error message if xdbx is invoked with an * incorrect number of arguments. * main_init(): Initialization routine. * dbxoptions(): Construct command line arguments for dbx. * main(): Main program. */#ifdef GDB#define XGDBVERSION "1.12"#endif#ifdef SYSV # include <stdio.h># include <stdlib.h># include <sys/param.h>#endif#include "global.h"#include "bitmaps.h"#include "patchlevel.h"#define VERSION "2.1"#define Offset(field) (XtOffset(XdbxResources *, field))char *progname;char cwd[MAXPATHLEN]; /* The current working directory */XtAppContext app_context; /* application context */Widget toplevel; /* top level widget */Display *display; /* connection to X server */Cursor watch; /* XC_watch cursor */XdbxResources app_resources; /* application resources of xdbx */char xdbxinit[LINESIZ]; /* initialization file name */Boolean Tstartup = False; /* if True, remove xdbxinit */Boolean debug = False; /* debug mode for xdbx */#ifdef GDBchar gdbinit[LINESIZ]; /* initialization file name (.gdbinit) */#endif /* GDB */static XtResource resources[] = { {"bell", "Bell", XtRBoolean, sizeof(Boolean), Offset(bell), XtRImmediate, (caddr_t)False}, {"displayWindow", "DisplayWindow", XtRBoolean, sizeof(Boolean), Offset(displayWindow), XtRImmediate, (caddr_t)False}, {"prompt", "Prompt", XtRString, sizeof(char *), Offset(prompt), XtRImmediate, (caddr_t)NULL}, /* CRL mod 4 3/15/91 GWC - added two new application resources */ {"db_name", "Prompt", XtRString, sizeof(char *), Offset(db_name), XtRImmediate, (caddr_t)NULL}, {"db_prompt", "Prompt", XtRString, sizeof(char *), Offset(db_prompt), XtRImmediate, (caddr_t)NULL}, {"nx", "nx", XtRBoolean, sizeof(Boolean), Offset(nx), XtRImmediate, (caddr_t)False}, {"delimiters", "Delimiters", XtRString, sizeof(char *), Offset(delimiters), XtRImmediate, (caddr_t)NULL}, {"stop_color", "StopColor", XtRPixel, sizeof(Pixel), Offset(stop_color), XtRString, "Red"}, {"arrow_color", "ArrowColor", XtRPixel, sizeof(Pixel), Offset(arrow_color), XtRString, "Blue"}, {"updown_color", "UpdownColor", XtRPixel, sizeof(Pixel), Offset(updown_color), XtRString, "Blue"}, {"bomb_color", "bombColor", XtRPixel, sizeof(Pixel), Offset(bomb_color), XtRString, "Red"}, {"dataDpyMaxHeight", "DataDpyMaxHeight", XtRDimension, sizeof(Dimension), Offset(dataDpyMaxHeight), XtRString, "300"}, {"dataDpyMaxWidth", "DataDpyMaxWidth", XtRDimension, sizeof(Dimension), Offset(dataDpyMaxWidth), XtRString, "600"}, {"tabstop", "TabStop", XtRInt, sizeof(int), Offset(tabstop), XtRString, "8"}, {"bigicon", "Xdbxoptions", XtRBoolean, sizeof(Boolean), Offset(bigicon), XtRImmediate, (caddr_t)False}, {"debug", "Xdbxoptions", XtRBoolean, sizeof(Boolean), Offset(debug), XtRImmediate, (caddr_t)False}, {"dbxopt_r", "Dbxoptions", XtRBoolean, sizeof(Boolean), Offset(dbxopt_r), XtRImmediate, (caddr_t)False}, {"dbxopt_i", "Dbxoptions", XtRBoolean, sizeof(Boolean), Offset(dbxopt_i), XtRImmediate, (caddr_t)False}, {"includeDir", "Dbxoptions", XtRString, sizeof(char *), Offset(includeDir), XtRImmediate, (caddr_t)NULL}, {"dbxopt_k", "Dbxoptions", XtRBoolean, sizeof(Boolean), Offset(dbxopt_k), XtRImmediate, (caddr_t)False}, {"cfile", "Dbxoptions", XtRString, sizeof(char *), Offset(cfile), XtRImmediate, (caddr_t)NULL}, {"dbxopt_kbd", "Dbxoptions", XtRBoolean, sizeof(Boolean), Offset(dbxopt_kbd), XtRImmediate, (caddr_t)False}, {"fcount", "Dbxoptions", XtRString, sizeof(char *), Offset(fcount), XtRImmediate, (caddr_t)NULL}, {"bindings", "Xdbxoptions", XtRString, sizeof(char *), Offset(bindings), XtRImmediate, (caddr_t)NULL},#ifdef GDB {"gdbinit", "Dbxoptions", XtRString, sizeof(char *), Offset(gdbinit), XtRImmediate, (caddr_t)NULL},#endif /* GDB */ {"startup", "Dbxoptions", XtRString, sizeof(char *), Offset(startup), XtRImmediate, (caddr_t)NULL}, {"tstartup", "Dbxoptions", XtRString, sizeof(char *), Offset(tstartup), XtRImmediate, (caddr_t)NULL},};String fallback_resources[] = { "*allowShellResize: True", "*borderWidth: 1", "*font: fixed", "*vpane.width: 550", "*fileWindow*font: variable", "*fileLabel.width: 500", "*lineLabel.width: 50",#ifdef NEW_INTERFACE "*sourceShell.geometry: 550x260+0+380", "*sourceForm.top: ChainTop", "*sourceForm.bottom: ChainBottom", "*sourceForm.left: ChainLeft", "*sourceForm.right: ChainRight", "*sourceForm.fromVert: fileWindow", "*sourceWindow.width: 558", "*sourceWindow.height: 220",#else "*sourceForm.preferredPaneSize: 320",#endif "*sourceWindow.leftMargin: 35", "*sourceWindow.scrollHorizontal: whenNeeded", "*sourceWindow.translations: #override \\n\ <Btn1Down>: SelectStart() SelectWord() \\n\ Shift<Btn1Up>: Update() SelectEnd() PrintSelection() \\n\ <Btn1Up>: Update() SelectEnd() \\n", "*messageWindow*font: variable", "*messageWindow.min: 30", "*messageWindow.max: 30", "*dialogWindow.preferredPaneSize: 240", "*dialogWindow.resizeToPreferred: True", "*dialogWindow.translations: #override \\n\ <Btn1Down>: SelectStart() SelectWord() \\n\ Shift<Btn1Up>: SelectEnd() PrintSelection() \\n\ <Btn1Up>: SelectEnd() \\n",#ifdef NEW_INTERFACE "*commandShell.geometry: 190x370+590+0",#else "*commandWindow.preferredPaneSize: 146", "*commandWindow.skipAdjust: True",#endif "*commandWindow.hSpace: 6", "*commandWindow.vSpace: 6", "*Command.height: 20", "*Command.width: 80", "*List.columnSpacing: 10",#ifdef NEW_INTERFACE "*displayShell.geometry: +590+450", "*displayWindow.top: ChainTop", "*displayWindow.bottom: ChainBottom", "*displayWindow.left: ChainLeft", "*displayWindow.right: ChainRight", "*displayWindow.width: 300", "*displayWindow.height: 100",#else "*displayWindow.preferredPaneSize: 50", "*displayWindow.skipAdjust: True",#endif "*displayWindow.scrollVertical: whenNeeded", "*displayWindow.scrollHorizontal: whenNeeded", "*displayWindow.translations: #override \\n\ <Btn1Down>: SelectStart() SelectWord() \\n\ Shift<Btn1Up>: SelectEnd() PrintSelection() \\n\ <Btn1Up>: SelectEnd() \\n", "*popup*showGrip: False", "*bindings: emacs", NULL,};static XrmOptionDescRec options[] = { {"-bigicon","bigicon", XrmoptionNoArg, "True"}, {"-debug", "debug", XrmoptionNoArg, "True"},/* CRL mod 4 4/1/91 GWC - command line options for db_name and db_prompt */ {"-db_name","db_name", XrmoptionSepArg, NULL}, {"-db_prompt","db_prompt", XrmoptionSepArg, NULL},#ifdef GDB {"-bindings", "bindings", XrmoptionSepArg, "emacs"}, {"-d", "includeDir", XrmoptionSepArg, NULL}, {"-nx", "nx", XrmoptionNoArg, "True"}, {"-i", "gdbinit", XrmoptionSepArg, NULL}, /* (PW)28DEC93 : add .gdbinit overwrite */#else
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -