1998-07-02 03:29:14 +08:00
|
|
|
/* Tcl/Tk interface routines header file.
|
|
|
|
Copyright 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Written by Stu Grossman <grossman@cygnus.com> of Cygnus Support.
|
|
|
|
|
|
|
|
This file is part of GDB. It contains the public data that is shared between
|
|
|
|
the gdbtk startup code and the gdbtk commands.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|
|
|
|
Fri Nov 13 00:15:08 1998 Geoffrey Noer <noer@cygnus.com>
Changes to account for name change from cygwin32 to cygwin and
clean up Win32-related ifdefs.
* configure.tgt: check for cygwin* instead of cygwin32.
New cygwin gdb_target variable loses the "32".
* configure.host: check for cygwin* instead of cygwin32.
New cygwin gdb_host variable loses the "32".
* configure.in: test __CYGWIN__ instead of __CYGWIN32__,
rename gdb_cv_os_cygwin32 variable to drop the "32". Call
AM_EXEEXT instead of AC_EXEEXT since that isn't in a released
autoconf yet.
* configure: regenerate.
* main.c: drop "32" from cygwin_ funcs, include sys/cygwin.h
where
cygwin path conv protos live, instead of adding a proto here
for
them here.
* {main.c, ser-tcp.c, ser-unix.c, top.c}: check __CYGWIN__
instead of __CYGWIN32__.
* source.c: thoughout, check _WIN32 instead of WIN32.
* config/i386/cygwin32.mh: delete.
* config/i386/cygwin.mh: new file, was cygwin32.mh.
* config/i386/cygwin32.mt: delete.
* config/i386/cygwin.mt: new file, was cygwin32.mt.
* config/i386/tm-cygwin32.h: delete.
* config/i386/tm-cygwin.h: new file, was tm-cygwin32.h.
* config/i386/xm-cygwin32.h: delete.
* config/i386/xm-cygwin.h: new file, was xm-cygwin32.h.
* config/i386/xm-windows.h: #include xm-cygwin.h now.
* config/powerpc/cygwin32.mh: delete.
* config/powerpc/cygwin.mh: new file, was cygwin32.mh.
* config/powerpc/cygwin32.mt: delete.
* config/powerpc/cygwin.mt: new file, was cygwin32.mt.
* config/powerpc/tm-cygwin32.h: delete.
* config/powerpc/tm-cygwin.h: new file, was tm-cygwin32.h.
* config/powerpc/xm-cygwin32.h: delete.
* config/powerpc/xm-cygwin.h: new file, was xm-cygwin32.h.
* rdi-share/aclocal.m4: regenerate with aclocal.
* rdi-share/configure: regenerate with autoconf.
* rdi-share/{host.h, hostchan.c, hostchan.h, serdrv.c,
* serpardr.c,
unixcomm.c}: check __CYGWIN__ instead of __CYGWIN32__.
1998-11-13 16:16:08 +08:00
|
|
|
#ifdef _WIN32
|
1998-07-02 03:29:14 +08:00
|
|
|
#define GDBTK_PATH_SEP ";"
|
|
|
|
#else
|
|
|
|
#define GDBTK_PATH_SEP ":"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Some versions (1.3.79, 1.3.81) of Linux don't support SIOCSPGRP the way
|
|
|
|
gdbtk wants to use it... */
|
|
|
|
#ifdef __linux__
|
|
|
|
#undef SIOCSPGRP
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* These are the version numbers for GDBTK. There is a package require
|
|
|
|
* statement in main.tcl that checks the version. If you make an incompatible
|
|
|
|
* change to the gdb commands, or add any new commands, be sure to bump the
|
|
|
|
* version number both here and in main.tcl. This will save us the trouble of
|
|
|
|
* having a version of gdb find the wrong versions of the Tcl libraries.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define GDBTK_MAJOR_VERSION "1"
|
|
|
|
#define GDBTK_MINOR_VERSION "0"
|
|
|
|
#define GDBTK_VERSION "1.0"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* These are variables that are needed in gdbtk commands.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* This variable determines where memory used for disassembly is read from.
|
|
|
|
If > 0, then disassembly comes from the exec file rather than the
|
|
|
|
target (which might be at the other end of a slow serial link). If
|
|
|
|
== 0 then disassembly comes from target. If < 0 disassembly is
|
|
|
|
automatically switched to the target if it's an inferior process,
|
|
|
|
otherwise the exec file is used. It is defined in gdbtk.c */
|
|
|
|
|
|
|
|
|
|
|
|
extern int disassemble_from_exec;
|
|
|
|
|
|
|
|
/* This variable is true when the inferior is running. Although it's
|
|
|
|
possible to disable most input from widgets and thus prevent
|
|
|
|
attempts to do anything while the inferior is running, any commands
|
|
|
|
that get through - even a simple memory read - are Very Bad, and
|
|
|
|
may cause GDB to crash or behave strangely. So, this variable
|
|
|
|
provides an extra layer of defense. It is defined in gdbtk.c */
|
|
|
|
|
|
|
|
extern int running_now;
|
|
|
|
|
|
|
|
/* These two control how the GUI behaves when tracing or loading
|
1998-07-02 04:17:31 +08:00
|
|
|
They are defined in gdbtk-cmds.c */
|
1998-07-02 03:29:14 +08:00
|
|
|
|
|
|
|
extern int No_Update;
|
|
|
|
extern int load_in_progress;
|
|
|
|
|
|
|
|
/* This is the main gdbtk interpreter. It is defined and initialized
|
|
|
|
in gdbtk.c */
|
|
|
|
|
|
|
|
extern Tcl_Interp *gdbtk_interp;
|
|
|
|
|
Merging the Tracepoint changes back into the Trunk:
Wed Nov 4 12:41:42 1998 Jim Ingham <jingham@cygnus.com>
* actiondlg.tcl: Get the stack collect string from an instance
variable. Need to implement some way to get this from the
target settings...
* global_pref.tcl (toggle_tracing_mode): Add & remove hooks
when you go in and out of tracing mode. Also reset the B1
behavior when you leave tracing mode
* interface.tcl (gdbtk_tcl_trace_find_hook): Added the trace
find hook, so you can switch the GUI state when the tfind
command is used to enter & leave browse mode.
* srcbar.tcl (constructor, destructor trace_find_hook): Added
the trace_find_hook to the source toolbar, and added the
necessary hooks to handle it.
* srctextwin.tcl (trace_find_hook): Added a trace find hook to
the sourcebar as well.
* stack.tcl (update): protect against errors in gdb_stack.
Just return "NO STACK" if we couldn't get it.
* src_pref.tcl (constructor, cancel): Put all the saved prefs
in an array, on cancel, see if any have changed and only
rebuild the window if there have been changes.
Mon Nov 2 13:24:10 1998 Jim Ingham <jingham@cygnus.com>
* bp.tcl (update): The hook function was passing more
arguments than this function expected.
Mon Nov 2 11:16:10 1998 Jim Ingham <jingham@cygnus.com>
* toolbar.tcl: Added Tdump image.
Fri Oct 30 17:36:05 1998 Jim Ingham <jingham@cygnus.com>
* src.tcl (set_execution_status): Changed status messages,
tracing is not the same as async debugging...
Fri Oct 30 17:06:31 1998 Jim Ingham <jingham@cygnus.com>
* bp.tcl (bp_all): Only remove tracepoints in the tracepoint
window, and breakpoints in the breakpoint window.
Fri Oct 30 11:22:23 1998 Jim Ingham <jingham@cygnus.com>
* actiondlg.tcl: Added special tag "Collect Stack". This
still needs to get hooked into the target database to deal
with targets that need to do something special to collect the
stack. Also moved some repeated code into loops.
* main.tcl (source_file): Source in a file of gdb commands.
* srcbar.tcl (constructor): Added source file menu entry, and
made stack buttons belong to both the Trace & Control classes.
* srctextwin.tcl (constructor): One too many separators in the
trace trace popup menu.
* tclIndex: regenerated.
* tfind_args.tcl: Added "tfind frame"
* toolbar.tcl (create_button): Allow a button to belong to
more than one class.
* toolbar.tcl (enable_ui): Eliminate redundant code, and allow
a button to belong to more than one class.
* toolbar.tcl (create_trace_menu): Added save tracepoints &
Tfind frame menu items.
* tracedlg.tcl: Added deletion of actions, and fixed a
the whiile-stepping combobox callback for the new combobox.
* util.tcl (save_trace_commands): new proc.
1998-10-29 Michael Snyder <msnyder@demo-laptop2.cygnus.com>
* target.tcl: add /dev/cua0 for Linux.
Tue Oct 27 13:46:03 1998 Jim Ingham <jingham@cygnus.com>
* Many little bug fixes all over in order to get tracing to work
along with normal program control.
* toolbar.tcl: Rewrote much of the code here to put commonly
used code into functions, and clean up adding menus and
buttons. Added the ability to disable particular menu items,
not just whole menus. Added the ability to delete and insert
buttons on the fly.
* srcbar.tcl: Pushed the changes to toolbar.tcl into this file.
* srctextwin.tcl: Changed the code dealing with breakpoints
and tracepoints to use the text tags more consistently. Use
only one set of menus for the whole widget, rather than having
a separate set for the SRC+ASM case. Rewrote a lot of the
code to separate out the tracing & program control functions.
* interface.tcl (gdbtk_tcl_breakpoint): pass more information
to the scrtextwin when a breakpoint changes state, so it can
do the right thing without having to guess...
* tracedlg.tcl (build_win): get the packing right so the
window expands correctly.
* main.tcl: do_tstop -> tstop, do_tstart -> tstart to avoid
confusion with the methods in ScrBar.tcl.
* prefs.tcl: Added two new preferences B1_Behavior to control
whether B1 sets breakpoints or tracepoints.
* src_prefs.tcl: Put in support for the B1_Behavior.
* global_prefs.tcl: Put back tracing checkbox.
* tdump.tcl: Fixed an incorrect (1 rather than 1.0) text
widget line specification.
* tfind_args.tcl (build_win): Bind return in the entry to the
OK button. Clear the entry field if the Type has changed.
* utils.tcl: Added comments for the debug commands.
* watch.tcl (build_win): Flash the OK button before invoking it.
Wed Nov 4 12:41:42 1998 Jim Ingham <jingham@cygnus.com>
* gdbtk-cmds.c (gdb_set_bp_addr): Pass the type, enable & thread
to gdbtk_tcl_breakpoint.
* gdbtk-hooks.c (gdbtk_trace_find): Added this function. It is
the hook function for tfind commands.
* tracepoint.c (trace_find_command): Added the trace_find_hook,
run when you do trace_find_command.
* tracepoint.h: Define the trace_find_hook.
Mon Nov 2 11:16:10 1998 Jim Ingham <jingham@cygnus.com>
* gdbtk-cmds (gdb_get_tracepoint_info): Demangle C++ function names.
Fri Oct 30 11:22:23 1998 Jim Ingham <jingham@cygnus.com>
* gdbtk-cmds (gdb_get_tracepoint_info): Fixed typo.
Wed Oct 28 10:14:33 1998 Jim Ingham <jingham@cygnus.com>
* gdbtk-cmds.c: Made the bdtypes & bpdisp arrays shared so they
could be used in gdbtk-hooks.c (breakpoint_notify).
Also fixed a few error messages to actually print the bp number
rather that #%d...
* gdbtk-hooks.c (breakpoint_notify): pass more of the information
about the breakpoint into the Tcl command, so it does not have to
try and guess about information we have on the C side.
* gdbtk.h: Export the bptypes & pbdisp arrays.
1998-11-06 02:12:23 +08:00
|
|
|
/* These two are lookup tables for elements of the breakpoint structure that
|
|
|
|
gdbtk knows by string name. They are defined in gdbtk-cmds.c */
|
|
|
|
|
|
|
|
extern char *bptypes[];
|
|
|
|
extern char *bpdisp[];
|
|
|
|
|
1998-07-02 03:29:14 +08:00
|
|
|
/*
|
|
|
|
* This structure controls how the gdb output is fed into call_wrapper invoked
|
|
|
|
* commands. See the explanation of gdbtk_fputs in gdbtk_hooks.c for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct gdbtk_result {
|
|
|
|
Tcl_Obj *obj_ptr; /* This will eventually be copied over to the
|
|
|
|
Tcl result */
|
|
|
|
int flags; /* Flag vector to control how the result is
|
|
|
|
used. */
|
|
|
|
} gdbtk_result;
|
|
|
|
|
|
|
|
/* These defines give the allowed values for the gdbtk_result.flags field. */
|
|
|
|
|
|
|
|
#define GDBTK_TO_RESULT 1 /* This controls whether output from
|
|
|
|
gdbtk_fputs goes to the command result, or
|
|
|
|
to gdbtk_tcl_fputs. */
|
|
|
|
#define GDBTK_MAKES_LIST 2 /* whether gdbtk_fputs adds the
|
|
|
|
element it is outputting as a string, or
|
|
|
|
as a separate list element. */
|
|
|
|
#define GDBTK_IN_TCL_RESULT 4 /* Indicates that the result is already in the
|
|
|
|
Tcl result. You can use this to preserve
|
|
|
|
error messages from functions like
|
|
|
|
Tcl_GetIntFromObj. You can also store the
|
|
|
|
output of a call wrapped command directly in
|
|
|
|
the Tcl result if you want, but beware, it will
|
|
|
|
not then be preserved across recursive
|
|
|
|
call_wrapper invocations. */
|
|
|
|
#define GDBTK_ERROR_STARTED 8 /* This one is just used in gdbtk_fputs. If we
|
|
|
|
see some output on stderr, we need to clear
|
|
|
|
the result we have been accumulating, or the
|
|
|
|
error and the previous successful output
|
|
|
|
will get mixed, which would be confusing. */
|
|
|
|
|
|
|
|
|
|
|
|
/* This is a pointer to the gdbtk_result struct that
|
|
|
|
we are currently filling. We use the C stack to make a stack of these
|
|
|
|
structures for nested calls to gdbtk commands that are invoked through
|
|
|
|
the call_wrapper mechanism. See that function for more details. */
|
|
|
|
|
|
|
|
extern gdbtk_result *result_ptr;
|
|
|
|
|
1998-08-30 15:53:29 +08:00
|
|
|
/* GDB context identifier */
|
|
|
|
extern int gdb_context;
|
|
|
|
|
1998-07-02 03:29:14 +08:00
|
|
|
/*
|
|
|
|
* These functions are used in all the modules of Gdbtk.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
extern int Gdbtk_Init(Tcl_Interp *interp);
|
|
|
|
extern void gdbtk_stop_timer PARAMS ((void));
|
|
|
|
extern void gdbtk_start_timer PARAMS ((void));
|
|
|
|
extern void gdbtk_ignorable_warning PARAMS ((const char *));
|
|
|
|
extern void gdbtk_interactive PARAMS ((void));
|
|
|
|
extern void x_event PARAMS ((int));
|
|
|
|
extern int gdbtk_two_elem_cmd PARAMS ((char *, char *));
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
extern void close_bfds ();
|
|
|
|
#endif /* _WIN32 */
|
|
|
|
|
|
|
|
extern void
|
|
|
|
#ifdef ANSI_PROTOTYPES
|
|
|
|
TclDebug (const char *fmt, ...);
|
|
|
|
#else
|
|
|
|
TclDebug (va_alist);
|
|
|
|
#endif
|