"Fossies" - the Fresh Open Source Software Archive

Member "xxgdb-1.12/global.h" (6 Apr 1995, 10641 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  *****************************************************************************/
   60 
   61 /*  global.h:
   62  *
   63  *    Contain extern declarations of variables and functions.
   64  */
   65 
   66 #include "defs.h"
   67 
   68 
   69 #if defined(__GNUC__) && !defined(alloca)
   70 #define alloca __builtin_alloca
   71 #endif
   72 
   73 #ifndef __alpha
   74 #ifndef MAXPATHLEN
   75 #define MAXPATHLEN 1024
   76 #endif
   77 #endif
   78 
   79 #if defined(SYSV) && !defined(MAX)
   80 #define MAX(a,b)    ((a)>(b)?(a):(b))
   81 #define MIN(a,b)    ((a)>(b)?(b):(a))
   82 #ifdef sco
   83 #include <unistd.h>
   84 #endif
   85 #endif
   86 
   87 /* calldbx.c */
   88 
   89 extern void     calldbx();      /* fork child, exec dbx */
   90 
   91 /* command.c */
   92 
   93 extern void     CreateCommandPanel();
   94 extern void     send_command();
   95 extern char     *get_command();
   96 extern void     insert_command();
   97 extern void     delete_command();
   98 #ifdef NEW_INTERFACE
   99 extern void             Quit();
  100 #endif
  101 
  102 /* datadpy.c */
  103 
  104 extern void     print_handler();    /* printing variables */
  105 
  106 /* dbx.c */
  107 
  108 extern void     debug_init();       /* initial source display */
  109 extern void         read_dbx();     /* get data from dbx */
  110 extern void         write_dbx();        /* send data to dbx */
  111 extern void     query_dbx();        /* ask dbx for info */
  112 
  113 /* dialog.c */
  114 
  115 extern void     DeleteLine();       /* delete line action proc */
  116 extern void     DeleteWord();       /* delete word action proc */
  117 extern void     CreateDialogWindow();
  118 extern void         AppendDialogText(); /* append text to buffer */
  119 
  120 /* filemenu.c */
  121 
  122 extern void     File();         /* file button callback */
  123 
  124 /* handler.c */
  125 
  126 extern void     TextSetTopPosition();   /* sets topDisplayPosition */
  127 extern void         AdjustText();       /* adjust display position */
  128 extern void         exec_handler();     /* run, cont, next, step */
  129 extern void         done_handler();     /* run, cont, next, step */
  130 extern void         stop_at_handler();  /* stop at line */
  131 extern void         stop_in_handler();  /* stop in function */
  132 extern void         updown_handler();   /* move up/down the stack */
  133 extern void         delete_handler();   /* delete stop signs */
  134 extern void         func_handler();     /* display function */
  135 extern void         file_handler();     /* display file */
  136 extern void         debug_handler();    /* debug program */
  137 extern void         cd_handler();       /* change directory */
  138 extern void         pwd_handler();      /* print working directory */
  139 extern void         use_handler();      /* update use directory list */
  140 extern void         search_handler();   /* display searched string */
  141 extern void         list_handler();     /* list source code */
  142 extern void         display_handler();  /* show display variables */
  143 
  144 /* parser.c */
  145 
  146 extern void     parser_init();      /* initialization */
  147 extern void     parse();        /* parse dbx output */
  148 extern void     filter();       /* modify dbx output */
  149 
  150 /* signals.c */
  151 extern void     trap_signals();     /* signal handling for xdbx */
  152 
  153 /* signs.c */
  154 
  155 extern void     signs_init();       /* initilalize routine */
  156 extern void         DisplayStop();      /* show stop sign */
  157 extern void         UpdateStops();      /* update position of stops */
  158 extern void         ClearStops();       /* mark all stops invalid */
  159 extern void         RemoveStop();       /* undisplay stop sign */
  160 extern void         UpdateArrow();      /* update position of arrow */
  161 extern void         UpdateUpdown();     /* update position of updown */
  162 extern void         UpdateBomb();       /* update position of bomb */
  163 
  164 /* source.c */
  165 
  166 extern void     SelectStart();      /* modified select-start */
  167 extern void     SelectEnd();        /* modified select-end */
  168 extern void     SelectWord();       /* my select word */
  169 extern void     PrintSelection();   /* select variable and print */
  170 extern void     Update();       /* update line label */
  171 extern void     source_init();      /* init routine */
  172 extern void         CreateSourceWindow();
  173 extern int      LoadFile();     /* display source file */
  174 extern int      LoadCurrentFile();  /* display source file */
  175 extern char     *GetPathname();     /* get full path name of file */
  176 extern void     MakeDirList();      /* maintain list of dirs */
  177 
  178 /* utils.c */
  179 
  180 extern XawTextPosition  TextGetLastPos();   /* get last pos of text */
  181 extern int      TextPositionToLine();   /* convert line # to text pos */
  182 extern int      LineToStop_no();    /* convert line # to stop # */
  183 extern void         DisableWindowResize();  /* do not allow window resize */
  184 extern void         bell();         /* sound bell */
  185 extern char         *concat();      /* substring search */
  186 
  187 /* windows.c */
  188 
  189 extern void         CreateSubWindows(); /* all subwindows of xdbx */
  190 extern void         UpdateFileLabel();  /* update current file name */
  191 extern void         UpdateLineLabel();  /* update current line num */
  192 extern void         UpdateMessageWindow();  /* update xdbx message */
  193 
  194 /* extern variables */
  195 
  196 extern Display  *display;
  197 extern XtAppContext     app_context;
  198 extern Widget   toplevel, fileWindow, 
  199             sourceForm, sourceWindow, messageWindow, commandWindow, 
  200         dialogWindow, searchWindow,
  201 #ifndef NEW_INTERFACE
  202                 separator, 
  203 #endif
  204                 displayWindow;
  205 
  206 #ifdef NEW_INTERFACE
  207 extern Widget pcWindow;
  208 extern Widget sourceShell;
  209 extern Widget sourceToggle;
  210 extern Widget commandShell;
  211 extern Widget commandToggle;
  212 extern Widget displayShell;
  213 extern Widget displayToggle;
  214 extern Atom   wm_delete_window;
  215 #endif
  216 
  217 extern Cursor   watch;          /* XC_watch cursor */
  218 extern XdbxResources app_resources; /* application resources */
  219 extern char xdbxinit[];     /* initialization filename */
  220 extern char *dbxprompt;     /* dbx prompt string */
  221 extern char *xdbxprompt;        /* xdbx prompt string */
  222 extern Boolean  Tstartup;
  223 extern Boolean  debug;
  224 
  225 extern FileRec      *displayedFile; /* pointer to current file info */
  226 extern Tokens       Token;      /* token structure */
  227 extern PatternRec       dataPattern[];  /* data display pattern */
  228 
  229 #ifndef GDB
  230 extern Boolean  Echo;           /* echo dbx output onto window ? */
  231 extern Boolean  Parse;          /* flag for parser */
  232 #endif  /* not GDB */
  233 extern Boolean  Prompt;         /* command or program input ? */
  234 
  235 extern Boolean  FalseSignal;        /* real/false signal ? */
  236 extern Boolean  PopupMode;      /* True if graphical display */
  237 extern int  dbxpid;         /* dbx process id */
  238 extern FILE *dbxfp;         /* file pointer to dbx process */
  239 #ifdef CREATE_IO_WINDOW
  240 extern int iowinpid;                    /* process id of io window */
  241 extern char iowintty[];                 /* the tty of the io window */
  242 #endif /* CREATE_IO_WINDOW */
  243 
  244 extern char     CurrentFile[];      /* string for dbx output */
  245 extern char     cwd[];          /* current working directory of dbx */
  246 
  247 extern Arrow    arrow;          /* arrow widget and mapped info */
  248 extern Updown   updown;         /* updown widget and mapped info */
  249 extern Stops    stops[];        /* stop widget and mapped info */
  250 extern Bomb bomb;           /* bomb widget and mapped info */
  251 extern Cardinal nstops;         /* number of stops */
  252 
  253 #ifdef GDB
  254 extern void         display_info_handler();
  255 extern void         break_handler();
  256 extern void         info_dir_handler();
  257 extern void         directory_handler();
  258 extern void         info_line_handler();
  259 extern void         info_break_handler();
  260 extern void         info_source_handler();
  261 extern void         query_gdb();
  262 extern void         read_until_prompt();
  263 extern void         read_gdb();
  264 extern void         unknown_output();
  265 extern void         write_dbx_available();
  266 extern void         query_gdb_directories();
  267 extern void         show_is_undefined();
  268 extern void         read_source_file();
  269 extern void         StartEditor();
  270 extern void         signal_interrupt_dbx();
  271 extern int          new_gdb4();
  272 extern char *       GetSourcePathname();
  273 extern int          gdb_define_command();
  274 extern int          gdb_source_command();
  275 extern int          xxgdb_command();
  276 extern void         CleanUpFileTable();
  277 extern void         core_file_handler();
  278 extern void         frame_curr_handler();
  279 extern void         source_handler();
  280 #endif
  281 
  282 
  283 #ifdef GDB  /* (PW)11SEP91 : for gdb 4.0 */
  284 extern char cdir[]; /* compilation directory */
  285 extern char source_fullpath[];  /* source full path output by 'info_source' */
  286 extern char source_path[];      /* source file name */
  287 void simplify_path();
  288 extern char gdbinit[];          /* default gdb startup file (.gdbinit usually) */
  289 #endif