"Fossies" - the Fresh Open Source Software Archive

Member "xxgdb-1.12/defs.h" (3 Dec 1994, 10725 Bytes) of package /linux/misc/old/xxgdb-1.12.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /*****************************************************************************
    2  *
    3  *  xdbx - X Window System interface to the dbx debugger
    4  *
    5  *  Copyright 1989 The University of Texas at Austin
    6  *  Copyright 1990 Microelectronics and Computer Technology Corporation
    7  *
    8  *  Permission to use, copy, modify, and distribute this software and its
    9  *  documentation for any purpose and without fee is hereby granted,
   10  *  provided that the above copyright notice appear in all copies and that
   11  *  both that copyright notice and this permission notice appear in
   12  *  supporting documentation, and that the name of The University of Texas
   13  *  and Microelectronics and Computer Technology Corporation (MCC) not be 
   14  *  used in advertising or publicity pertaining to distribution of
   15  *  the software without specific, written prior permission.  The
   16  *  University of Texas and MCC makes no representations about the 
   17  *  suitability of this software for any purpose.  It is provided "as is" 
   18  *  without express or implied warranty.
   19  *
   20  *  THE UNIVERSITY OF TEXAS AND MCC DISCLAIMS ALL WARRANTIES WITH REGARD TO
   21  *  THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
   22  *  FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF TEXAS OR MCC BE LIABLE FOR
   23  *  ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
   24  *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
   25  *  CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
   26  *  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   27  *
   28  *  Author:     Po Cheung
   29  *  Created:    March 10, 1989
   30  * 
   31  *****************************************************************************
   32  * 
   33  *  xxgdb - X Window System interface to the gdb debugger
   34  *  
   35  *  Copyright 1990,1993 Thomson Consumer Electronics, Inc.
   36  *  
   37  *  Permission to use, copy, modify, and distribute this software and its
   38  *  documentation for any purpose and without fee is hereby granted,
   39  *  provided that the above copyright notice appear in all copies and that
   40  *  both that copyright notice and this permission notice appear in
   41  *  supporting documentation, and that the name of Thomson Consumer
   42  *  Electronics (TCE) not be used in advertising or publicity pertaining
   43  *  to distribution of the software without specific, written prior
   44  *  permission.  TCE makes no representations about the suitability of
   45  *  this software for any purpose.  It is provided "as is" without express
   46  *  or implied warranty.
   47  *
   48  *  TCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
   49  *  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
   50  *  SHALL TCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
   51  *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
   52  *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
   53  *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
   54  *  SOFTWARE.
   55  *
   56  *  Adaptation to GDB:  Pierre Willard
   57  *  XXGDB Created:      December, 1990
   58  *
   59  *  AJK, May 91
   60  *   1. Define help message for new dbx commands (whereis/whatis/which)
   61  *****************************************************************************/
   62 
   63 /*  defs.h
   64  *
   65  *    Contain #includes, #defines and typedefs
   66  */
   67 
   68 #include <stdio.h>
   69 #include <sys/param.h>
   70 #include <X11/Xos.h>
   71 #include <X11/IntrinsicP.h>
   72 #include <X11/StringDefs.h>
   73 #include <X11/Xaw/Cardinals.h>
   74 #include <X11/Xatom.h>
   75 #include <X11/Shell.h>
   76 #include <X11/Xaw/Paned.h>
   77 #include <X11/Xaw/Grip.h>
   78 #include <X11/Xaw/Form.h>
   79 #include <X11/Xaw/MenuButton.h>
   80 #include <X11/Xaw/SimpleMenu.h>
   81 #include <X11/Xaw/SmeBSB.h>
   82 #include <X11/Xaw/AsciiText.h>
   83 #include <X11/Xaw/TextP.h>
   84 #include <X11/Xaw/TextSrc.h>
   85 #include <X11/Xaw/Box.h>
   86 #include <X11/Xaw/Dialog.h>
   87 #include <X11/Xaw/List.h>
   88 #include <X11/Xaw/Command.h>
   89 #include <X11/Xaw/Toggle.h>
   90 #include <X11/Xaw/Label.h>
   91 #include <X11/cursorfont.h>
   92 
   93 #if XtVersion < 11005
   94 /* incompatibility of header file with X11R4 documentation */
   95 #define XawChainTop XtChainTop
   96 #define XawChainBottom  XtChainBottom
   97 #define XawChainLeft    XtChainLeft
   98 #define XawChainRight   XtChainRight
   99 #endif
  100 
  101 #ifndef AssignMax
  102 #define AssignMax(x, y)     if ((y) > (x)) x = (y)
  103 #endif
  104 #ifndef AssignMin
  105 #define AssignMin(x, y)     if ((y) < (x)) x = (y)
  106 #endif
  107 
  108 /* increase input LINESIZ to 4k from .5k (could still be too small) */
  109 #define LINESIZ         4096        /* input line length */
  110 
  111 #define MAXNAME         256     /* max identifier length */
  112 #define MAXARGS     20      /* max number of args */
  113 #define ADD_SIZE    16      /* # of files added during Realloc */
  114 #define CHARS_PER_LINE  20      /* estimated number of chars per line */
  115 #define ADD_LINES       50      /* # of lines to be added in realloc */
  116 #define NTOKENS     6       /* number of tokens */
  117 #ifdef GDB
  118 #define DEBUGGER        "gdb"       /* name of executable */
  119 #define XDBXPROMPT      "(xxgdb) "  /* xdbx prompt string */
  120 #else
  121 #define DEBUGGER        "dbx"       /* name of executable */
  122 #define XDBXPROMPT      "(xdbx) "   /* xdbx prompt string */
  123 #endif  /* GDB */
  124 #define DELIMITERS  " !%^&*()+=~|;:{},/#<?\"\n\t"
  125 
  126 #ifdef GDB
  127 #define BREAK_HELP  "Please select a function name or an address, or put cursor on a line to break at"
  128 #else
  129 #define STOP_AT_HELP    "Please select a line to stop at"
  130 #define STOP_IN_HELP    "Please select a function to stop in"
  131 /* AJK */
  132 #define WHATIS_HELP "Please select a variable"
  133 #endif /* GDB */
  134 #define DELETE_HELP "Please select a stop sign to delete"
  135 #define PRINT_HELP  "Please select an expression to print"
  136 #ifdef GDB
  137 #define UNDISPLAY_HELP  "Please select a number to undisplay"
  138 #else
  139 #define UNDISPLAY_HELP  "Please select an expression to undisplay"
  140 #endif /* GDB */
  141 #define SEARCH_HELP "Nothing to search"
  142 
  143 #define LASTCH(s)   (s[strlen(s)-1])
  144 #define SECLASTCH(s)    (s[strlen(s)-2])
  145 
  146 #ifdef SUNOS4
  147 typedef struct dirent   Directory;
  148 #else
  149 typedef struct direct   Directory;
  150 #endif
  151 
  152 typedef struct {
  153     Boolean   bell;     /* if True, bell on */
  154     Boolean   displayWindow;    /* if True, display window on startup */
  155     String    delimiters;   /* set of delimiters for word selection */
  156     String    prompt;       /* prompt string for xdbx */
  157 
  158 /* CRL mod 4 3/15/91 GWC - added two new app res */
  159     String    db_name;      /* name for dbx child */
  160     String    db_prompt;    /* prompt for dbx child */
  161 
  162     Boolean   nx;           /* if True, do not execute gdbinit */
  163 
  164     Pixel     stop_color;   /* color of stop sign */
  165     Pixel     arrow_color;  /* color of arrow sign */
  166     Pixel     updown_color; /* color of updown sign */
  167     Pixel     bomb_color;   /* color of bomb sign */
  168 
  169     Dimension dataDpyMaxHeight; /* data display window maximum height */
  170     Dimension dataDpyMaxWidth;  /* data display window maximum width */
  171 
  172     Boolean   bigicon;      /* xdbx option -bigicon */
  173     Boolean   debug;        /* xdbx option -debug */
  174 
  175     Boolean   dbxopt_r;     /* dbx option -r */
  176     Boolean   dbxopt_i;     /* dbx option -i */
  177     String    includeDir;   /* dbx option -I includeDir */
  178     Boolean   dbxopt_k;     /* dbx option -k */
  179     String    cfile;        /* Berkeley  dbx option -c file */
  180     Boolean   dbxopt_kbd;   /* Sun dbx option -kbd */
  181     String    fcount;       /* SunOS 4.0 dbx option -f fcount */
  182 #ifdef GDB
  183     String    gdbinit;      /* to overwrite ".gdbinit" default name */
  184 #endif
  185     String    startup;      /* SunOS 4.0 dbx option -s startup */
  186     String    tstartup;     /* SunOS 4.0 dbx option -sr tstartup */
  187     String    bindings;     /* which style text editing to use */
  188     Boolean   pixie;        /* Mips dbx option -pixie */
  189     int       tabstop;      /* tab widths */
  190 } XdbxResources;
  191 
  192 typedef struct {
  193     char        *filename;  /* name of file */
  194     char        *pathname;  /* full path name of file */
  195     char        *buf;       /* buffer holding source file */
  196     long        filesize;   /* size of file in bytes */
  197     time_t      mtime;      /* time last modified */
  198     int         lines;      /* # of lines on display */
  199     int         currentline;    /* line where caret is */
  200     int         topline;    /* top line number in the window */
  201     int         bottomline; /* bottom line number in window */
  202     int         lastline;   /* number of lines in source file */
  203     XawTextPosition     topPosition;    /* top display position of buffer */
  204     XawTextPosition     *linepos;   /* array of text pos for each newline */
  205 } FileRec, *FileRecPtr;
  206 
  207 typedef struct {
  208     char    *mesg;          /* part of matched string */
  209     unsigned    stop;           /* stop number */
  210     char    *func;          /* function name */
  211     int     line;           /* line number */
  212     char    *file;          /* file name */
  213     char    *display;       /* variable display output */
  214 } Tokens;
  215 
  216 typedef struct dataDpyList {
  217     struct dataDpyRec   *dataDpy;
  218     struct dataDpyList  *next;
  219 } DataDpyList;
  220 
  221 typedef struct dataDpyRec {
  222     int         id;
  223     Widget              popupshell;             /* parent of popup */
  224     Widget              popup;                  /* form widget */
  225     Widget              label;                  /* label widget */
  226     Widget              dataDpyWindow;          /* window for displaying data */
  227     char                *buf;                   /* text buffer */
  228     int                 buflen;
  229     XawTextPosition     *linepos;
  230     int                 numlines;
  231     int                 maxLineLength;
  232     int         state;          /* EMPTY, UNUSED, USED */
  233     struct dataDpyRec   *parent;        /* pointer to parent */
  234     struct dataDpyList  *childlist;     /* list of children */
  235 } DataDpyRec, *DataDpyRecPtr;
  236 
  237 typedef struct {
  238     char            *pat;       /* regular expression */
  239     struct re_pattern_buffer    *buf;       /* buffer for compile regex */
  240     int             reg_token[NTOKENS]; /* register number */
  241 } PatternRec, *PatternRecPtr;
  242 
  243 typedef struct commandRec {
  244     char        *command;
  245     struct commandRec   *next;
  246 } CommandRec, *CommandRecPtr;
  247 
  248 typedef struct {
  249     Cardinal    i;          /* index to arrowsign[] */
  250     char    file[MAXNAME];      /* file associated with */
  251     int     line;           /* line number */
  252     char    func[MAXNAME];      /* function name associated with */
  253 } Arrow;
  254 
  255 typedef struct {
  256     Cardinal    i;          /* index to updownsign[] */
  257     char    file[MAXNAME];      /* file associated with */
  258     int     line;           /* line number */
  259     char    func[MAXNAME];      /* function name associated with */
  260 } Updown;
  261 
  262 typedef struct {
  263     char    *file;          /* file associated with */
  264     int     line;           /* line number of stop */
  265     unsigned    tag;                    /* used in deleting stops */
  266 } Stops;
  267 
  268 typedef struct {
  269     Cardinal    i;          /* index to bombsign[] */
  270     char    file[MAXNAME];      /* file associated with */
  271     int     line;           /* line number */
  272     char    func[MAXNAME];      /* function name associated with */
  273 } Bomb;
  274 
  275 
  276 #ifdef GDB
  277 /* defined flags for query_gdb_gen() and read_gdb() */
  278 #define PARSE_ON    1
  279 #define PARSE_OFF   0
  280 #define ECHO_ON     2
  281 #define ECHO_OFF    0
  282 #define FILTER_ON   4
  283 #define FILTER_OFF  0
  284 #endif
  285 
  286 #define EDIT_BUTTON /* to get editor button and functionality */