1 |
578 |
markom |
/* Tcl/Tk interface routines header file.
|
2 |
|
|
Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001
|
3 |
|
|
Free Software Foundation, Inc.
|
4 |
|
|
|
5 |
|
|
Written by Stu Grossman <grossman@cygnus.com> of Cygnus Support.
|
6 |
|
|
|
7 |
|
|
This file is part of GDB. It contains the public data that is shared between
|
8 |
|
|
the gdbtk startup code and the gdbtk commands.
|
9 |
|
|
|
10 |
|
|
This program is free software; you can redistribute it and/or modify
|
11 |
|
|
it under the terms of the GNU General Public License as published by
|
12 |
|
|
the Free Software Foundation; either version 2 of the License, or
|
13 |
|
|
(at your option) any later version.
|
14 |
|
|
|
15 |
|
|
This program is distributed in the hope that it will be useful,
|
16 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18 |
|
|
GNU General Public License for more details.
|
19 |
|
|
|
20 |
|
|
You should have received a copy of the GNU General Public License
|
21 |
|
|
along with this program; if not, write to the Free Software
|
22 |
|
|
Foundation, Inc., 59 Temple Place - Suite 330,
|
23 |
|
|
Boston, MA 02111-1307, USA. */
|
24 |
|
|
|
25 |
|
|
#ifdef _WIN32
|
26 |
|
|
#define GDBTK_PATH_SEP ";"
|
27 |
|
|
#else
|
28 |
|
|
#define GDBTK_PATH_SEP ":"
|
29 |
|
|
#endif
|
30 |
|
|
|
31 |
|
|
/* Some versions (1.3.79, 1.3.81) of Linux don't support SIOCSPGRP the way
|
32 |
|
|
gdbtk wants to use it... */
|
33 |
|
|
#ifdef __linux__
|
34 |
|
|
#undef SIOCSPGRP
|
35 |
|
|
#endif
|
36 |
|
|
|
37 |
|
|
/*
|
38 |
|
|
* These are the version numbers for GDBTK. There is a package require
|
39 |
|
|
* statement in main.tcl that checks the version. If you make an incompatible
|
40 |
|
|
* change to the gdb commands, or add any new commands, be sure to bump the
|
41 |
|
|
* version number both here and in main.tcl. This will save us the trouble of
|
42 |
|
|
* having a version of gdb find the wrong versions of the Tcl libraries.
|
43 |
|
|
*/
|
44 |
|
|
|
45 |
|
|
#define GDBTK_MAJOR_VERSION "1"
|
46 |
|
|
#define GDBTK_MINOR_VERSION "0"
|
47 |
|
|
#define GDBTK_VERSION "1.0"
|
48 |
|
|
|
49 |
|
|
/*
|
50 |
|
|
* These are variables that are needed in gdbtk commands.
|
51 |
|
|
*/
|
52 |
|
|
|
53 |
|
|
/* This variable determines where memory used for disassembly is read from.
|
54 |
|
|
If > 0, then disassembly comes from the exec file rather than the
|
55 |
|
|
target (which might be at the other end of a slow serial link). If
|
56 |
|
|
== 0 then disassembly comes from target. If < 0 disassembly is
|
57 |
|
|
automatically switched to the target if it's an inferior process,
|
58 |
|
|
otherwise the exec file is used. It is defined in gdbtk.c */
|
59 |
|
|
|
60 |
|
|
|
61 |
|
|
extern int disassemble_from_exec;
|
62 |
|
|
|
63 |
|
|
/* This variable is true when the inferior is running. Although it's
|
64 |
|
|
possible to disable most input from widgets and thus prevent
|
65 |
|
|
attempts to do anything while the inferior is running, any commands
|
66 |
|
|
that get through - even a simple memory read - are Very Bad, and
|
67 |
|
|
may cause GDB to crash or behave strangely. So, this variable
|
68 |
|
|
provides an extra layer of defense. It is defined in gdbtk.c */
|
69 |
|
|
|
70 |
|
|
extern int running_now;
|
71 |
|
|
|
72 |
|
|
/* These two control how the GUI behaves when tracing or loading
|
73 |
|
|
They are defined in gdbtk-cmds.c */
|
74 |
|
|
|
75 |
|
|
extern int No_Update;
|
76 |
|
|
extern int load_in_progress;
|
77 |
|
|
|
78 |
|
|
/* This is the main gdbtk interpreter. It is defined and initialized
|
79 |
|
|
in gdbtk.c */
|
80 |
|
|
|
81 |
|
|
extern Tcl_Interp *gdbtk_interp;
|
82 |
|
|
|
83 |
|
|
/*
|
84 |
|
|
* This structure controls how the gdb output is fed into gdbtk_call_wrapper invoked
|
85 |
|
|
* commands. See the explanation of gdbtk_fputs in gdbtk_hooks.c for more details.
|
86 |
|
|
*/
|
87 |
|
|
|
88 |
|
|
typedef struct gdbtk_result
|
89 |
|
|
{
|
90 |
|
|
Tcl_Obj *obj_ptr; /* This will eventually be copied over to the
|
91 |
|
|
Tcl result */
|
92 |
|
|
int flags; /* Flag vector to control how the result is
|
93 |
|
|
used. */
|
94 |
|
|
}
|
95 |
|
|
gdbtk_result;
|
96 |
|
|
|
97 |
|
|
struct target_ops;
|
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 |
|
|
gdbtk_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 |
|
|
#define GDBTK_ERROR_ONLY 16 /* Indicates that all incoming I/O is
|
121 |
|
|
to be treated as if it had arrived for gdb_stderr. This is
|
122 |
|
|
used to help error_begin in utils.c. */
|
123 |
|
|
|
124 |
|
|
/* This is a pointer to the gdbtk_result struct that
|
125 |
|
|
we are currently filling. We use the C stack to make a stack of these
|
126 |
|
|
structures for nested calls to gdbtk commands that are invoked through
|
127 |
|
|
the gdbtk_call_wrapper mechanism. See that function for more details. */
|
128 |
|
|
|
129 |
|
|
extern gdbtk_result *result_ptr;
|
130 |
|
|
|
131 |
|
|
/* If you want to restore an old value of result_ptr whenever cleanups
|
132 |
|
|
are run, pass this function to make_cleanup, along with the value
|
133 |
|
|
of result_ptr you'd like to reinstate. */
|
134 |
|
|
extern void gdbtk_restore_result_ptr (void *);
|
135 |
|
|
|
136 |
|
|
/* GDB context identifier */
|
137 |
|
|
extern int gdb_context;
|
138 |
|
|
|
139 |
|
|
/* Internal flag used to tell callers of ui_loop_hook whether they should
|
140 |
|
|
detach from the target. See explanations before x_event and gdb_stop. */
|
141 |
|
|
extern int gdbtk_force_detach;
|
142 |
|
|
|
143 |
|
|
/*
|
144 |
|
|
* These functions are used in all the modules of Gdbtk.
|
145 |
|
|
*
|
146 |
|
|
*/
|
147 |
|
|
|
148 |
|
|
extern int Gdbtk_Init (Tcl_Interp * interp);
|
149 |
|
|
extern void gdbtk_stop_timer (void);
|
150 |
|
|
extern void gdbtk_start_timer (void);
|
151 |
|
|
extern void gdbtk_ignorable_warning (const char *, const char *);
|
152 |
|
|
extern void gdbtk_interactive (void);
|
153 |
|
|
extern int x_event (int);
|
154 |
|
|
extern int gdbtk_two_elem_cmd (char *, char *);
|
155 |
|
|
extern int target_is_native (struct target_ops *t);
|
156 |
|
|
extern void gdbtk_fputs (const char *, struct ui_file *);
|
157 |
|
|
extern struct ui_file *gdbtk_fileopen (void);
|
158 |
|
|
extern int gdbtk_disable_fputs;
|
159 |
|
|
|
160 |
|
|
#ifdef _WIN32
|
161 |
|
|
extern void close_bfds ();
|
162 |
|
|
#endif /* _WIN32 */
|
163 |
|
|
|
164 |
|
|
extern void
|
165 |
|
|
TclDebug (char level, const char *fmt,...);
|
166 |
|
|
|
167 |
|
|
/* A convenience macro for getting the demangled source names,
|
168 |
|
|
regardless of the user's mangling style. */
|
169 |
|
|
#define GDBTK_SYMBOL_SOURCE_NAME(symbol) \
|
170 |
|
|
(SYMBOL_DEMANGLED_NAME (symbol) != NULL \
|
171 |
|
|
? SYMBOL_DEMANGLED_NAME (symbol) \
|
172 |
|
|
: SYMBOL_NAME (symbol))
|
173 |
|
|
|
174 |
|
|
|
175 |
|
|
/* gdbtk_add_hooks - add all the hooks to gdb. This will get called
|
176 |
|
|
by the startup code to fill in the hooks needed by core gdb. */
|
177 |
|
|
extern void gdbtk_add_hooks (void);
|
178 |
|
|
|