Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com>
[deliverable/binutils-gdb.git] / gdb / gdbtk.h
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 WINNT
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 /*
82 * This structure controls how the gdb output is fed into call_wrapper invoked
83 * commands. See the explanation of gdbtk_fputs in gdbtk_hooks.c for more details.
84 */
85
86 typedef struct gdbtk_result {
87 Tcl_Obj *obj_ptr; /* This will eventually be copied over to the
88 Tcl result */
89 int flags; /* Flag vector to control how the result is
90 used. */
91 } gdbtk_result;
92
93 /* These defines give the allowed values for the gdbtk_result.flags field. */
94
95 #define GDBTK_TO_RESULT 1 /* This controls whether output from
96 gdbtk_fputs goes to the command result, or
97 to gdbtk_tcl_fputs. */
98 #define GDBTK_MAKES_LIST 2 /* whether gdbtk_fputs adds the
99 element it is outputting as a string, or
100 as a separate list element. */
101 #define GDBTK_IN_TCL_RESULT 4 /* Indicates that the result is already in the
102 Tcl result. You can use this to preserve
103 error messages from functions like
104 Tcl_GetIntFromObj. You can also store the
105 output of a call wrapped command directly in
106 the Tcl result if you want, but beware, it will
107 not then be preserved across recursive
108 call_wrapper invocations. */
109 #define GDBTK_ERROR_STARTED 8 /* This one is just used in gdbtk_fputs. If we
110 see some output on stderr, we need to clear
111 the result we have been accumulating, or the
112 error and the previous successful output
113 will get mixed, which would be confusing. */
114
115
116 /* This is a pointer to the gdbtk_result struct that
117 we are currently filling. We use the C stack to make a stack of these
118 structures for nested calls to gdbtk commands that are invoked through
119 the call_wrapper mechanism. See that function for more details. */
120
121 extern gdbtk_result *result_ptr;
122
123 /*
124 * These functions are used in all the modules of Gdbtk.
125 *
126 */
127
128 extern int Gdbtk_Init(Tcl_Interp *interp);
129 extern void gdbtk_stop_timer PARAMS ((void));
130 extern void gdbtk_start_timer PARAMS ((void));
131 extern void gdbtk_ignorable_warning PARAMS ((const char *));
132 extern void gdbtk_interactive PARAMS ((void));
133 extern void x_event PARAMS ((int));
134 extern int gdbtk_two_elem_cmd PARAMS ((char *, char *));
135
136 #ifdef _WIN32
137 extern void close_bfds ();
138 #endif /* _WIN32 */
139
140 extern void
141 #ifdef ANSI_PROTOTYPES
142 TclDebug (const char *fmt, ...);
143 #else
144 TclDebug (va_alist);
145 #endif
This page took 0.033568 seconds and 5 git commands to generate.