| 1 | /* Tcl/Tk interface routines header file. |
| 2 | Copyright 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. |
| 3 | |
| 4 | Written by Stu Grossman <grossman@cygnus.com> of Cygnus Support. |
| 5 | |
| 6 | This file is part of GDB. It contains the public data that is shared between |
| 7 | the gdbtk startup code and the gdbtk commands. |
| 8 | |
| 9 | This program is free software; you can redistribute it and/or modify |
| 10 | it under the terms of the GNU General Public License as published by |
| 11 | the Free Software Foundation; either version 2 of the License, or |
| 12 | (at your option) any later version. |
| 13 | |
| 14 | This program is distributed in the hope that it will be useful, |
| 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | GNU General Public License for more details. |
| 18 | |
| 19 | You should have received a copy of the GNU General Public License |
| 20 | along with this program; if not, write to the Free Software |
| 21 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
| 22 | |
| 23 | #ifdef _WIN32 |
| 24 | #define GDBTK_PATH_SEP ";" |
| 25 | #else |
| 26 | #define GDBTK_PATH_SEP ":" |
| 27 | #endif |
| 28 | |
| 29 | /* Some versions (1.3.79, 1.3.81) of Linux don't support SIOCSPGRP the way |
| 30 | gdbtk wants to use it... */ |
| 31 | #ifdef __linux__ |
| 32 | #undef SIOCSPGRP |
| 33 | #endif |
| 34 | |
| 35 | /* |
| 36 | * These are the version numbers for GDBTK. There is a package require |
| 37 | * statement in main.tcl that checks the version. If you make an incompatible |
| 38 | * change to the gdb commands, or add any new commands, be sure to bump the |
| 39 | * version number both here and in main.tcl. This will save us the trouble of |
| 40 | * having a version of gdb find the wrong versions of the Tcl libraries. |
| 41 | */ |
| 42 | |
| 43 | #define GDBTK_MAJOR_VERSION "1" |
| 44 | #define GDBTK_MINOR_VERSION "0" |
| 45 | #define GDBTK_VERSION "1.0" |
| 46 | |
| 47 | /* |
| 48 | * These are variables that are needed in gdbtk commands. |
| 49 | */ |
| 50 | |
| 51 | /* This variable determines where memory used for disassembly is read from. |
| 52 | If > 0, then disassembly comes from the exec file rather than the |
| 53 | target (which might be at the other end of a slow serial link). If |
| 54 | == 0 then disassembly comes from target. If < 0 disassembly is |
| 55 | automatically switched to the target if it's an inferior process, |
| 56 | otherwise the exec file is used. It is defined in gdbtk.c */ |
| 57 | |
| 58 | |
| 59 | extern int disassemble_from_exec; |
| 60 | |
| 61 | /* This variable is true when the inferior is running. Although it's |
| 62 | possible to disable most input from widgets and thus prevent |
| 63 | attempts to do anything while the inferior is running, any commands |
| 64 | that get through - even a simple memory read - are Very Bad, and |
| 65 | may cause GDB to crash or behave strangely. So, this variable |
| 66 | provides an extra layer of defense. It is defined in gdbtk.c */ |
| 67 | |
| 68 | extern int running_now; |
| 69 | |
| 70 | /* These two control how the GUI behaves when tracing or loading |
| 71 | They are defined in gdbtk-cmds.c */ |
| 72 | |
| 73 | extern int No_Update; |
| 74 | extern int load_in_progress; |
| 75 | |
| 76 | /* This is the main gdbtk interpreter. It is defined and initialized |
| 77 | in gdbtk.c */ |
| 78 | |
| 79 | extern Tcl_Interp *gdbtk_interp; |
| 80 | |
| 81 | /* These two are lookup tables for elements of the breakpoint structure that |
| 82 | gdbtk knows by string name. They are defined in gdbtk-cmds.c */ |
| 83 | |
| 84 | extern char *bptypes[]; |
| 85 | extern char *bpdisp[]; |
| 86 | |
| 87 | /* |
| 88 | * This structure controls how the gdb output is fed into call_wrapper invoked |
| 89 | * commands. See the explanation of gdbtk_fputs in gdbtk_hooks.c for more details. |
| 90 | */ |
| 91 | |
| 92 | typedef struct gdbtk_result { |
| 93 | Tcl_Obj *obj_ptr; /* This will eventually be copied over to the |
| 94 | Tcl result */ |
| 95 | int flags; /* Flag vector to control how the result is |
| 96 | used. */ |
| 97 | } gdbtk_result; |
| 98 | |
| 99 | /* These defines give the allowed values for the gdbtk_result.flags field. */ |
| 100 | |
| 101 | #define GDBTK_TO_RESULT 1 /* This controls whether output from |
| 102 | gdbtk_fputs goes to the command result, or |
| 103 | to gdbtk_tcl_fputs. */ |
| 104 | #define GDBTK_MAKES_LIST 2 /* whether gdbtk_fputs adds the |
| 105 | element it is outputting as a string, or |
| 106 | as a separate list element. */ |
| 107 | #define GDBTK_IN_TCL_RESULT 4 /* Indicates that the result is already in the |
| 108 | Tcl result. You can use this to preserve |
| 109 | error messages from functions like |
| 110 | Tcl_GetIntFromObj. You can also store the |
| 111 | output of a call wrapped command directly in |
| 112 | the Tcl result if you want, but beware, it will |
| 113 | not then be preserved across recursive |
| 114 | call_wrapper invocations. */ |
| 115 | #define GDBTK_ERROR_STARTED 8 /* This one is just used in gdbtk_fputs. If we |
| 116 | see some output on stderr, we need to clear |
| 117 | the result we have been accumulating, or the |
| 118 | error and the previous successful output |
| 119 | will get mixed, which would be confusing. */ |
| 120 | |
| 121 | |
| 122 | /* This is a pointer to the gdbtk_result struct that |
| 123 | we are currently filling. We use the C stack to make a stack of these |
| 124 | structures for nested calls to gdbtk commands that are invoked through |
| 125 | the call_wrapper mechanism. See that function for more details. */ |
| 126 | |
| 127 | extern gdbtk_result *result_ptr; |
| 128 | |
| 129 | /* GDB context identifier */ |
| 130 | extern int gdb_context; |
| 131 | |
| 132 | /* |
| 133 | * These functions are used in all the modules of Gdbtk. |
| 134 | * |
| 135 | */ |
| 136 | |
| 137 | extern int Gdbtk_Init(Tcl_Interp *interp); |
| 138 | extern void gdbtk_stop_timer PARAMS ((void)); |
| 139 | extern void gdbtk_start_timer PARAMS ((void)); |
| 140 | extern void gdbtk_ignorable_warning PARAMS ((const char *)); |
| 141 | extern void gdbtk_interactive PARAMS ((void)); |
| 142 | extern void x_event PARAMS ((int)); |
| 143 | extern int gdbtk_two_elem_cmd PARAMS ((char *, char *)); |
| 144 | |
| 145 | #ifdef _WIN32 |
| 146 | extern void close_bfds (); |
| 147 | #endif /* _WIN32 */ |
| 148 | |
| 149 | extern void |
| 150 | #ifdef ANSI_PROTOTYPES |
| 151 | TclDebug (const char *fmt, ...); |
| 152 | #else |
| 153 | TclDebug (va_alist); |
| 154 | #endif |