diff options
author | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2004-03-24 04:10:01 +0000 |
---|---|---|
committer | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2004-03-24 04:10:01 +0000 |
commit | c4b3a45944f0638c35b7f94c94c0ebf73d16c194 (patch) | |
tree | ffc265f78503e66b9decc8bee3f7d8515d0df045 /gdb/gdbtk/generic | |
parent | 51771d455eee6505ad7ab5999cad8c9dc7a97d84 (diff) | |
download | gdb-ezannoni_pie-20040323-branch.tar.gz |
2004-03-23 Elena Zannoni <ezannoni@redhat.com>ezannoni_pie-20040323-branchcvs/ezannoni_pie-20040323-branch
* solib-svr4.c (svr4_solib_create_inferior_hook): Disable
breakpoints at startup.
(elf_locate_base): Find out where the entry point for the program
is, using the auxv vector, if possible. Compute the address of
.dynamic using it.
(svr4_current_sos): Don't ignore the first entry if we have PIE,
it's our main program. Delete code that was skipping over the
solib entry for main executable.
* solist.h (struct so_list): Add fields main and main_relocated.
(add_to_target_sections): Export.
* solib.c (symbol_add_stub): Handle main executable in shared
library list. Ignore it if it has been relocated already. Add it
as the main symbol file, otherwise.
* infrun.c (handle_inferior_event): Re-enable startup breakpoints.
* solib-svr4.c (elf_locate_base, first_link_map_member)
svr4_current_sos, enable_break): Add debugging output.
* solist.h (debug_solib): Export.
* solib.c (debug_solib): New variable to enable debugging output.
(symbol_add_stub, update_solib_list, update_solib_list)
(add_to_target_sections): Add debugging output.
(_initialize_solib): Add new comand to enable printing of
debugging output.
(add_to_target_sections): New function. Factored out from
update_solib_list.
(update_solib_list): Call add_to_target_sections.
* varobj.h (varobj_refresh): New prototype.
* varobj.c (varobj_refresh): New function.
* symfile.c (reread_symbols): Make sure that we recompute the
entry point for the program.
(symbol_file_clear): Clear the solibs as well, if we change symbol
files.
(clear_symtab_users): Refresh the varobjs that depend on the symtabs
we are clearing.
* objfiles.c (entry_point_address): Rewrite, to fetch entry point
from auxv vector, if possible.
Add include of elf/common.h.
* breakpoint.h (enum bptype): Add bp type bp_startup_disabled.
(re_enable_breakpoints_at_startup)
(disable_breakpoints_at_startup): Add prototypes
* breakpoint.c (re_enable_breakpoints_at_startup)
(disable_breakpoints_at_startup): New functions.
(describe_other_breakpoints, delete_breakpoint)
(breakpoint_re_set_one): Handle new bp type.
* auxv.h (target_auxv_parse, target_auxv_search): Update.
* auxv.c (target_auxv_parse, target_auxv_search)
(fprint_target_auxv): Use ULONGEST instead of CORE_ADDR for
variable. Change variable name to at_type.
Diffstat (limited to 'gdb/gdbtk/generic')
-rw-r--r-- | gdb/gdbtk/generic/ChangeLog-1997 | 1196 | ||||
-rw-r--r-- | gdb/gdbtk/generic/ChangeLog-1998 | 837 | ||||
-rw-r--r-- | gdb/gdbtk/generic/ChangeLog-1999 | 2624 | ||||
-rw-r--r-- | gdb/gdbtk/generic/ChangeLog-2000 | 211 | ||||
-rw-r--r-- | gdb/gdbtk/generic/gdbtk-bp.c | 994 | ||||
-rw-r--r-- | gdb/gdbtk/generic/gdbtk-cmds.c | 3001 | ||||
-rw-r--r-- | gdb/gdbtk/generic/gdbtk-cmds.h | 57 | ||||
-rw-r--r-- | gdb/gdbtk/generic/gdbtk-hooks.c | 795 | ||||
-rw-r--r-- | gdb/gdbtk/generic/gdbtk-interp.c | 177 | ||||
-rw-r--r-- | gdb/gdbtk/generic/gdbtk-main.c | 37 | ||||
-rw-r--r-- | gdb/gdbtk/generic/gdbtk-register.c | 581 | ||||
-rw-r--r-- | gdb/gdbtk/generic/gdbtk-stack.c | 623 | ||||
-rw-r--r-- | gdb/gdbtk/generic/gdbtk-varobj.c | 615 | ||||
-rw-r--r-- | gdb/gdbtk/generic/gdbtk-wrapper.c | 721 | ||||
-rw-r--r-- | gdb/gdbtk/generic/gdbtk-wrapper.h | 83 | ||||
-rw-r--r-- | gdb/gdbtk/generic/gdbtk.c | 764 | ||||
-rw-r--r-- | gdb/gdbtk/generic/gdbtk.h | 188 |
17 files changed, 0 insertions, 13504 deletions
diff --git a/gdb/gdbtk/generic/ChangeLog-1997 b/gdb/gdbtk/generic/ChangeLog-1997 deleted file mode 100644 index 365457035b8..00000000000 --- a/gdb/gdbtk/generic/ChangeLog-1997 +++ /dev/null @@ -1,1196 +0,0 @@ -Tue Dec 16 21:16:42 1997 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in (LIBGUI): New variable. - (GUI_CFLAGS_X): New variable. - (IDE_CFLAGS): Add $(GUI_CFLAGS_X). - * configure.in: Add $(LIBGUI) to TCL_LIBS and CONFIG_DEPS. - * configure: Rebuild. - -Wed Dec 10 13:16:45 1997 Keith Seitz <keiths@onions.cygnus.com> - - * gdbtk.c (gdb_get_tracepoint_info): Use info in struct - symtab_and_line (not struct tracepoint) so that we get the - real line info for an address. Arrange data more like - gdb_get_breakpoint_info. - (tracepoint_notify): Use info in struct symtab_and_line again. - (gdbtk_init): Add command "gdb_get_tracepoint_list" into - interpreter. - (gdb_get_tracepoint_list): New function that aids the source - window in displaying tracepoints when the file changes. - -Fri Dec 5 10:31:23 1997 Keith Seitz <keiths@pizza.cygnus.com> - - * gdbtk.c (gdbtk_init): Add gdb_find_file into interpreter. - (gdb_find_file_command): New function which searches source path - to find the real full filename of a file. - -Mon Dec 1 10:19:44 1997 Keith Seitz <keiths@onions.cygnus.com> - - * gdbtk.c: Move include of "guitcl.h" back out of IDE ifdef. - (gdbtk_init): Move ide_initialize_paths out of IDE ifdef. - - * configure.in (TCL_LIBS, CONFIG_DEPS): Add IDE libraries for all - builds. - (CONFIG_OBS): Remove tracepoint.o, which should always be included. - - * configure: regenerate - - * Makefile.in (install-only): ALWAYS install the new gdbtk - (REMOTE_OBS): add tracepoint.o - -Thu Nov 27 09:07:18 1997 Michael Meissner <meissner@cygnus.com> - - * configure.in ({TCL_LIBS,CONFIG_DEPS}): Don't add IDE libraries - if not --enable-ide. - (CONFIG_OBS): Add tracepoint.o to list if --enable-gdbtk. - * configure: Regenerate. - - * gdbtk.c (gdb_get_breakpoint_info): Add missing filename - argument. - (toplevel): Move include of guitcl.h into #ifdef IDE region. - (gdbtk_init): Move ide_initialize_paths call into #ifdef IDE - section. - - * Makefile.in (gdbtk.o): Update dependencies. - -Wed Nov 26 15:02:43 1997 Keith Seitz <keiths@onions.cygnus.com> - - * gdbtk.c (gdb_loc): symtab_to_filename can return NULL. - (breakpoint_notify): Ditto. - (gdb_get_breakpoint_info): Ditto. - -Wed Nov 26 11:33:09 1997 Keith Seitz <keiths@onions.cygnus.com> - - Merge in code from Foundry branch: - - * Makefile.in (install-only): install the new gdbtk, not the old - - * gdbtk.c (gdbtk_call_command): also run idle hooks for class_trace - commands - (gdbtk_init): Add new commands "gdb_get_locals", "gdb_get_args", - "gdb_get_function", "gdb_get_line", "gdb_get_file", - "gdb_tracepoint_exists", "gdb_get_tracepoint_info", "gdb_actions", - and "gdb_prompt". - (gdb_get_vars_command): New function. - (gdb_get_line_command): New. - (gdb_get_file_command): New. - (gdb_get_function_command): New. - (gdb_get_tracepoint_info): New. - (gdbtk_create_tracepoint): New. - (gdbtk_delete_tracepoint): New. - (tracepoint_notify): New. - (tracepoint_exists): New. - (gdb_actions_command): New. - (gdb_tracepoint_exists_command): New. - (gdb_prompt_command): New. - -Thu Nov 13 18:15:54 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c: Move include of gdbcore.h to top of file. - (close_bfds): New static function if _WIN32. - (gdbtk_readline): Call close_bfds. - (call_wrapper, tk_command_loop): Likewise. - (gdb_clear_file): New static function. - (gdbtk_init): Create gdb_clear_file Tcl command. - -Wed Nov 12 14:58:39 1997 Jeff Holcomb <jeffh@cygnus.com> - - * gdbtk.c: gdbtk_load_hash and ui_load_progress_hook return an - int result. - (gdbtk_load_hash): download hash routine returns an int result. - -Mon Nov 10 15:11:51 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c (gdbtk_init): Call ide_create_shell_execute_command if - __CYGWIN32__. - * configure.in: Add -lshell32 to WIN32LIBS on cygwin32. - * configure: Rebuild. - -Sun Nov 9 16:25:34 1997 Tom Tromey <tromey@cygnus.com> - - * gdbtk.c (gdbtk_init): Run ide_create_help_command. - -Tue Oct 28 17:31:47 1997 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdbtk_init): Call ide_create_winprint_command. - -Thu Oct 23 15:53:37 1997 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: Add -lgdi32 to WIN32LIBS when linking gdbtk on - cygwin32. - * configure: Rebuild. - -Wed Oct 22 21:32:54 1997 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdbtk_init): Create sizebox command on Windows. - -Thu Oct 9 14:33:21 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c (gdbtk_init): Remove assertion argument from call to - ide_create_window_register_command. - -Wed Oct 1 11:09:52 1997 Tom Tromey <tromey@cygnus.com> - - * gdbtk.c (gdbtk_init): Pass name of restore interface to - ide_create_window_register_command. - -Fri Sep 26 21:08:22 1997 Keith Seitz <keiths@pizza.cygnus.com> - - * gdbtk.c (gdbtk_init): Initialize ui_load_progress_hook. - -Thu Sep 25 03:05:00 1997 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdb_load_info): New function. Returns a list - of section names and sizes for an executable. - (gdbtk_load_hash): Stub function to call tcl function - download_hash. - -Tue Sep 23 01:29:00 1997 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdb_get_mem): Fix compiler warning. - -Sun Sep 21 00:15:00 1997 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdb_get_mem): Fix problem with ASCII dump. - -Tue Sep 16 18:07:17 1997 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdb_get_mem): New function. Returns - a formatted memory dump with optional ASCII dump. - -Mon Sep 8 12:48:50 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c: Include ilutk.h if IDE. - (gdb_confirm_quit, gdb_force_quit): New static functions. - (gdbtk_init): Add Tcl commands gdb_confirm_quit and - gdb_force_quit. - -Mon Sep 8 03:05:33 1997 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdb_get_breakpoint_info): Now returns the - function a breakpoint is in. - -Fri Sep 5 20:23:58 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c (gdbtk_init): Call ide_create_exit_command. - -Wed Sep 3 19:39:15 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c: Include guitcl.h. - (gdbtk_init): Always call ide_initialize_paths. Set the Tcl - variable IDE to 1 when using the IDE. Always try using auto path - to find main.tcl. - * Makefile.in (IDE_CFLAGS_X): Always include libide. - (LIBIDE): New variable. - (IDE_X): Omit -lide. - (IDE_DEPS): Omit libide. - * configure.in: Add LIBIDE to TCL_LIBS and CONFIG_DEPS. - * configure: Rebuild. - -Mon Aug 25 02:28:55 1997 Keith Seitz <keiths@pizza.cygnus.com> - - * gdbtk.c: (gdb_target_has_inferior) check if inferior_pid is non-zero - before assuming that the inferior is running. - -Mon Aug 25 01:06:48 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c (gdbtk_start_timer): Pass third argument to setitimer. - (gdbtk_stop_timer): Likewise. - -Mon Aug 25 00:23:08 1997 Keith Seitz <keiths@pizza.cygnus.com> - - * gdbtk.c: (gdbtk_init) create new command "gdb_target_has_execution" - (gdb_target_has_execution_command) new function - -Sun Aug 24 20:27:22 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c (gdb_loc): If there are no symbols, just bail - immediately. - (tk_command_loop): Print errors encountered while running - gdbtk_tcl_preloop. - -Sun Aug 24 13:44:03 1997 Tom Tromey <tromey@cygnus.com> - - * gdbtk.c (gdbtk_init): Run ide_create_build_command. - -Sat Aug 23 21:53:39 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c: If CYGWIN32, include <sys/time.h>. - (x_fd): Don't define if WINNT. - (gdbtk_start_timer, gdbtk_stop_timer): New static functions if - CYGWIN32. - (gdbtk_wait): Don't set up signal handling if WINNT. If CYGWIN32, - call gdbtk_start_timer and gdbtk_stop_timer. - (gdbtk_init): Don't set up signal handling or make x_fd - asynchronous if CYGWIN32. - -Fri Aug 22 15:23:15 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c (error_string_ptr): New static variable. - (gdbtk_fputs): If result_ptr is NULL, and error_string_ptr is not - NULL, and we're outputting to stderr, append string to - error_string_ptr rather than calling gdbtk_tcl_fputs. - (call_wrapper): Set up error_string_ptr. Put both error string - and normal string in Tcl result. - - * gdbtk.c (gdbtk_init): Don't call ide_run_server_init until after - gdb has initialized. - -Thu Aug 21 19:14:38 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c: If _WIN32, include winuser.h. - (gdbtk_init): If _WIN32, use MessageBox to display an error - evaluating main.tcl. - -Thu Aug 21 00:48:00 1997 Martin M. Hunt <hunt@pern.cygnus.com> - - * gdbtk.c (gdbtk_init): Add call to ide_run_server_init(). - (gdb_cmd): For the load command, don't buffer the I/O. - -Wed Aug 20 11:41:22 1997 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdbtk_query): Chaneg free() call to Tcl_Free(). - -Tue Aug 19 17:09:19 1997 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in (TCL_DEPS, TK_DEPS): New variables. - (ITCL_DEPS, TIX_DEPS): New variables. - (IDE_DEPS): New variable. - (CDEPS): Include @CONFIG_DEPS@. - * configure.in: Set and substitute CONFIG_DEPS and TIX_DEPS. - * configure: Rebuild. - -Sun Aug 17 00:42:11 1997 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdb_listfuncs): New function that returns - a list of all the functions in a source file. - -Tue Aug 12 16:35:21 1997 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in (install-only): Install tclIndex if ENABLE_IDE. - -Mon Aug 11 10:43:04 1997 Tom Tromey <tromey@cygnus.com> - - * gdbtk.c (gdbtk_init): Use ide_event_init_from_environment. - -Fri Aug 8 15:59:24 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c (gdbtk_init): Change gdbtk_lib_tmp and gdbtk_file to be - dynamically allocated, rather than fixed size. Pass "gdbtcl" to - ide_initialize_paths to match installed directory name. If IDE, - use auto_path to search for main.tcl. - * Makefile.in (install-only): If ENABLE_IDE, install from gdbtcl2 - rather than gdbtcl. - - * gdbtk.c (gdbtk_cleanup): New static function. - (gdbtk_init): Add gdbtk_cleanup as a final cleanup. Uncomment - call to ide_initialize_paths. If we can't initialize the event - system, set GDBTK_IDE to 0 in the Tcl interpreter. Create the - ide_window_register and the ide_window commands. Initialize tk, - itcl, and tix after initializing the IDE. - - * configure.in (tixdir): Update for cygwin32 case for Tcl 8.0. - * configure: Rebuild. - -Fri Aug 8 00:13:32 1997 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (breakpoint_notify): Change buffer size from 100 - to 256 to avoid memory corruption with very long pathnames. - -Thu Aug 7 14:08:23 1997 Martin M. Hunt <hunt@cygnus.com> - - * configure.in: Change required Tix version to 4.1.8.0 . - * configure: Rebuilt. - -Fri Aug 1 15:21:44 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c (Tcl_Alloc): Don't provide our own version of this if - _WIN32. - (Tcl_Realloc, Tcl_Free): Likewise. - * configure.in: Check for cygwin32 environment. Define and - substitute WIN32LIBS and WIN32LDAPP. Always set configdir to - unix; setting it to win was for an old Tcl/Tk configuration - scheme. - * aclocal.m4 (CY_AC_LOAD_TKCONFIG): Substitute TK_BUILD_INCLUDES. - * Makefile.in (TK_CFLAGS): Add @TK_BUILD_INCLUDES@. - (WIN32LDAPP, WIN32LIBS): Define. - (CLIBS): Add $(WIN32LIBS). - (gdb): Use $(WIN32LDAPP). - * configure: Rebuild. - -Tue Jul 22 19:45:37 1997 Martin M. Hunt <hunt@cygnus.com> - - * configure.in, aclocal.m4: Another fix to find the - correct Tix library name. - - * configure: Rebuilt. - -Mon Jul 21 22:24:07 1997 Martin M. Hunt <hunt@cygnus.com> - - * aclocal.m4: Search for the correct tix library. - -Thu Jul 10 00:02:41 1997 Martin M. Hunt <hunt@cygnus.com> - - * Makefile.in, configure.in, aclocal.m4: Add Itcl, Tix, and - IDE configuration information. - - * gdbtk.c (breakpoint_notify): Send address, linenumber and - filename when a breakpoint is set. Avoids call to bp_info. - (gdbtk_init): Call Tcl_FindExecutable(). Add code to handle - Itcl, Tix and IDE initialization. - - * configure: Regenerated. - -Fri Jun 13 10:28:09 1997 Fred Fish <fnf@cygnus.com> - - * gdbtk.c (gdbtk_init): Make truth value test explicit. - Remove unused static variable "Gdbtk_Library". - -Sat Jun 7 02:34:19 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) - - * gdbtk.c (gdb_get_breakpoint_info): Add string for new - enumeration del_at_next_stop to bpdisp array. - -Tue Jun 3 15:46:51 1997 Tom Tromey <tromey@cygnus.com> - - * Makefile.in (LIB_RUNTIME_DIR): New variable. - -Wed May 7 19:10:19 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk.c (wrapped_call): New function - make actual call to tk - worker function. - (call_wrapper): Rewrite to use top.c:catch_errors. - - * gdbtk.c (gdb_stop): If No target_stop set quit flag and hope for - best. - -Mon Apr 21 14:00:08 1997 Doug Evans <dje@canuck.cygnus.com> - - * gdbtk.c (gdb_disassemble): Store endian-ness in `di'. - -Wed Apr 16 12:33:06 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * Makefile.in (install-only): Make list of gdbtcl files to install - explicit - was picking up files such as ChangeLog etc. - (install-only): Don't blindly create the directory. - -Tue Apr 1 15:04:21 1997 Jason Molenda (crash@godzilla.cygnus.co.jp) - - * configure.in (gdbtcl): Create soft-link for gdbtcl/ directory - instead of gdbtk.tcl. - -Fri Mar 28 17:04:02 1997 Jason Molenda (crash@godzilla.cygnus.co.jp) - - * Makefile.in (gdbtk.o): look for GDBTK_LIBRARY in $(datadir) by - default, not $(srcdir). - -Wed Mar 19 15:16:17 1997 Martin M. Hunt <hunt@onions.cygnus.com> - - * Makefile.in: Install gdbtcl dir instead of gdbtk.tcl. - - * gdbtk.c: Added some ifdefs for Windows. Changed GDBTK_FILENAME - to GDBTK_LIBRARY, which is now a path to search. - (gdb_path_conv): New function. Convert Cygwin32 pathname to - DOS-style pathname. - - * {aclocal.m4,configure.in}: Changes for Windows builds. - - * configure: Rebuilt. - -Fri Mar 14 10:01:29 1997 Tom Tromey <tromey@cygnus.com> - - * configure: Regenerated. - * configure.in (LIBS): Re-reverse order of TCL_LIBS and TK_LIBS. - -Wed Mar 12 14:29:52 1997 Tom Tromey <tromey@cygnus.com> - - * gdbtk.c (x_event): Use Tcl_DoOneEvent, TCL_DONT_WAIT, - TCL_ALL_EVENTS. - - * configure: Regenerated. - * configure.in (ENABLE_GDBTK): Put TCL_LIBS after TK_LIBS in - LIBS. - -Mon Feb 10 13:50:53 1997 Stu Grossman (grossman@critters.cygnus.com) - - * gdbtk.c (call_wrapper): Clear running_now if an error occurs. - -Wed Dec 11 18:51:35 1996 Mark Alexander <marka@cygnus.com> - - * gdbtk.c (gdb_loc): Correct truncation of PC on 64-bit MIPS. - -Tue Nov 19 09:26:14 1996 Tom Tromey <tromey@cygnus.com> - - * gdbtk.c (gdbtk_readline): Fix memory leak. - -Mon Nov 18 23:43:05 1996 Tom Tromey <tromey@cygnus.com> - - Fixes for Tcl 7.6 / Tk 4.2: - * gdbtk.tcl (apply_filespec): Use tk_getOpenFile. - Remove old fileselect code. - * gdbtk.c (Tcl_Alloc): Rename from Tcl_Malloc. - -Fri Sep 27 10:25:30 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.tcl (create_copyright_window): Increase timeout from - 15 seconds to 30 seconds. - -Wed Sep 4 17:28:40 1996 Stu Grossman (grossman@critters.cygnus.com) - - * configure configure.in: Add host *windows* to list of hosts - that don't support GDBtk. - -Fri Aug 23 00:44:57 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.c (gdbtk_init): Check for a DISPLAY env variable and - gracefully degrade to using command line interface if none is - found. - -Fri Aug 9 12:32:53 1996 Tom Tromey <tromey@creche.cygnus.com> - - * Makefile.in (LIB_INSTALL_DIR): New macro. - (TCL): Include @TCL_LD_SEARCH_FLAGS@. - -Thu Aug 1 20:35:01 1996 Tom Tromey <tromey@creche.cygnus.com> - - * gdbtk.c (mainWindow): Deleted. - (cleanup_init): Don't destroy main window. - (gdbtk_init): Main window now created by Tk_Init. - - * configure.in: Most X checks now handled automatically by Tk. - Use new macros to find Tcl/Tk. - * aclocal.m4: New version for new Tcl/Tk; from Don Libes. - * config.in, configure: Regenerated. - - * Makefile.in (TCL, TCL_CFLAGS, TK, TK_CFLAGS, X11_CFLAGS, - X11_LDFLAGS, X11_LIBS): Changed for new Tcl and Tk. - -Thu Aug 1 16:12:05 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) - - * Makefile.in (gdbtk.tcl): put in $(datadir), not $(libdir). - -Fri Jul 26 14:07:37 1996 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c (gdb_disassemble): Initialize di.flavour. - -Thu Jul 25 19:41:31 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.c (null_routine): Ditto. - (gdbtk_flush): Ditto. - (gdbtk_fputs): Ditto. - (gdbtk_query): Ditto. - (gdbtk_readline): Ditto. - (gdbtk_readline_end): Ditto. - (gdb_get_breakpoint_list): Ditto. - (gdb_get_breakpoint_info): Ditto. - (breakpoint_notify): Ditto. - (gdbtk_create_breakpoint): Ditto. - (gdbtk_delete_breakpoint): Ditto. - (gdbtk_modify_breakpoint): Ditto. - (gdb_loc): Ditto. - (gdb_eval): Ditto. - (gdb_sourcelines): Ditto. - (map_arg_registers): Ditto. - (get_register_name): Ditto. - (gdb_regnames): Ditto. - (get_register): Ditto. - (gdb_fetch_registers): Ditto. - (register_changed_p): Ditto. - (gdb_changed_register_list): Ditto. - (gdb_cmd): Ditto. - (call_wrapper): Ditto. - (gdb_listfiles): Ditto. - (gdb_stop): Ditto. - (gdbtk_dis_asm_read_memory): Ditto. - (compare_lines): Ditto. - (gdb_disassemble): Ditto. - (tk_command): Ditto. - (cleanup_init): Ditto. - (gdbtk_interactive): Ditto. - (x_event): Ditto. - (gdbtk_wait): Ditto. - (gdbtk_call_command): Ditto. - (tk_command_loop): Ditto. - (gdbtk_init): Ditto. - - * gdbtk.c (register_changed_p): Remove unused local variable "buf". - -Sat Jul 20 17:46:40 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.tcl (files_command): Reorder the binding tags for - the listbox widget to avoid referencing the listbox after - the containing widget has been destroyed by the action of - a previous binding. - -Sat Jul 20 10:09:28 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.tcl (delete_expr): Unset corresponding element of - expr_update_list when destroying an expression. - (create_expr_window): Initialize expr_num, delete_expr_num, - and expr_update_list here when each new expression window - is created, rather than once at startup. - -Mon Jul 15 16:44:05 1996 Stu Grossman (grossman@critters.cygnus.com) - - * gdbtk.c (gdb_disassemble): Setup di.mach from - tm_print_insn_info.mach, and set endian from TARGET_BYTE_ORDER. - -Fri Jun 21 11:04:47 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.tcl (create_register_windows): Include missing '$'s. - Add global declarations for various reg_format_* variables. - * gdbtk.tcl (populate_register_window): Make initial window one - line taller to account for new column header line. - -Fri Jun 21 09:46:47 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.c (get_register): Support for printing raw formats. - * gdbtk.tcl: Add hint for using debug_interface. - (center_window, add_breakpoint_frame, delete_breakpoint_frame): - Enclose arg in braces for consistency. - (create_registers_window, populate_reg_window, update_registers): - Major rewrite to support displaying multiple formats in the register - window. - (init_reg_info): New function. - (recompute_reg_display_list): Reset reg_display_list, start - register display lines at line 2. - -Thu Jun 20 08:18:59 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.tcl (gdbtk_tcl_readline_begin): Handle backspace to - avoid backing up over prompt. At every input, make sure insert - point is at least after command start, handle control-u to delete - current input line. - (tclsh): Handle backspace to avoid backing up over prompt. Handle - control-u to delete current input line. - -Wed Jun 19 17:23:38 1996 Geoffrey Noer <noer@cygnus.com> - - * configure.in: disable gdbtk for *cygwin32* hosted compiles - * configure: regenerated with autoconf 2.8 - -Sun May 19 16:49:37 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.c (gdbtk_readline_begin, gdbtk_readline, gdbtk_readline_end): - New functions. - (tk_command_loop): Set instream to NULL to enable Tk user interaction. - (gdbtk_init): Set readline_begin_hook, readline_hook, - and readline_end_hook. - * gdbtk.tcl (gdbtk_tcl_readline_begin, gdbtk_tcl_readline, - gdbtk_tcl_readline_end): New functions. - (tclsh): Pack scroll bar on right side of window, not left. - -Fri May 17 13:54:34 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.tcl (create_command_window): Change a misspelled "get" - to the intended "cget". - (delete_line): Fix so it deletes the current line at the - insertion cursor. - -Thu May 16 19:20:29 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.tcl (gdb_prompt): Set this early on. - (create_command_window): Use gdb_prompt rather than "(gdb) ". - (gdbtk_tcl_preloop): Proc executed just prior to Tk main loop. - (tclsh): If an evaluation window already exists, just bring it - to the front instead of trying to create another. - * gdbtk.c (tk_command_loop): New function. - (gdbtk_init): Call tk_command_loop rather than Tk_MainLoop. - -Thu May 16 16:16:35 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.tcl (evaluate_tcl_command, tclsh): New functions that - implement a tcl evaluation window for gdbtk maintainers to use. - -Thu May 16 11:42:58 1996 Tom Tromey <tromey@creche.cygnus.com> - - * gdbtk.tcl (files_command): Correctly insert list of files into - listbox widget. - - * gdbtk.tcl (files_command): listbox command no longer accepts - -geometry. - -Wed May 15 16:04:09 1996 Stan Shebs <shebs@andros.cygnus.com> - - * gdbtk.tcl (create_command_window): If command window's buffer - is disabled, don't execute any of the key bindings. - -Mon May 13 13:43:25 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.c (tk_command): Catch case where no argument is given - since this will cause the tcl interpreter to dump core. - -Wed May 8 20:33:24 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.c: Fix a couple of misspellings. - -Thu May 2 19:17:49 1996 Stan Shebs <shebs@andros.cygnus.com> - - * gdbtk.tcl (debug_interface): New global, use to aid debugging. - (insert_breakpoint_tag, delete_breakpoint_tag): Fix range. - (file_popup_menu): Delete, never used. - (listing_window_popup): Rename from listing_window_button_1, - remove breakpoint toggling code. - (toggle_breakpoint): New procedure. - (create_file_win): Bind popup menu to button 2, toggle breakpoints - with button 1 in breakpoint area, add display of tagged areas if - debugging on. - -Fri Apr 5 13:44:40 1996 Stan Shebs <shebs@andros.cygnus.com> - - * gdbtk.c (running_now): New global variable. - (gdb_cmd): Test it before executing any command. - (gdbtk_call_command): Set it when inferior is running. - * gdbtk.tcl (gdbtk_tcl_busy, gdbtk_tcl_idle): Enable and - disable interaction with command window's text appropriately. - -Fri Apr 5 13:25:42 1996 Michael Meissner <meissner@tiktok.cygnus.com> - - * gdbtk.c (SIOCSPGRP, linux): If on Linux, undef SIOCSPGRP, since - some versions of the kernel don't support it. - -Tue Feb 6 16:31:25 1996 Tom Tromey <tromey@creche.cygnus.com> - - * gdbtk.tcl (create_file_win): Eliminate text widget B1 binding so - double-clicking will work again. - (create_asm_win): Put "break" at end of all B1 bindings. - (create_file_win): Lower "sel" tag, don't raise it. - (ensure_line_visible): New proc. - (update_listing, update_assembly): Use it. - (create_copyright_window): Destroy window on Leave event. - (create_command_window): Put "break" at end of all B2 bindings. - -Wed Jan 24 15:28:41 1996 Tom Tromey <tromey@creche.cygnus.com> - - * gdbtk.tcl, gdbtk.c: Updated copyrights. - - * configure.in: Look for -ldl or -ldld when using Tcl 7.5 or - greater. - * configure: Rebuilt. - -Tue Jan 23 09:00:48 1996 Doug Evans <dje@charmed.cygnus.com> - - * gdbtk.c (gdb_disassemble): Pass fprintf_unfiltered to - INIT_DISASSEMBLE_INFO. - -Mon Jan 15 09:58:41 1996 Tom Tromey <tromey@creche.cygnus.com> - - * gdbtk.tcl (create_expr_window): Many changes to update GUI. - (add_expr): Changes from create_expr_window. - (create_command_window): Set focus. - (delete_expr): Rewrote. - (expr_update_button): New proc. - (add_expr): Put bindings on FocusIn, FocusOut. - Don't allow .file_popup to be torn off. - -Fri Jan 12 09:36:17 1996 Tom Tromey <tromey@creche.cygnus.com> - - * gdbtk.tcl (gdbtk_tcl_query): Swap Yes and No buttons. - (update_listing): Use lassign. Use "see" to scroll. Don't need - screen_top, screen_bot, screen_height. - (update_assembly): Use "see" to scroll. - (textscrollproc): Removed. - (create_file_win): Don't use textscrollproc. - (asmscrollproc): Removed. - (create_asm_window): Don't use asmscrollproc. - (create_asm_win): Ditto. - (screen_height, screen_top, screen_bot): Removed. - (run_editor): New proc. - (build_framework): Use it. - (create_file_win, create_source_window): Don't use textscrollproc. - (create_breakpoints_window): Set -xscrollcommand on canvas. - (not_implemented_yet): Default button is 0. - (delete_char): Don't use tk_textBackspace. - (create_command_window): Allow Tk bindings to fire after deleting - character. - (create_command_window): Make Delete delete left, not right. - -Thu Jan 11 10:08:14 1996 Tom Tromey <tromey@creche.cygnus.com> - - * gdbtk.tcl (FSBox): Don't use tk_listboxSingleSelect. - - Changes in sync with expect: - * configure.in (ENABLE_GDBTK): Use CY_AC_PATH_TCL and - CY_AC_PATH_TK. - * aclocal.m4: Replaced with version from expect. - * configure: Regenerated. - -Wed Jan 10 09:07:22 1996 Tom Tromey <tromey@creche.cygnus.com> - - * gdbtk.tcl (gdbtk_tcl_fputs, gdbtk_tcl_fputs_error, - gdbtk_tcl_flush): Use "see", not "yview". - (gdbtk_tcl_query): Use questhead bitmap. - various: Always wrap condition of 'if' in {...}. - (add_breakpoint_frame): Set -value on radiobuttons. - (lassign): New proc. - (add_breakpoint_frame): Use lassign, not series of assignments. - (decr): Made faster. - (interactive_cmd): Use "see", not "yview". - (not_implemented_yet): Use warning bitmap. - (update_expr): Don't allow $expr to be evalled by Tcl. - (create_expr_window): Don't use "focus". - (delete_char, delete_line): Define globally. - (delete_line, delete_char, create_command_window, update_autocmd, - build_framework, create_asm_win, create_file_win): Use "see", not - "yview". - (create_copyright_window, center_window, bind_widget_after_class): - New procs. - (FSBox,create_command_window, create_autocmd_window): Binding - changes for Tk4. - (textscrollproc): Define globally. - (build_framework): tk_menuBar no longer needed. Keys Prior, Next, - Home, End, Up, and Down are all defined by Tk. - (apply_filespec): Use error bitmap in dialog. - (files_command): Don't use tk_listboxSingleSelect. - (files_command): Don't use "uniq" to remove duplicates from a - list. - (update_assembly): Use lassign. - (create_asm_win): Removed redundant bindings. - (listing_window_button_1, file_popup_menu): Use tk_popup. - (ButtonRelease-1 binding): Just remove tag from window; rest - handled by Tk. - - * gdbtk.c (gdbtk_query): Use Tcl_Merge to provide quoting. - (call_wrapper): Use Tcl_Eval, not Tcl_VarEval. - (gdbtk_call_command): Ditto. - -Thu Jan 4 16:04:54 1996 Stu Grossman (grossman@cygnus.com) - - * configure configure.in: Make --enable-gdbtk be the default. - -Thu Dec 28 15:10:49 1995 Stan Shebs <shebs@andros.cygnus.com> - - * README.GDBTK: Polish introductory paragraph. - -Mon Oct 16 11:27:06 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c (gdb_disassemble): Use fprintf_unfiltered instead of - fprintf_filtered. - -Tue Oct 10 15:26:39 1995 Fred Fish <fnf@cygnus.com> - - * README.GDBTK: Updated for version 4.15. - -Sat Aug 19 17:20:22 1995 Michael Tiemann <tiemann@axon.cygnus.com> - - * gdbtk.tcl: ENABLE comes back as "1" or "0", not "enable" or - "disable". - Also, wire up the breakpoint window so that it can be demo'd. - -Tue Aug 1 11:44:53 1995 J.T. Conklin <jtc@rtl.cygnus.com> - - * gdbtk.c: Include "gdb_string.h" instead of <string.h>. - -Tue Jun 20 10:19:40 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c: Add functions Tcl_Malloc, Tcl_Realloc, and Tcl_Free. - - * gdbtk.tcl (add_breakpoint_frame): Add more fields. - * (create_file_win create_asm_win build_framework): Create null - bindings for meta keys to keep window from dropping down to - insertion point when meta is pressed by itself. New bindings: - Up/Down - Scroll up/down one line at a time - Next/Prior - Scroll up/down one page at a time - Home/End - Warp to current pc/end of file - * (build_framework): Turn on breakpoint menu. - * (create_command_window): Implement tab completion. Add binding - for ^C to stop target. - -Fri May 19 06:15:40 1995 Jim Kingdon <kingdon@deneb.cygnus.com> - - * gdbtk.c: Conditionalize use of stdarg rather than varargs on - ANSI_PROTOTYPES not __STDC__; it must match the definition of - PARAMS. - -Thu May 18 15:58:46 1995 J.T. Conklin <jtc@rtl.cygnus.com> - - * gdbtk.c (gdbtk_query): Use stdarg.h macros when compiling with - an ANSI compiler. - -Sat Apr 15 13:52:24 1995 Stan Shebs <shebs@andros.cygnus.com> - - * gdbtk.c (gdb_disassemble): Read from inferior if connected - to a VxWorks target. - -Fri Apr 14 10:18:20 1995 Stu Grossman (grossman@cygnus.com) - - * README.GDBTK: New file. Contains the obvious. - -Tue Apr 11 11:07:12 1995 Michael Meissner <meissner@tiktok.cygnus.com> - - * gdbtk.c (gdbtk_init): If SIOCSPGRP is not available, but - F_SETOWN is, use that. - -Thu Apr 6 17:00:46 1995 Michael Meissner <meissner@tiktok.cygnus.com> - - * Makefile.in (X11_INCLUDES): Define as empty. - (X11_CFLAGS): Define as including $(X11_INCLUDES). - (X11_LIB_SWITCHES): Define as empty. - (X11_LIBS): Define as -lX11. - - * configure.in (enable_gdbtk): If gdbtk, support the --x-includes - and --x-libraries switches, setting the X11_INCLUDES and - X11_LIB_SWITCHES respectively. Instead of using a hardcoded -lX11 - in ENABLE_CLIBS, use the X11_LIB_SWITCHES and X11_LIBS variables. - - * gdbtk.c (gdbtk_init): If SIOCSPGRP is not available, don't use - it. This means that the stop button doesn't work, but is better - than nothing. - -Wed Mar 29 17:09:29 1995 Stu Grossman (grossman@cygnus.com) - - * Makefile.in (gdbtk.o): Use X11_CFLAGS to provide alternate - locations (per-host) for X11 include files. - * config/pa/hppahpux.mh (XM_CLIBS): Add -L/usr/lib/X11R5 to force - the use of R5 libs. - (X11_CFLAGS): Add this to indicate the locs - of the R5 include files. - -Wed Mar 8 16:12:21 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c (gdb_get_breakpoint_info): Return error if breakpoint - type is not bp_breakpoint. - -Tue Feb 14 17:16:41 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c: Ditto. - * gdbtk.c: General cleanups, get rid of unused variables. Redo - handling of stdout/stderr to just return output as the result of - the tcl command that caused the output. Cleanup -Wall stuff. - * (breakpoint_notify): Now returns just action and breakpoint - number. - * (gdb_get_breakpoint_list): New routine. Does the obvious. - * (gdb_get_breakpoint_info): Mostly derived from the old - breakpoint_notify, but returns lots more info. - * (dsprintf_append_element): Helper routine, works like printf, - but appends a tcl element onto the specified DString. Good for - building up lists as return values. - * (gdbtk_enable/disable_breakpoint): Go away. Replaced with - gdbtk_modify_breakpoint. - * (*many routines*): Use new result protocol. - * (call_wrapper): Make sure that recursive calls don't trash results. - * gdbtk.tcl: New windows, autocmd, and breakpoints. - * (gdbtk_tcl_fputs): Don't use $current_output_win redirection - anymore. It's not needed (in fact, this routine may not be needed - anymore). - * (gdbtk_tcl_breakpoint): Change to reflect new breakpoint - notification protocol. - * (gdbtk_tcl_busy gdbtk_tcl_idle): Straighten out buttons, remove - catches. - * (interactive_cmd): Use this wrapper around button invocations - of many commands. This will catch errors and put the results into - the command window. It also updates all the other windows. - * Also, change reliefs of most things to sunken. This actually - looks better. - * (create_file_win): Fix margin binding to allow breakpoints to - work again. - * (create_asm_win): Use return value of gdb_disassemble instead - of implicit I/O to the command window. - * (create_command_window): Use new result protocol to get output - from commands. - -Sun Feb 5 20:32:44 1995 Jim Kingdon (kingdon@lioth.cygnus.com) - - * gdbtk.c (gdb_disassemble): Deference pointer to function before - calling it (pre-ANSI compilers generally require this). - -Fri Feb 3 11:19:20 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c (gdb_disassemble): Get rid of - dis_asm_read_memory_hook. We can now call the disassemblers - directly and have no need for this hook anymore. - -Mon Jan 30 17:34:24 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.tcl (create_file_win): Disable old popup menu for source - window. - -Wed Jan 25 18:23:46 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c (gdbtk_init): Prevent segfault when gdbtk.tcl can't be - found. - * gdbtk.tcl: Initialize expr_update_list() to prevent errors when - popping up expression window for the first time. - -Tue Jan 24 12:10:28 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.tcl (create_registers_window): Work around a radiobutton - widget bug to make Options|Natural button work. - - * gdbtk.c (gdb_disassemble): Fix problem with source+assembly and - g++ caused by out-of-order pc's. - * gdbtk.tcl (files_command): Remove duplicate file names. Also, - add scrollbar. - -Mon Jan 23 17:21:09 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.tcl: Take .gdbtkinit if it exists. Makes gdbtk match the - doc! - -Thu Jan 12 15:02:40 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c, gdbtk.tcl: Update/add copyright. - * gdbtk.tcl (build_framework): Several fixes for filespec widget, - including dismiss button, and better error handling. - * (create_command_win): Bind button 2 to retrieve selection. - -Wed Jan 11 17:06:55 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.tcl: Add button to control mixed source disassembly. - Use text widgets in expr window. The give me more control over - layout. - Add auto-updating of exprs in expression window. - Handle expressions out of scope a bit better. - Make selected window pop up to the top when invoked via the - menubar. - Make copyright message have raised relief. - - * gdbtk.c (gdbtk_init): Improve handling for errors in gdbtk.tcl - during startup. - -Thu Jan 5 17:38:29 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c (finish_saving_output): Don't do anything if not saving - output. - * (breakpoint_notify): Don't send null filename to tcl. - * (gdb_eval): New tcl command to eval an expression. - * (gdb_disassemble): New tcl command to do disassembly. This - allows tcl code to choose between exec file and target memeory, - and can also do mixed source and assembly. - * (gdbtk_init): Move reading of gdbtk.tcl to the end to make sure - that more of the environment is set up. Also, create link between - gdb and tcl vars disassemble{-_}from{-_}exec. - - * gdbtk.tcl: New expression window support. - * Make assembly window be 80 columns wide. - * Use new disassembly method. Add menu items to select - disassembly from exec file or target. - * Change View menubar item to Options. - - * Get rid of Stack, Breakpoints, Signals, and Variables Windows, - since they don't exist yet. - - * Pop up a copyright window on startup. - -Wed Jan 4 19:49:10 1995 Stan Shebs <shebs@andros.cygnus.com> - - * gdbtk.tcl (build_framework): Add standard commands menu, more - windows to standard windows menu. - (not_implemented_yet): Clarify message. - -Fri Dec 30 15:49:00 1994 Stan Shebs <shebs@andros.cygnus.com> - - * gdbtk.tcl (FSBox): New proc, File Selection Box code from exmh. - (not_implemented_yet): New proc. - (build_framework): Add various file commands to file menu. - -Fri Dec 23 16:18:50 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c (gdbtk_wait gdbtk_init): Portability improvements for - SIGIO handling. - -Mon Dec 19 09:55:47 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.tcl (update_assembly): Force update to make sure that pc - is visible when creating new assembly windows. - -Sun Dec 18 23:31:20 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c (gdbtk_wait gdbtk_init): Use different method of - enabling I/O interrupts for SVR4 (streams). - * (start_saving_output save_output get_saved_output - finish_saving_output flush_holdbuf gdbtk_flush gdbtk_fputs - gdbtk_init): - Totally revamp to use TCLs dynamic string functions. Also, quote - all data passed back to TCL to prevent errors with unmatched - braces, odd characters, etc... This fixes several wierd problems - with outputting strings containing unmatched braces. - * (breakpoint_notify gdb_loc): Use long hex format to output - addresses of breakpoints and PCs. This fixes some Alpha problems. - * (breakpoint_notify): Add stream arg to call to gdbtk_fputs. - * (gdb_listfiles): Also, go through the symtabs when looking for - files. This makes xcoff work (sort of), but probably breaks - something else. - * (gdb_stop): Return TCL_OK instead of nothing. This fixes odd - TCL errors when hitting stop button. - * (tk_command): Don't pass interp->result on to Tcl_{Var}Eval, as - that will trash the result. strdup the result instead and pass - that on. Improve error handling as well. - - * gdbtk.tcl (gdbtk_tcl_flush): Use global def of - current_output_win. Makes flushing actually work! - * (asm_win_name create_asm_win update_assembly): Bunch of fixes - to make assembly windows stop flashing when loading a new file. - * (gdbtk_tcl_busy gdbtk_tcl_idle): Use catch to prevent gdb_cmd - errors from losing control. - * (create_source_window): Add source file selection to View menu. - * (create_command_window (<Key-Return> binding): Quote text fed - into gdb_cmd to prevent eval errors. - -Thu Dec 15 16:40:10 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c: Improve mechanism for capturing output values. - (full_filename): Remove. - (gdb_cmd call_wrapper gdbtk_init): Protect all calls from tcl land - with call_wrapper. This prevents longjmps (usually via error()) - from jumping out of tcl/tk and leaving things in an indeterminate - state. - (gdbtk_fputs): Differentiate stdout from stderr when passing text - into tcl land. - * gdbtk.tcl: New view option to disable line numbers. Put catch - around most uses of gdb_cmd. Add update button to reg config - window. Stop doing immediate updates when selecting registers. - Change register view values into checkbuttons. - -Mon Dec 12 16:59:29 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.tcl (reg_config_menu create_registers_window - recompute_reg_display_list): Use array instead of individual vars - for register display list. - * (recompute_reg_display_list update_registers): Fix bug with not - displaying all registers. - -Mon Dec 12 12:22:21 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c: New tcl commands: gdb_fetch_registers, - gdb_changed_register_list, and gdb_regnames. - * gdbtk.tcl: Use monochrome color model for now. - * (delete_breakpoint_tag create_file_win): Add breakdot support. - * (create_file_win create_asm_win update_listing build_framework - create_source_window create_command_window): Re-org window - creation to give all windows consistent look and feel. - * (update_listing update_asm): Change pc pointer to '->'. - * (registers_command reg_config_menu create_registers_window - populate_reg_window update_registers): Revamp register window. - Allow selection of registers to be displayed. Highlight changed - registers. - -Mon Nov 28 09:17:20 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.tcl (build_framework): Fix bug with setting window titles. - - * gdbtk.tcl (build_framework): Add "Report bug" to help menu. - - * gdbtk.tcl: Re-arrange windows using new, consistent layout. Clean - up lots of code and centralize framework initialization. - -Wed Nov 16 15:28:29 1994 Rob Savoye (rob@cygnus.com) - - * Makefile.in: Fix the test for installing gdbtk. - -Mon Nov 14 08:51:29 1994 Stu Grossman (grossman@cygnus.com) - - * Makefile.in: Install gdbtk.tcl. - * configure.in: Add ENABLE_GDBTK flag. - * gdbtk.c (gdb_sourcelines): Returns list of source lines - containing code. (gdb_regnames): Returns list of register names. - -Thu Nov 3 14:25:24 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c (gdb_stop): Switch to target_stop(). - -Tue Nov 1 16:41:12 1994 Stu Grossman (grossman@cygnus.com) - - * Makefile.in: Use $(objdir)/tcl and $(objdir)/tk if they are - available. - * configure.in (ENABLE_CLIBS): Use $(TCL) and $(TK) instead of - -ltcl and -ltk. - * gdbtk.c: Get rid of lots of unnecessary #includes. - * (gdbtk_init): Use ConnectionNumber macro instead of referencing - Display structure directly. - * gdbtk.tcl: Change exit button to quit button. - -Wed Oct 26 15:41:07 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c: Change sense and name of no_windows variable. Now - called use_windows, and defaults to off (for compatibility). - -Thu Oct 20 17:35:45 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c (gdb_cmd): Force GUI into idle mode when errors occur. - * (gdb_stop): New tcl command to stop the target process. - * (x_event, gdbtk_wait): Allow GUI to interrupt gdb out of target - waits. - * (gdbtk_call_command): Wrapper around command processing to - alert GUI of target state changes. - * (gdbtk_init): Get the fd of X server for doing async - notification of X events (via x_event). Setup new hooks. - * gdbtk.tcl: Add scrollbars to assembly and command windows. - * Change window foreground & background colors. - * Create margin tag for breakpoints in source and assembly windows. - * Add new routines to be invoked when target state changes to/from - idle. - * Add start of expression window. - * Change bindings of mouse button 1 in assembly and source window - to just set or clear breakpoints when in the margin tag. - * Change shape of register window to be more vertical to better - reflect its contents. - * Add stop button. - * Cleanup some code around command window bindings. - -Sat Sep 17 17:05:14 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.tcl: Let ^U delete lines in the command window. - -Fri Sep 16 15:40:34 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c: Replace calls to full_filename with symtab_to_filename. - * gdbtk.tcl: New routine pc_to_line replaces in line code. New - routine decr replaces in line code. - * (create_file_win): Use catch to handle open failures more - elegantly. Also, create special window to display file open - failure message. Move opening of file prior to creation of text - widget. - * (create_asm_win): Add PC as argument. We now base disassembly - on PC instead of function name, since function names can be - ambiguous (usually seen with shared libs). Also, use catch to - simplify code where we don't care about failures. - -Wed Sep 14 00:55:26 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.tcl: Add ref counts to breakpoint tags. - * Put quotes around function name in disassemble command to better - handle assembler names containing `.'. - * Make pclist element 0 be filler to avoid off-by-one problem with - line numbers. - * Set names of top-level windows. - * Add register display window. - * Add PC to label of assembly window. - -Tue Sep 13 08:59:04 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c (gdbtk_flush gdbtk_fputs): Buffer up output to make - disassembly more efficient. - * (breakpoint_notify): Include pc in gdbtk_tcl_breakpoint - callback. - * (gdb_loc): Include pc in return value. Also, return function - name if arg was specified. - * (gdb_cmd_stub): Call gdb_flush to drain internal GDB buffers - after command completes. - * (gdbtk_init): Improve error handling. - - * gdbtk.tcl: Add lots of comments. Clean up code. - * (gdbtk_tcl_fputs): Make output window redirectable. - * Add assembly window, and breapoint support. - * Make button 1 in margin toggle breakpoints. - * Use stippling to indicate breakpoint disabling. - -Fri Sep 2 19:11:40 1994 Stu Grossman (grossman@cygnus.com) - - * configure.in: Don't symlink to gdbtk.tcl if it's already there. - -Thu Jul 28 14:37:36 1994 Stu Grossman (grossman@cygnus.com) - - Support for TK GUI. - * Makefile.in: Add rule for gdbtk.o. - * configure.in: Add support for --enable-gdbtk. - * gdbtk.c: New file. Contains support routines for TK interface. - * gdbtk.tcl: New file. Implements GUI policy. - - -Local Variables: -mode: change-log -left-margin: 8 -fill-column: 74 -version-control: never -End: diff --git a/gdb/gdbtk/generic/ChangeLog-1998 b/gdb/gdbtk/generic/ChangeLog-1998 deleted file mode 100644 index ca919a6156c..00000000000 --- a/gdb/gdbtk/generic/ChangeLog-1998 +++ /dev/null @@ -1,837 +0,0 @@ - Mon Dec 21 11:11:02 1998 Keith Seitz <keiths@cygnus.com> - - * gdbtk-cmds.c (get_register): Call get_saved_register instead of - read_relative_register_raw_bytes to fetch registers. - - Thu Dec 17 09:00:56 1998 Keith Seitz <keiths@cygnus.com> - - * gdbtk-cmds.c (gdb_search): Don't mention C++ RTTI and - global constructor/destructor symbols. - - Thu Nov 12 15:20:15 1998 Jim Ingham <jingham@cygnus.com> - * More bug fixes merged in from devo. - - * gdbtk-cmds.c (gdb_cmd): Added an optional second argument to the - gdb_cmd, which is from_tty. This is passed to the gdb command - parser. It is 0 by default, and the console window passes 1. - - * gdbtk-cmds.c: moved disassemble_from_exec from gdbtk.c to gdbtk-cmds.c - with all the other link-var'ed variables - - * gdbtk-hooks.c (gdbtk_trace_find): Only run the hook functions if - we are called from_tty. - - * gdbtk-hooks.c (gdbtk_trace_start_stop): Set the trace buttons - from a trace_start_command callback rather than doing it as a - special case in gdb_cmd. - - * tracepoint.c (tstart_command, tstop_command): Add call to - trace_start_stop_hook here. - - 1998-11-04 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk-cmds.c (gdb_set_bp_addr): For callback, send full - pathname instead of just basename. - - 1998-11-03 Keith Seitz <keiths@cygnus.com> - * v850ice.c (do_gdb): New function. - (ice_stepi): Use do_gdb to step properly. - (ice_nexti): Use do_gdb to step properly. - (view_source): Correct call to src window's location for new version. - - Tue Aug 25 18:13:30 1998 Jim Ingham <jingham@cygnus.com> - - * gdbtk.c (gdbtk_init): I hadn't excised ALL the old startup code, - so it was not working correctly. Now it does. - - Fri Aug 21 14:37:40 1998 Jim Ingham <jingham@cygnus.com> - - * gdbtk.c (gdbtk_init): Changed the startup code to use - tcl_findLibrary - - - - -on Dec 28 17:44:36 1998 David Taylor <taylor@texas.cygnus.com> - - - The following changes were made by Jim Blandy <jimb@cygnus.com>, - Edith Epstein <eepstein@cygnus.com>, Elena Zannoni - <ezannoni@cygnus.com> Stan Shebs <shebs@cygnus.com>, and David - Taylor <taylor@cygnus.com>, as part of the project to merge in - changes originally made by HP; HP did not create ChangeLog - entries. - - * gdbtk.c (gdbtk_init): change stderr to gdb_stderr. - - * gdbtk-cmds.c - (get_pc_register): Use paddr_nz, not sprintf's %llx and - a cast to `long long'. Those aren't portable. - (gdb_eval): add embedded_offset param to val_print call - (get_register): add embedded_offset param to val_print call - - * gdbtk-hooks.c - (tk_command_loop): change instream to a FILE. - (gdbtk_flush): change both the declaration and definition to - use GDB_FILE rather than FILE. - -Mon Dec 21 11:11:02 1998 Keith Seitz <keiths@cygnus.com> - - * gdbtk-cmds.c (get_register): Call get_saved_register instead of - read_relative_register_raw_bytes to fetch registers. - -Thu Dec 17 09:00:56 1998 Keith Seitz <keiths@cygnus.com> - - * gdbtk-cmds.c (gdb_search): Don't mention C++ RTTI and - global constructor/destructor symbols. - -Tue Dec 15 10:09:31 1998 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk-cmds.c (gdb_disassemble): Fix typo. - -Sun Dec 13 09:52:51 1998 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk-cmds.c: Update TARGET_PRINT_INSN_INFO, TARGET_PRINT_INSN. - -Fri Dec 11 09:52:04 1998 Andrew Cagney <cagney@chook> - - * gdbtk-cmds.c: Replace reg_name with REGISTER_NAME. - -Mon Dec 14 13:20:50 1998 Jim Ingham <jingham@cygnus.com> - - * Makefile.in, configure.in configure - add support for LIBGUI - outside the IDE context. - -Thu Nov 19 13:14:57 1998 Geoffrey Noer <noer@cygnus.com> - - * gdbtk-cmds.c: Can't start using new API names yet. Switch back - to calling cygwin32_ funcs until some time has passed... - * gdbtk.c: Ditto. Also, include sys/cygwin.h for Cygwin, instead - of providing own proto. - -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. - - * gdbtk.c: lose "32" from cygwin_ func calls. ifndef for - checking DISPLAY should be for _WIN32, not WINNT. - * gdbtk.h: pick GDBTK_PATH_SEP based on _WIN32, not WINNT. - * gdbtk-cmds.c (gdb_path_conv): lose "32" from cygwin_ func call, - change ifdef to __CYGWIN32__ instead of WINNT. - * {gdbtk.c, gdbtk-hooks.c}: __CYGWIN32__ refs drop the "32". - -Thu Nov 12 15:20:15 1998 Jim Ingham <jingham@cygnus.com> - - * gdbtk-cmds.c (gdb_cmd): Added an optional second argument to the - gdb_cmd, which is from_tty. This is passed to the gdb command - parser. It is 0 by default, and the console window passes 1. - - * gdbtk-cmds.c: moved disassemble_from_exec from gdbtk.c to gdbtk-cmds.c - with all the other link-var'ed variables - - * gdbtk-hooks.c (gdbtk_trace_find): Only run the hook functions if - we are called from_tty. - - * gdbtk-hooks.c (gdbtk_trace_start_stop): Set the trace buttons - from a trace_start_command callback rather than doing it as a - special case in gdb_cmd. - - * tracepoint.c (tstart_command, tstop_command): Add call to - trace_start_stop_hook here. - -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. - -1998-11-03 Keith Seitz <keiths@cygnus.com> - - * v850ice.c (do_gdb): New function. - (ice_stepi): Use do_gdb to step properly. - (ice_nexti): Use do_gdb to step properly. - (view_source): Correct call to src window's location for new version. - -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 16:19:02 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk-cmds.c (gdb_set_bp_addr): For callback, send full - pathname instead of just basename. - -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-10-13 Jason Molenda (jsm@bugshack.cygnus.com) - - * gdbtk.c, gdbtk-cmds.c: Cast parameters passed to make_cleanup to - use the new make_cleanup_func typedef. - -1998-10-08 Keith Seitz <keiths@cygnus.com> - - * gdbtk-hooks.c (gdbtk_add_hooks): Install a hook for - (new) file_changed_hook. - (gdbtk_exec_file_changed): Rename to gdbtk_exec_file_display - to mimic hook's name. - (gdbtk_file_changed): New hook function. - -Tue Oct 6 22:57:13 1998 Andrew Cagney <cagney@b1.cygnus.com> - - * configure.in (links): Link gdbtcl2 directory instead of gdbtcl. - -Mon Oct 5 00:34:00 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk-cmds.c (gdb_set_bp_addr): New command. Sets a - breakpoint at an address. Use this instead of gdb_cmd "break" - because the syntax of the break command is broken and doesn't - allow you to create a thread-specific BP at an address. Also - this is faster. - -Sun Oct 4 22:35:47 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk-cmds.c (gdb_set_bp): Add an optional thread number. - (gdb_find_bp_at_line): New function. Returns a list of bpnums - at the specified line number. - (gdb_find_bp_at_addr): New function. Returns a list of bpnums - at an address.. - -1998-10-02 Keith Seitz <keiths@cygnus.com> - - * gdbtk-hooks.c (gdbtk_exec_file_changed): New function which handles - exec_file changes. - (gdbtk_add_hooks): Define exec_file_display_hook (to gdbtk_exec_file_changed) - - * gdbtk-cmds.c (gdb_stop): target_stop is ALWAYS defined, so - compare against something a little more meaningful (target_ignore). - -1998-09-24 Keith Seitz <keiths@cygnus.com> - - * gdbtk.c (gdbtk_wait): Don't run the timer for ice targets. - - * v850ice.c (WM_ADDR_TO_SYM): New message. - (v850ice_wndproc): Add handler for WM_SOURCE. - (v850ice_wait): Call the ui_loop_hook occasionally. - (ice_cont): Acknowledge message before doing anything. - (ice_stepi): Ack message and let gdbtk do stepping. - (ice_nexti): Ack message and let gdbtk do stepping. - (view_source): New function ICE calls to display source code. - -1998-09-18 Keith Seitz <keiths@cygnus.com> - - * gdbtk-cmds.c (get_frame_name): Demangle function names, too. - -Thu Sep 10 22:10:29 1998 Jim Ingham <jingham@cygnus.com> - - *gdbtk-cmds.c (gdb_disassemble): Make sure the symtab's linetable is not - null before trying to use it... - -1998-09-02 Keith Seitz <keiths@cygnus.com> - - * gdbtk-cmds.c (gdb_cmd): Do not run the timer when downloading -- - the ui_progress_hook that has been installed will actually - update the gui for us. - -Mon Aug 31 15:42:10 1998 Tom Tromey <tromey@cygnus.com> - - * gdbtk-hooks.c (context_hook): Don't define. - -1998-08-31 Keith Seitz <keiths@cygnus.com> - - * gdbtk-cmds.c (gdb_listfuncs): When stripping out "global destructors" - and "global constructors", do not append any elements to the result. - -Sun Aug 30 00:49:18 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk-cmds.c (Gdbtk_Init): Link C variable gdb_context - with tcl variable gdb_context_id. - - * gdbtk-hooks.c (gdbtk_context_change): Implement new hook called - context_hook. Called when threads change. - - * gdbtk.c: Initialize gdb_context. - - * gdbtk.h: Declare gdb_context. - - * infrun (wait_for_inferior): Call context_hook. - - * thread.c (thread_command): Call context_hook. - - * defs.h: Declare context_hook. - -Fri Aug 28 12:14:49 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk-cmds.c (gdb_loadfile): Open the file after doing - the symtab lookup and calling symtab_to_filename(). This - makes GDBtk work with the GDB "dir" command. - -1998-08-18 Keith Seitz <keiths@cygnus.com> - - * gdbtk-hooks.c (gdbtk_add_hooks): Set selected_frame_level_changed_hook. - (gdbtk_selected_frame_changed): New function. - - * gdbtk-cmds.c (Gdbtk_Init): Add command gdb_stack into interpreter. - Link gdb's global selected_frame_level with interpreter global - gdb_selected_frame_level. - (gdb_stack): New function to faciltate speedier backtraces from - gdbtk. - (get_frame_name): New helper function for gdb_stack. - -Tue Aug 18 15:42:40 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk-cmds.c (gdb_listfuncs): Strip out global constructors - and destructors from the function list. - -Thu Aug 13 15:09:59 1998 Drew Moseley <dmoseley@cygnus.com> - - * gdbtk.c (gdbtk_cleanup): added a scope-level around the contents - of the #ifdef so that the variable declarations in there would not - be illegal in a C compilation. - -Mon Jul 27 13:07:16 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdbtk_call_command): Removed because it is now - in gdbtk-hooks.c - (null_routine): Removed. - - * gdbtk-hooks.c (tracepoint_notify): Fix sprintf to - match number of arguments. - - * gdbtk-cmds.c (gdb_loc): When calling gdb_loc with an - argument, call find_pc_line() to get a complete - symtab_and_line struct. - -Fri Jul 24 14:25:43 1998 Keith Seitz <keiths@cygnus.com> - - * gdbtk-cmds.c (gdb_search): Add missing NULL to switches. - Add missing flags to result_ptr. - Pass along any errors caused by getting the list of files from - tcl. - Allocate correct amount of memory for the file list. - Don't do any unecessary cleanups. - -Fri Jul 24 01:08:37 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk-cmds.c (gdb_loadfile): When there are no - linenumbers, use only one tab. - -Sat Jul 18 12:28:39 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdbtk_cleanup): Add call to tcl function - gdbtk_cleanup. We need this so the GUI gets to clean - up no matter how GDB exits. - -Wed Jul 1 13:10:58 1998 Jim Ingham <jingham@cygnus.com> - - * Moved gdbtk_hooks.c & gdbtk_cmds.c to gdbtk-hooks.c & - gdbtk-cmds.c to comply with the gdb conventions. Changed the - configure & makefile to reflect the change... - -Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> - - * gdbtk.c: removed all the commands and hooks from this file so - now it contains only the startup code. - * gdbtk.c (gdbtk_init): Fixed a bug in the startup code on Windows - that caused gdbtk not to find the share directory unless - GDBTK_LIBRARY was set. - * gdbtk_cmds.c: New file - this contains all the Tcl commands that - gdb defines. All the old commands were moved here, the - string-based commands were converted to object commands, and the - object-based commands were all converted to uniformly use the - call_wrapper. A new function, Gdbtk_Init was added to centralize - initializing the gdb package. - * gdbtk_hooks.c: New file - All the hooks were moved here, and a new - function, gdbtk_add_hooks was added to centralize adding all these - hook functions. gdbtk_fputs was also modified to handle the new - result_ptr structure. See the comments in gdbtk.h for more - details. - * gdbtk.h: New file - this contains all the defines and globals - shared by gdbtk.c, gdbtk_cmds.c & gdbtk_hooks.c - * Makefile.in, configure.in & configure: mutatis mutandi for the - new files. - - -Mon Jun 29 11:49:17 1998 Keith Seitz <keiths@cygnus.com> - - * main.c (main): Don't include gdbtk test code if GDBTK is - not defined by configure. - - * configure.in: When enabling gdbtk, add "-DGDBTK" to ENABLE_CFLAGS. - - * configure: Regenerate. - -Fri Jun 26 13:56:07 1998 Keith Seitz <keiths@cygnus.com> - - * gdbtk.c: Change all references to static global "interp" to - "gdbtk_interp" and export this global. - (gdbtk_init): If gdbtk_source_filename is not NULL, source this file - into the interpreter when it goes idle. - Add new command "gdb_search". - (gdb_search): New function which searches the symbol table. - (gdbtk_test): New function called by main when the --tclcommand - option is used. - - * main.c (main): Add a new option "--tclcommand" which is used - by the testsuite to source a file into the interpreter when it - goes idle. - -Sun Jun 21 09:31:12 1998 Ron Unrau (runrau@cygnus.com) - - * gdbtk.c (gdb_set_bp): Use new interface. - -Wed Jun 17 19:12:23 1998 Jeff Holcomb <jeffh@cygnus.com> - - * Makefile.in (install-only): Install tracing help files. - -Mon Jun 15 13:18:21 1998 Jim Ingham <jingham@cygnus.com> - - * gdbtk.c (gdbtk_init): Add elements to the auto_path AS LIST - ELEMENTS. This allows gdbtk to work when installed in a directory - which has a space in the path. D. Moseley pointed out the bug. - - -Tue Jun 9 14:10:46 1998 Keith Seitz <keiths@cygnus.com> - - * gdbtk.c (gdb_get_vars_command): Return static variables and - variables stored in registers. - - * main.c (main): Call pre/post_add_symbol_hook's when loading - executables and symbol files. - -Fri Jun 5 00:16:22 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdbtk_init): Change all references to - GDBTK_IDE to IDE_ENABLED. - -Thu Jun 4 18:31:53 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdbtk_init): Initialize tkTable. - -Thu Jun 4 10:15:03 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> - - * gdbtk.c: merged: - - - Elena Zannoni <ezannoni@kwikemart.cygnus.com> - (call_obj_wrapper): in case of error, copy the - error message from the result to the error_string. - (gdbtk_fputs): add comments. - (gdb_actions_command): call validate_actionline when installing the - tracepoint, to do the syntax checking of the actions for us. - - Elena Zannoni <ezannoni@kwikemart.cygnus.com> - (gdb_get_trace_frame_num): new function to get the - trace frame number from gdb. - (gdbtk_init): added new command gdb_get_trace_frame_num. - - Jim Blandy <jimb@zwingli.cygnus.com> - (struct wrapped_call_objs): Change the `func' member to - be a Tcl_ObjCmdProc, not an Tcl_CmdProc, since it accepts a vector - of objects as arguments. Change the object vector to be const, - since that's what all the users of this structure seem to expect. - (call_obj_wrapper): Cast clientData properly before storing it in - the wrapped_args structure. - -Thu May 28 17:19:14 1998 Keith Seitz <keiths@cygnus.com> - - * gdbtk.c (_initialize_gdbtk): Get rid of the console. Patch from - Chris Faylor (cgf@cygnus.com). - - * configure.in: Link cygwin32 with subsystem console. - - * configure: Regenerated - -Sun May 24 14:00:24 1998 Keith Seitz <keiths@cygnus.com> - - * ser-unix.c (wait_for): Do not reset timeout_remaining for cygwin32 so that - we can use this member to track real timeouts. - (hardwire_readchar): Modify for cygwin32 so that we only ever use a real - system timeout of one second. Track the "real" timeout as a series of these - one second timeouts. - Call ui_loop_hook to keep the gui alive. - - * top.c: Define new hook for cygwin32, "ui_loop_hook". - - * gdbtk.c (gdbtk_init): Add ui_loop_hook for CygWin32 to work around - update problems. - -Thu May 21 13:56:24 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> - - * gdbtk.c: reinserted the changes that were accidentally deleted: - (_initialize_gdbtk): Use correct device names in - cygwin-specific call (cosmetic change). - (gdbtk_ignorable_warning): removed va_list parameter, - which was unused. - (_initialize_gdbtk): add cygwin32 specific code to - allow `gdb -nw' to work when specified specified from a windows - console-mode command line. - -1998-05-19 Jim Blandy <jimb@zwingli.cygnus.com> - - * gdbtk.c (struct wrapped_call_objs): Change the `func' member to - be a Tcl_ObjCmdProc, not an Tcl_CmdProc, since it accepts a vector - of objects as arguments. Change the object vector to be const, - since that's what all the users of this structure seem to expect. - (call_obj_wrapper): Cast clientData properly before storing it in - the wrapped_args structure. - -Wed May 13 11:12:58 1998 James Ingham <jingham@leda.cygnus.com> - - * gdbtk.c: Fixed a goof in the definition of the gdb_get_args & - gdb_get_locals Tcl commands. Moved the previous ChangeLog entry - from ChangeLog to ChangeLog-gdbtk (here)... - -Tue May 12 13:29:20 1998 Jeff Holcomb <jeffh@cygnus.com> - - * Makefile.in (install-only): Add images/icons.txt and - images2/icons.txt to files that need to be installed. - -Tue May 12 12:03:16 1998 James Ingham <jingham@leda.cygnus.com> - - * gdbtk.c: Add an object call wrapper for the new Tcl_Obj based - commands. This way the obj commands will also go through - catch_errors. This is just a bandaid while I rewrite the - string-based commands to use the object format. - -Tue May 5 09:30:25 1998 Christopher Faylor <cgf@cygnus.com> - - * gdbtk.c (_initialize_gdbtk): Use correct device names in - cygwin-specific call (cosmetic change). - -Wed Apr 29 15:53:16 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> - - * gdbtk.c (gdbtk_ignorable_warning): removed va_list parameter, - which was unused. - -Tue Apr 28 19:41:33 1998 Tom Tromey <tromey@cygnus.com> - - * Makefile.in (GDBTKLIBS): New macro. - (INSTALLED_LIBS): Include GDBTKLIBS. - (CLIBS): Likewise. - * configure: Rebuilt. - * configure.in: Put Tcl/Tk libs into GDBTKLIBS, not LIBS. - (GDBTKLIBS): AC_SUBST. - -Thu Apr 23 19:01:05 1998 Keith Seitz <keiths@onions.cygnus.com> - - * Makefile.in (install-only): Install help files. - -Wed Apr 22 21:17:35 1998 Christopher Faylor <cgf@cygnus.com> - - * gdbtk.c (_initialize_gdbtk): add cygwin32 specific code to - allow `gdb -nw' to work when specified specified from a windows - console-mode command line. - -Wed Apr 15 11:23:53 1998 Stan Shebs <shebs@andros.cygnus.com> - - * gdbtcl: Remove directory and contents, this version of - the interface is obsolete. - -Mon Apr 13 16:17:52 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdb_loadfile): Change fstat() call to stat(). - Needed because you can't convert a FILE* to an fd. - -Mon Apr 13 16:28:07 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> - - * gdbtk.c: (perror_with_name_wrapper) new function to call - perror_with_name safely. - (gdb_loadfile) added source vs. executable time stamp check. - (gdbtk_warning) new function to pass a warning message to the gui. - (gdbtk_ignorable_warning) new function to pass a warning - to the gui. Used only for the src. vs. exec check. - (gdbtk_init) added warning_hook - added include <sys/stat.h> - -Mon Apr 13 12:58:26 1998 Keith Seitz <keiths@onions.cygnus.com> - - * gdbtk.c (gdbtk_start_timer): Include on all platforms. Decrease - timer interval a little. - (gdbtk_stop_timer): Include on all platforms. - (gdbtk_wait): No more signals! Use a timer on all platforms to keep the - GUI alive. - (gdbtk_init): Remove FIOASYNC and all x_fd references. Now using timers - on all platforms. - -Fri Apr 10 15:48:10 1998 Jason Molenda (crash@bugshack.cygnus.com) - - * gdbtk.c (gdb_listfiles): Allocate space for 'files' dynamically. - -Thu Apr 9 14:20:59 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdbtk_init): Remove redundant variable "IDE". - -Tue Apr 7 15:13:58 1998 Stan Shebs <shebs@andros.cygnus.com> - - * gdbtk.tcl: Remove, no longer used. - -Tue Apr 7 12:49:45 1998 Keith Seitz <keiths@onions.cygnus.com> - - * gdbtk.c (gdb_cmd): NEVER call the busy, update, and idle hooks. - -Tue Mar 31 15:42:06 1998 Keith Seitz <keiths@onions.cygnus.com> - - * gdbtk.c (gdb_loadfile): Don't use the return result from - sprintf, which returns a char * under SunOS4. - -Tue Mar 31 17:18:43 1998 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: Add $(LIBIDETCL) as well as $(LIBIDE) if - --enable-ide. - * Makefile.in (IDE_CFLAGS_X): Add -I for libidetcl/src. - (LIBIDETCL): Define. - * configure: Rebuild. - -Sun Mar 29 21:19:46 1998 Keith Seitz <keiths@onions.cygnus.com> - - * gdbtk.c (gdb_get_tracepoint_info): Change formatting of address. - (tracepoint_exists): Remove code which confuses assembly traces. - -Sat Mar 28 12:13:23 1998 Keith Seitz <keiths@onions.cygnus.com> - - * gdbtk.c (gdb_cmd): If argc > 2, assume that the busy and idle hooks - should not be called. - -Thu Mar 26 22:29:28 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> - - * gdbtk.c: (gdb_trace_status) new function. - (gdbtk_init) added command "gdb_is_tracing". - (tracepoint_notify) added passcount information. - -Thu Mar 26 12:00:35 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdbtk_fputs): Insert fencepost. - (gdb_loc): Correct pc calculation. - (gdb_immediate_command): Return if a load is in progress. - (gdb_cmd): Return if a load is in progress. - (target_stop_wrapper): New function. - (gdb_stop): Call target_stop_wrapper. - (x_event): Add fencepost and optimize load cancel check. - (gdbtk_start_timer): Set up structs only once. - (gdbtk_stop_timer): Just use preset structs to set timer parameters. - (gdb_loadfile): If file cannot be loaded, return error message. - (gdb_loadfile): Add space before tab so that lines without - a '-' can later be changed to have one. - -Wed Mar 25 14:08:51 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> - - * gdbtk.c (gdbtk_pre_add_symbol): Use Tcl_merge to form Tcl commands. - -Mon Mar 23 13:41:39 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> - - * gdbtk.c (gdb_get_mem): Rewrite to fetch entire contents - of the memory window at once. - -Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> - - Merged changes from Foundry: list follows by author: - - - Tom Tromey <tromey@cygnus.com> - - * Makefile.in (gdbres.o): New target. - (WINDRES): New define. - * configure: Rebuilt. - * configure.in (WINDRES): Define. - (CONFIG_OBS): Include gdbres.o on Windows. - * gdbtool.ico: New file. - * gdb.rc: New file. - * gdbtk.c (gdbtk_init): Call ide_create_messagebox_command. - (gdbtk_cleanup): Call ide_interface_deregister_all. - (gdbtk_init): Pass event handle to cleanup. - (TclDebug): Use Tcl_Merge to construct command. - (gdbtk_init): Call ide_create_cygwin_path_command. - - - Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdb_set_bp): Set addr_string for bp. - (gdb_get_breakpoint_info): Demangle function - names in breakpoint info. - Include "demangle.h". - (gdb_loc, gdb_listfuncs): Demangle C++ - function names. - (gdb_set_bp): Properly quote filename to fix - problems with spaces. Send pc back as a hex string. - (gdb_listfuncs): Remove debugging line. - Turn off some debugging lines. - (breakpoint_notify): Return correct line number. - (gdb_get_breakpoint_info): Return correct line number. - (gdb_set_bp): New function to provide a better way to - set breakpoints. - (gdbtk_readline, gdbtk_readline_begin): Memory - allocated by tcl needs to be freed by Tcl_Free(). - (find_file_in_dir): Deleted. - (gdb_find_file_command): Call full_lookup_symtab(). - (gdb_listfuncs): Call full_lookup_symtab(). - (full_lookup_symtab): New function. Like lookup_symtab - except handles multiple files with the same basename, - full pathnames, and always sets symtab->fullname. - (gdb_loadfile): Call full_lookup_symtab(). Clear - realloc'd memory. - (gdb_loadfile): Don't tag lines without source. - Tag source lines with source_tag. - (gdb_find_file_command, find_file_in_dir): - Rewrite. Now searches symtabs and psymtabs for a match - on the partial or full filename. Returns the full pathname. - (gdb_loadfile): Realloc additional memory - if someone loads in a file with more than 160,000 - lines. I don't know if this really works because - I don't have enough memory to test it. - (gdb_sourcelines): Deleted. - (gdb_loadfile): New function. Takes a text widget - and loads it with the contents of a file. Marks - and tags source lines. - (pc_changed): New function. - (get_pc_register): Returns the value of - the PC to GDB. - (gdb_loc): If looking on the stack, return - real pc along with calling source line. - (gdb_loc): Return "" instead of "N/A" if - filename is not found. - (gdb_get_breakpoint_info): Same. - (get_register): For Natural mode, set format to 0. - Minor bugfixes from keiths. - (TclDebug): New function for debugging use. - (gdb_loc): Return correct PC for frames - that are not the innermost frame. - (gdb_listfiles): Rewritten to use object - API. Now takes an optional dirname which will cause - only files in that directory or its subdirectories - to be returned. Now returns basenames instead of - full pathnames. - (gdb_cmd): Set/reset load_in_progress flag. - (call_wrapper): Don't pop up dialog for errors in - downloads; just abort download. - (gdbtk_load_hash): Set return value correctly. - - - Keith Seitz <keiths@onions.cygnus.com> - - * gdbtk.c (gdbtk_init): Define the ui_loop_hook so that it can be - called by routines which might block, allowing us to update the GUI. - (gdbtk_wait): Move timer calls to annotation hooks. - (gdbtk_init): Define the annotation hooks. - (gdbtk_annotate_starting): New function for cygwin32 hosts. - (gdbtk_annotate_stopped): New function for cygwin32 hosts. - (gdbtk_annotate_exited): New function for cygwin32 hosts. - (gdbtk_annotate_signalled): New function. for cygwin32 hosts. - (gdbtk_init): Use gdbtk_print_frame_info hook. - (gdbtk_print_frame_info): New function which sets current_source_symtab - based on the given symtab and line info. - (gdb_immediate_command): New function which does - not buffer any - output. (Contrast to gdb_cmd.) - (gdb_prompt_command): New function to return gdb's prompt. - (find_file_in_dir): New functon which searches source paths - for a given filename. - (gdb_find_file): New function which returns path to given file -- uses - find_file_in_dir. - (gdbtk_init): Install "gdb_immediate", "gdb_find_file", and - "gdb_prompt" - commands into interpreter. - - - Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c (gdbtk_timer_going): If __CYGWIN32__, new static - variable. - (gdb_cmd): If __CYGWIN32__, if executing the load command, call - gdbtk_start_timer and gdbtk_stop_timer. - (call_wrapper): If __CYGWIN32__, if the timer is going, turn it - off. Clear load_in_progress. - (x_event): If load_in_progress, quit if download_cancel_ok. - (gdbtk_start_timer): Set gdbtk_timer_going. - (gdbtk_stop_timer): Clear gdbtk_timer_going. - (gdbtk_wait): Call x_event. - (gdbtk_init): Call ide_create_win_grab_command if - __CYGIN32__. - (gdb_clear_file): Clear stop_pc. - -Wed Mar 4 16:50:18 1998 Jason Molenda (crash@bugshack.cygnus.com) - - * gdbtk.c (gdb_listfiles): Fix thinko in last change. - -Wed Mar 4 15:34:49 1998 Jason Molenda (crash@bugshack.cygnus.com) - - * gdbtk.c (gdb_listfiles): Allocate space for 'files' dynamically. - -Tue Feb 10 17:50:37 1998 Keith Seitz <keiths@onions.cygnus.com> - - * gdbtk.c (gdbtk_modify_tracepoint): Define new tracepoint modification hook. - (gdbtk_print_frame_info): Define this hook so that current_source_symtab - is set properly. - (gdb_actions_command): Use free_actions () from tracepoint.c/h. - -Mon Jan 26 11:37:55 1998 Keith Seitz <keiths@onions.cygnus.com> - - * gdbtk.c (gdb_actions_command): Make note of next action - before freeing all references to it. - -Sat Jan 24 23:52:08 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c: Merge from Foundry branch. - (TclDebug): New debugging function. - (gdb_loc): For frames, find address of calling function - instead of whatever is on the stack (usually the next - instruction). - (gdb_listfiles): Takes an optional pathname argument and - returns an alphabetized list of basenames of files in the - path. - -Wed Jan 22 10:37:02 1998 Keith Seitz <keiths@onions.cygnus.com> - - * symfile.c: Define two new hooks for symbol reading: - "pre_add_symbol_hook" and "post_add_symbol_hook". These hooks - are called before we begin reading symbols, and after we finish. - (generic_load): Use new symbol reading hooks and get rid of - compiler warning. - - * gdbtk.c (gdbtk_init): Add hooks for pre- and post-symbol reading. - (gdbtk_pre_add_symbol): New function: the pre-add-symbol hook. - (gdbtk_post_add_symbol): New function: the post-add-symbol hook. - (find_file_in_dir): New function. Moved the guts of gdb_find_file_command - into here to allow its use by others. - (gdb_loc): Use find_file_in_dir to return the real path to the file - (or "N/A" if we can't find it). - - * configure.in (TIX_LIB_EXT): Define new variable for those special cases - when TCL_SHLIB_SUFFIX is not enough to specify the dependency. - - * configure: Regenerate. - -Fri Jan 23 07:47:06 1998 Fred Fish <fnf@cygnus.com> - - * Makefile.in (uninstall): Remove installed gdbtcl dir, if one - was installed. - -Thu Jan 15 12:42:28 1998 Keith Seitz <keiths@onions.cygnus.com> - - * gdbtk.c (gdb_immediate_command): New function which does not buffer any - output. (Contrast to gdb_cmd.) - (gdbtk_init): Install "gdb_immediate" command into interpreter. - -Wed Jan 14 16:38:44 1998 Keith Seitz <keiths@pizza.cygnus.com> - - * configure.in (--enable-gdbtk): If tcl was built with --enable-shared, - use TCL_SHLIB_SUFFIX to specify the suffix of the library file so that - we don't expect to see "libfoo.a" instead of "libfoo.{so,sl, etc}". - - * configure: Regenerate. - -Wed Dec 31 16:50:26 1998 Keith Seitz (keiths@onions.cygnus.com) - - * gdbtk.c (gdb_actions_command): extract and save step count - from "while-stepping" command - diff --git a/gdb/gdbtk/generic/ChangeLog-1999 b/gdb/gdbtk/generic/ChangeLog-1999 deleted file mode 100644 index b5788594070..00000000000 --- a/gdb/gdbtk/generic/ChangeLog-1999 +++ /dev/null @@ -1,2624 +0,0 @@ -1999-09-23 Fernando Nasser <fnasser@totem.to.cygnus.com> - - * gdbtk-varobj.c (variable_value): Fix small memory leak. - -Thu Nov 18 18:19:59 1999 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk.c (tk_command), gdbtk-hooks.c (gdbtk_readline), - gdbtk-variable.c (variable_type): Replace strdup with xstrdup. - -Thu Nov 18 19:03:28 1999 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk-cmds.c (gdb_get_mem): Document nbr parameter. Fix check - on nbr and nbytes parameters. - -1999-11-18 Tom Tromey <tromey@cygnus.com> - - * gdbtk-cmds.c (gdb_actions_command): Updated for new - get_tracepoint_by_number. - -Tue Nov 9 15:40:51 1999 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk-cmds.c (gdb_get_mem): Keep calling - target_read_memory_partial until all the data is read. - -1999-11-01 Tom Tromey <tromey@cygnus.com> - - * gdbtk-cmds.c (gdb_actions_command): Updated for new - get_tracepoint_by_number. - -Fri Oct 15 18:34:41 1999 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk-hooks.c (ui_load_progress_hook): Move extern declaration - to defs.h. - (gdbtk_load_hash): Update SECTION argument to match prototype. - Make static. - -Wed Oct 13 17:57:17 1999 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk-hooks.c (gdbtk_flush): Delete. - (gdbtk_add_hooks): Don't initialize flush_hook. - -Mon Oct 11 10:19:04 1999 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk-cmds.c (gdb_get_tracepoint_info): Use paddr_nz to convert - the address into a string. - -1999-10-05 James Ingham <jingham@leda.cygnus.com> - - * gdbtk-cmds.c (map_arg_registers): Don't stop at the first - undefined register, but skip it and go on. There may be other - defined registers higher up in the list. - -1999-09-29 Fred Fish <fnf@cygnus.com> - - * gdbtk-varobj.c (variable_create): Replace cast "(CORE_ADDR) - 1" - with the more obviously intended expression "(CORE_ADDR) -1". - -1999-09-23 Fernando Nasser <fnasser@totem.to.cygnus.com> - - * gdbtk-variable.c (variable_value): Fix handling of baseclasses and - correct the behavior when it is not a baseclass (both cases could - potentially dumping core). - -1999-09-23 James Ingham <jingham@leda.cygnus.com> - - * gdbtk.c (gdbtk_init): Add the initialization of the shell - execute command under cygwin. - - * gdbtk-hooks.c (gdbtk_attach): New function, run from the attach - hook. - (gdbtk_detach): New function, run from the detach hook. - (gdbtk_add_hooks): Add the attach & detach hooks. - -1999-09-23 Fernando Nasser <fnasser@totem.to.cygnus.com> - - * gdbtk-varobj.c (variable_create): Dynamically allocate variable - object name string. - -1999-09-22 Fernando Nasser <fnasser@totem.to.cygnus.com> - - * gdbtk-variable.c (_gdb_variable): Remove unused entry. - (variable_update): Fix error in list initialization (apparently - innocuous). - (type_changeable): Fix handling of typedef'ed structs and - unions (removing c_variable.exp test case 2.12 FAIL). - -Mon Sep 20 18:03:28 1999 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk-variable.c (new_root_variable): Fix prototype declaration. - * gdbtk.c (_initialize_gdbtk): Add declaration. - * gdbtk-cmds.c (tracepoint_exists): Make static. Add declaration. - * gdbtk.c (gdbtk_add_hooks): Move declaration from here. - * gdbtk.h (gdbtk_add_hooks): To here. - -Fri Sep 17 19:00:39 1999 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk-cmds.c: Include "source.h". - (gdb_load_disassembly): Fix printf calls. - Makefile.in (gdbtk-cmds.o): Add dependency on source.h. - - * gdbtk.c: Include <itk.h> for Itk_Init. - -1999-09-17 Fernando Nasser <fnasser@totem.to.cygnus.com> - - * gdbtk-varobj.c: New file. It supersedes gdbtk-variable.c and - uses standard gdb varobj code. - -Fri Sep 3 20:16:54 1999 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk.c (gdbtk_init): Cast ``host_name'' and ``target_name'' to - void. While Tcl_SetVar2 treats the value argument as read-only - its prototype does not specify const for the parameter. - -Mon Aug 30 17:56:28 1999 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk.c, gdbtk-hooks.c, gdbtk-cmds.c: #include <unistd.h> moved - to defs.h. - -Mon Aug 30 15:34:42 1999 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk-hooks.c (x_event): Missing result to return - return 0. - Make in_x_event volatile. - (in_fputs): Make volatile. - -1999-09-02 Stan Shebs <shebs@andros.cygnus.com> - - * gdbtk.c: Include version.h, remove inconsistent decls of - host_name and target_name. - -1999-08-27 James Ingham <jingham@leda.cygnus.com> - - * gdbtk.h: Add def'n for gdbtk_fputs, since it is needed outside - of gdbtk-hooks.c - - * gdbtk-cmds.c (gdb_load_disassembly): Really implement this - function. Load the source widget from C. - (gdbtk_load_source): Helper for the above, which loads source lines. - (gdbtk_load_asm): Helper for the above, which loads assembly - lines. - (gdb_restore_fputs): New function, restore the gdbtk_fputs hook, - in case somebody supressed it, and then errored out before they - got a chance to put it back. - -1999-08-10 James Ingham <jingham@leda.cygnus.com> - - * gdbtk-hooks.c: Remove the gdb_disassembly_flavor_hook. Use the - set_hook instead. - -Mon Aug 9 10:28:22 1999 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk.c, gdbtk-cmds.c: Delete #if ANSI_PROTOTYPES code, GDB - assumes ISO-C. - -1999-08-06 Tom Tromey <tromey@cygnus.com> - - * gdbtk-hooks.c (gdbtk_add_hooks): Set `set_hook'. - (gdbtk_set_hook): New function. - -1999-08-05 Keith Seitz <keiths@cygnus.com> - - * gdbtk-variable.c (new_variable): Add missing return value. - -1999-08-02 James Ingham <jingham@leda.cygnus.com> - - * gdbtk-cmds.c: Misc. Cleanups... Mostly wrapping at 80 - characters. - (gdb_loadfile): Go straight to the widget command to insert the - text, rather than through the interpreter. Gives about 2x-3x - speedup in rendering the source text. - (gdb_disassemble): Rewrite to separate out the generic disassembly - work from the printing part. The former goes in - gdb_disassembly_driver. This way I can share the code with the - version that loads the text widget directly. - (gdb_load_disassembly): New function. This will load the text - widget directly (not done yet). - (gdbtk_load_source): Load the text widget with a source line. - (gdbtk_load_asm): Load the text widget with an assembly line. - (gdbtk_print_source): Print a source line to stdout. - (gdbtk_print_asm): Print an assembly line to stdout. - (gdb_disassemble_driver): New function. - - * gdbtk.h: Fix a compiler warning from Keith's 07-27 checkin. - -1999-08-02 Keith Seitz <keiths@cygnus.com> - - * gdbtk-variable.c (CPLUS_FAKE_CHILD): NULL variables are not - "fakes", either. - -1999-07-27 Keith Seitz <keiths@cygnus.com> - - * gdbtk-variable.c: Rewrite. :-) - * gdbtk-wrapper.c (GDB_value_ind): New function. - (GDB_value_slice): New function. - (GDB_value_coerce_array): New function. - (GDB_value_struct_elt): New function. - (GDB_value_cast): New function. - (GDB_get_frame_block): New function. - (wrap_value_slice): New function. - (wrap_value_coerce_array): New function. - (wrap_value_struct_elt): New function. - (wrap_value_cast): New function. - (wrap_get_frame_block): New function. - * gdbtk-wrapper.h: Add declarations for above new functions. - * gdbtk-cmds.c (gdb_selected_block): New function. - (gdb_get_blocks): New function. - (gdb_block_vars): New function. - -1999-07-16 Keith Seitz <keiths@cygnus.com> - - * gdbtk-cmds.c (gdb_loc): Change all references of "stop_pc" to - "read_pc ()". - - * gdbtk.c (target_is_native): New function. - (target_should_use_timer): Use target_is_native to determine whether - the timer should run. - * gdbtk.h (target_is_native): Add prototype. - * gdbtk-cmds.c (gdb_disassemble): Use target_is_native to determine if - we should disassemble from inferior memory. - -1999-07-09 Fernando Nasser <fnasser@totem.to.cygnus.com> - - * gdbtk-variable.c (variable_obj_command): Add missing comments - for object variable commands. - -Fri Jul 9 12:06:36 1999 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk-cmds.c (Gdbtk_Init): Explicitly route log/debug and target - output to stderr instead of stdout. - -1999-06-21 James Ingham <jingham@leda.cygnus.com> - - * gdbtk.c (target_should_use_timer): Add check for "linuxthreads" - to enable the timer for Linux as well as other natives. - -1999-06-15 Keith Seitz <keiths@cygnus.com> - - * gdbtk-hooks.c (gdbtk_annotate_signal): Run - gdbtk_stop_idle_callback so that signals don't interfere - with the stop button. - -1999-06-10 Keith Seitz <keiths@cygnus.com> - - * gdbtk.c (gdbtk_init): Add host_name and target_name to - GDBStartup. - - * gdbtk-cmds.c (gdb_clear_file): Delete breakpoints and - clear the exec file, too. - (gdb_loadfile): Don't close a file that's not opened until - later. - -Wed Jun 9 14:21:40 1999 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk-cmds.c (old_regs): Change array to a pointer. - (setup_architecture_data): New function. - (Gdbtk_Init): Call setup_architecture_data. Register ``old_regs'' - as an architecture dependant variable. - -1999-05-25 Keith Seitz <keiths@cygnus.com> - - * gdbtk-wrapper.c (GDB_val_print): Fix compiler warnings. - (wrap_val_print): Ditto. - (GDB_block_for_pc): Ditto. - (wrap_block_for_pc): Ditto. - (GDB_find_frame_addr_in_frame_chain): Ditto. - (wrap_find_frame_addr_in_frame_chain): Ditto. - - * gdbtk-variable.c (variable_create): Rename "-pc" option - to the more explicit name "-frame". Update usage. - (create_variable): Swallow errors before parse_exp_1, too. - If no frame is given as an argument, use the current frame; - otherwise, use the current block in the specified frame. - (variable_children): Check for errors creating children. - (create_child): Ditto. - - * gdbtk-cmds.c (get_selected_frame): New function. - (Gdbtk_Init): Add get_selected_frame to interpreter. - (gdb_get_vars_command): Use current block in selected frame - if no args specified. - - * Makefile.in (gdbtk-cmds.o): Depend on frame.h, too - -Tue May 25 16:12:57 1999 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk-cmds.c (REGISTER_CONVERTIBLE, - REGISTER_CONVERT_TO_VIRTUAL): Delete default definitions. - gdbarch.h ensures that there is always a definition available. - -1999-05-20 Andrew Cagney <cagney@b1.cygnus.com> - - Mon Apr 26 09:15:27 1999 Andrew Cagney <cagney@b1.cygnus.com>: - * gdbtk.c (x_event_wrapper): Wrapper for x_event that matches - signal function signature. - (gdbtk_start_timer): set .sa_handler to x_event_wrapper instead of - x_event. - -1999-05-14 Keith Seitz <keiths@cygnus.com> - - * configure.in (ENABLE_GDBTK): Don't clobber WIN32LIBS. - * configure: Regenerated. - -1999-04-12 Keith Seitz <keiths@cygnus.com> - - * gdbtk-variable.c (variable_value_changed): Swallow errors from - evaluate_expression. - -1999-04-09 James Ingham <jingham@cygnus.com> - - * gdbtk-cmds.c (gdb_get_mem): Use the Tcl list API to add the - ASCII entry to the return list. We were trying to do the quoting - by hand which is bound to lose in some cases. - -1999-04-06 Martin Hunt <hunt@cygnus.com> - - * gdbtk-hooks.c (gdbtk_annotate_signal): New function. - Notifies GDBtk when a signal occurs. - -1999-04-02 Keith Seitz <keiths@cygnus.com> - - * gdbtk-hooks.c (gdbtk_force_detach): New global. - (x_event): Change to return gdbtk_force_detach so that - callers will know if we want to detach. See comments. - (gdbtk_wait): Insert calls to gdbtk_start/stop_timer. This - is a nop for most hosts/targets. Remove ice-specific code. - - * gdbtk-cmds.c (gdb_stop): Add "detach" option, which forces - gdb to detach from the target. See comments. - - * gdbtk.c (target_should_use_timer): New function. - (gdbtk_start_timer): Only use on unix native targets. - (gdbtk_stop_timer): Ditto. - - * gdbtk.h (x_event): Update declaration: now returns an int. - -1999-03-29 Stan Shebs <shebs@andros.cygnus.com> - - * gdbtk.c, gdbtk-cmds.c, gdbtk-hooks.c: Don't include setjmp.h. - -1999-03-29 Keith Seitz <keiths@cygnus.com> - - * gdbtk-cmds.c (pc_function_name): New function which returns the - source name (regardless of mangling) of the function at a given PC. - (gdb_get_function_command): Use it. - (gdb_get_tracepoint_info): Ditto. - (gdb_loc): Ditto. - (gdb_get_breakpoint_info): Ditto. - - * Makefile.in (install-only): Don't install help/index.toc: it doesn't - exist anymore. - -Wed Mar 10 19:37:23 1999 Geoffrey Noer <noer@cygnus.com> - - * gdbtk-cmds.c: Don't need to include any Win32 API headers. - * gdbtk-hooks.c: Include Windows.h, not just winuser.h. - * gdbtk.c: Ditto. - -1999-03-04 Martin Hunt <hunt@cygnus.com> - - * gdbtk-hooks.c (gdbtk_load_hash): Change download_hash() - to Download::download_hash(). - -1999-03-01 Martin Hunt <hunt@cygnus.com> - - * gdbtk.c (TclDebug): Increase buffer size to 10000, in case - backtraces are very long. - -1999-02-26 James Ingham <jingham@cygnus.com> - - * gdbtk-cmds.c (gdb_search): Add a -filename switch, which returns - the file in which the function or type was defined, along with the - function... - - * gdbtk.c (gdbtk_find_main): The external editor stuff was getting - set twice... - -1999-02-18 Martin Hunt <hunt@cygnus.com> - - * gdbtk-cmds.c (gdb_disassemble): When debugging native threads, - set disassemble_from_exec to 0. This fixes bugs where disassembly - of threaded programs failed. - -1999-02-16 James Ingham <jingham@cygnus.com> - - * gdbtk.c (gdbtk_init): Remove redundant setting of the external - editor variables. - -1999-02-11 Martin Hunt <hunt@cygnus.com> - - * gdbtk-variable.c (variable_format): Enable binary format. - -1999-02-11 Martin Hunt <hunt@cygnus.com> - - * gdbtk-hooks.c: Change ALL Tcl_Eval calls in hooks to - call report_error() if there are errors. - -1999-02-11 Martin Hunt <hunt@cygnus.com> - - * gdbtk.c, gdbtk-cmds.c, gdbtk-hooks.c: Removed old IDE stuff. - -1999-02-09 Martin Hunt <hunt@cygnus.com> - - * gdbtk-hooks.c: Remove gdbtk_ignorable_warning prototype. - It is in gdbtk.h. - (report_error): New function. Displays debugging information - if a hook function fails. All hook functions should probably - call this. - (gdbtk_warning): Call report_error() if there is a problem. - (gdbtk_register_changed): Call report_error() if there is a problem. - (gdbtk_memory_changed): Call report_error() if there is a problem. - (gdbtk_ignorable_warning): Pass along class argument. If there - is a problem, call report_error(). - - * gdbtk-cmds.c: Remove TclDebug prototype. It is in gdbtk.h. - (gdb_loadfile): Add class name to gdbtk_ignorable_warning call. - - * gdbtk.c (TclDebug): Add "priority" argument. Calls "dbug" - instead of "debug". Removed non-ANSI ifdefs. - - * gdbtk.h: Fixed protos for gdbtk_ignorable_warning and TclDebug. - -1999-02-05 James Ingham <jingham@cygnus.com> - - * Makefile.in: Add GDBTK_CFLAGS - this is now used to hold - -fwritable-strings when compiling with Tk8.1. - * configure.in: Add GDBTK_CFLAGS, set it to -fwritable-strings for - Tcl/Tk8.1 & greater. - * acinclude.m4: Move the rest of the defines to find Itcl, Itk & - Tix from aclocal.m4 to here. - * aclocal.m4: regenerate. - * configure: regenerate. - - * gdbtk-hooks.c (x_event): Tcl_ObjGetVar2 was removed from - Tcl8.1. Use Tcl_GetVar2 instead. - * gdbtk-hooks.c (gdbtk_trace_find): Fix up call to - Tcl_GlobalEvalObj for Tcl/Tk 8.1. - * gdbtk-hooks.c (gdbtk_trace_start_stop): Call to Tcl_EvalObj was - inefficient, replace with call to Tcl_GlobalEval. - * gdbtk.c: Don't swap out the Tcl_Alloc calls in gdbtk.c. We took - care of that in Tcl itself for 8.1. - * gdbtk.c: Remove const from the script string since Tcl8.1 has - taken to scribbling sentinals into strings passed to it again... - - * gdbtk-cmds.c (wrapped_call): Change declaration of 1st arg from - char * to PTR to eliminate warning. - * gdbtk-cmds.c (perror_with_name_wrapper): Ditto - -Thu Feb 4 10:35:28 1999 Keith Seitz <keiths@cygnus.com> - - * gdbtk-variable.c (variable_create): Allocate enough - space to hold the NULL, too! - -Wed Feb 3 13:37:07 1999 Keith Seitz <keiths@cygnus.com> - - * gdbtk-variable.c (variable_create): Add parentheses to the name - so that casts do not confuse the expression parser. - -1999-02-03 Keith Seitz <keiths@cygnus.com> - - * gdbtool.ico: Add missing desktop image. - -1999-02-02 Martin Hunt <hunt@cygnus.com> - - * gdbtk-cmds.c (get_register): For RAW display, concat all the - pieces together before calling fputs. - -1999-02-01 Martin Hunt <hunt@cygnus.com> - - * gdbtk-cmds.c: (gdb_set_bp): Change the "type" argument - to be ASCII instead of an integer. Currently accepts "temp" - or "normal". Fixed error messages. - (gdb_set_bp_addr): Ditto. - -1999-01-29 James Ingham <jingham@cygnus.com> - - * gdbtk.c (gdbtk_init): Set the fputs_unfiltered_hook to - gdbtk_fputs BEFORE you eval script. The old code was setting it - to null until after you did this, but that is wrong, because it - will cause the output of CAUGHT errors to go to gdb_stderr, which - is wrong. You only want to write errors to the console if the - eval generates an error. - -1999-01-29 Martin Hunt <hunt@cygnus.com> - - * gdbtk-cmds.c (gdb_get_breakpoint_info): When printing addresses, - do not rely on the format string "%lx" -- it does not exist for all - hosts. Use paddr instead. - (gdb_loadfile): Increase maximum line size to pass testsuite cases. - - * gdbtk-hooks.c (gdbtk_add_hooks): Remove pc_changed_hook and - add register_changed_hook and memory_changed_hook. - (gdbtk_register_changed): New function. - (gdbtk_memory_changed): New function. - - * gdbtk.c (gdbtk_init): Create tcl warp_pointer command - for use with testing. - - * gdbtk-cmds.c (gdb_loc): Fix for case where there are only - minimal symbols. Also make gdb_loc return the shared library - the location is in, if it is in one. - -1999-01-27 James Ingham <jingham@cygnus.com> - - * gdbtk-wrapper.c: Missed a couple of places where FILE->GDB_FILE - in the fputs_unfiltered_hook needed to propagate. - -1999-01-27 James Ingham <jingham@cygnus.com> - - Merging in changes from gdbtk-980810 - the Itcl3 - gdb branch. - - 1999-01-12 Martin Hunt <hunt@cygnus.com> - - * gdbtk-cmds.c (gdb_loadfile): Increase maximum line size so - files with very long lines get numbered correctly. - - Thu Jan 7 06:50:32 1999 Keith Seitz <keiths@cygnus.com> - - * gdbtk-hooks.c (gdbtk_add_hooks): Add the error_begin_hook; - (gdbtk_error_begin): New function. - (gdbtk_fputs): If GDBTK_ERROR_ONLY is set, treat output to - any stream as if it had come from gdb_stderr. - - * gdbtk.h: Define GDBTK_SYMBOL_SOURCE_NAME: does the same thing - as SYMBOL_SOURCE_NAME, except that it NEVER returns a mangled name. - Define GDBTK_ERROR_ONLY flag for result_ptr. - - * gdbtk-cmds.c (gdb_listfuncs): Use SYMBOL_DEMANGLED_NAME to - get the symbol's fully demangled name (including class and - args for overloaded funcs), not cplus_demangle. - (get_frame_name): Use GDBTK_SYMBOL_SOURCE_NAME to get the name - of the frame level. - - * gdbtk-wrapper.c, gdbtk-wrapper.h: - (GDB_val_print): Allow caller to specify all function args to val_print. - (wrap_val_print): Ditto. - - * gdbtk-variable.c (variable_value): Clear addressprint when getting - value of C++ reference-type variables - If we errored because a parent (struct pointer) was junk, output - an error message indicating so. - (call_gdb_val_print): Tell val_print to dereference C++ reference - types. - (number_of_children): void * also has no children. - (get_call_output): Clear any error flags that may have been set - as a result of error_begin. - - * utils.c (error_begin_hook): New hook. - (error_begin): Call error_begin_hook so that the GUI - gets notified. - - * defs.h (error_begin_hook): Declare. - - Wed Jan 6 08:43:31 1999 Keith Seitz <keiths@cygnus.com> - - * gdbtk-wrapper.c, gdbtk-wrapper.h: Add wrappers for parse_exp_1, - evaluate_type, block_for_pc, block_innermost_frame, reinit_frame_cache, - and find_frame_addr_in_frame_chain. - - * gdbtk-variable.c (variable_create): Check for failure when - creating variables. - (create_variable): Use wrapped calls for block_for_pc, parse_exp_1, - and block_innermost_frame. - Return NULL if parse_exp_1 fails. - Attempt to prohibit creating a gdb_variable for type names. - (variable_value_changed): Use wrapped calls for reinit_frame_cache and - find_frame_addr_in_frame_chain. - (variable_type): Use wrapped call for evaluate_type. - (variable_value): Use wrapped call for parse_exp_1. - (variable_editable): Use wrapped call for evaluate_type. - - Tue Jan 5 11:37:17 1999 Keith Seitz <keiths@cygnus.com> - - * gdbtk-variable.c: New variable object interface. - * gdbtk-wrapper.c, gdbtk-wrapper.h: New wrappers for safely calling - gdb functions without the fear of longjmp'ing. - * configure.in (CONFIG_OBS): Add gdbtk-wrapper.o and gdbtk-variable.o - when gdbtk is enabled. - * configure: Regenerate. - * Makefile.in: Add gdbtk-wrapper.o and gdbtk-variable.o - * gdbtk-cmds.c (call_wrapper): Export so that other files can use. - (Gdbtk_Init): Initialize new variable interface. - * gdbtk.h: Add declaration for call_wrapper. - - Tue Jan 5 11:19:14 1999 Keith Seitz <keiths@cygnus.com> - - * gdbtk-cmds.c (gdb_loc): Call resolve_sal_pc to before using - the sal's pc. - - * gdbtk.c (gdbtk_init): Add global array GDBStartup to interpreter - which contains any startup info. Add "inhibit_prefs" (follows -nx) - so that "-nx" turns preference reading/writing off. - - Mon Dec 21 11:11:02 1998 Keith Seitz <keiths@cygnus.com> - - * gdbtk-cmds.c (get_register): Call get_saved_register instead of - read_relative_register_raw_bytes to fetch registers. - - Thu Dec 17 09:00:56 1998 Keith Seitz <keiths@cygnus.com> - - * gdbtk-cmds.c (gdb_search): Don't mention C++ RTTI and - global constructor/destructor symbols. - - Thu Nov 12 15:20:15 1998 Jim Ingham <jingham@cygnus.com> - * More bug fixes merged in from devo. - - * gdbtk-cmds.c (gdb_cmd): Added an optional second argument to the - gdb_cmd, which is from_tty. This is passed to the gdb command - parser. It is 0 by default, and the console window passes 1. - - * gdbtk-cmds.c: moved disassemble_from_exec from gdbtk.c to gdbtk-cmds.c - with all the other link-var'ed variables - - * gdbtk-hooks.c (gdbtk_trace_find): Only run the hook functions if - we are called from_tty. - - * gdbtk-hooks.c (gdbtk_trace_start_stop): Set the trace buttons - from a trace_start_command callback rather than doing it as a - special case in gdb_cmd. - - * tracepoint.c (tstart_command, tstop_command): Add call to - trace_start_stop_hook here. - - 1998-11-04 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk-cmds.c (gdb_set_bp_addr): For callback, send full - pathname instead of just basename. - - 1998-11-03 Keith Seitz <keiths@cygnus.com> - * v850ice.c (do_gdb): New function. - (ice_stepi): Use do_gdb to step properly. - (ice_nexti): Use do_gdb to step properly. - (view_source): Correct call to src window's location for new version. - - Tue Aug 25 18:13:30 1998 Jim Ingham <jingham@cygnus.com> - - * gdbtk.c (gdbtk_init): I hadn't excised ALL the old startup code, - so it was not working correctly. Now it does. - - Fri Aug 21 14:37:40 1998 Jim Ingham <jingham@cygnus.com> - - * gdbtk.c (gdbtk_init): Changed the startup code to use - tcl_findLibrary - - - - -on Dec 28 17:44:36 1998 David Taylor <taylor@texas.cygnus.com> - - - The following changes were made by Jim Blandy <jimb@cygnus.com>, - Edith Epstein <eepstein@cygnus.com>, Elena Zannoni - <ezannoni@cygnus.com> Stan Shebs <shebs@cygnus.com>, and David - Taylor <taylor@cygnus.com>, as part of the project to merge in - changes originally made by HP; HP did not create ChangeLog - entries. - - * gdbtk.c (gdbtk_init): change stderr to gdb_stderr. - - * gdbtk-cmds.c - (get_pc_register): Use paddr_nz, not sprintf's %llx and - a cast to `long long'. Those aren't portable. - (gdb_eval): add embedded_offset param to val_print call - (get_register): add embedded_offset param to val_print call - - * gdbtk-hooks.c - (tk_command_loop): change instream to a FILE. - (gdbtk_flush): change both the declaration and definition to - use GDB_FILE rather than FILE. - -Mon Dec 21 11:11:02 1998 Keith Seitz <keiths@cygnus.com> - - * gdbtk-cmds.c (get_register): Call get_saved_register instead of - read_relative_register_raw_bytes to fetch registers. - -Thu Dec 17 09:00:56 1998 Keith Seitz <keiths@cygnus.com> - - * gdbtk-cmds.c (gdb_search): Don't mention C++ RTTI and - global constructor/destructor symbols. - -Tue Dec 15 10:09:31 1998 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk-cmds.c (gdb_disassemble): Fix typo. - -Sun Dec 13 09:52:51 1998 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk-cmds.c: Update TARGET_PRINT_INSN_INFO, TARGET_PRINT_INSN. - -Fri Dec 11 09:52:04 1998 Andrew Cagney <cagney@chook> - - * gdbtk-cmds.c: Replace reg_name with REGISTER_NAME. - -Mon Dec 14 13:20:50 1998 Jim Ingham <jingham@cygnus.com> - - * Makefile.in, configure.in configure - add support for LIBGUI - outside the IDE context. - -Thu Nov 19 13:14:57 1998 Geoffrey Noer <noer@cygnus.com> - - * gdbtk-cmds.c: Can't start using new API names yet. Switch back - to calling cygwin32_ funcs until some time has passed... - * gdbtk.c: Ditto. Also, include sys/cygwin.h for Cygwin, instead - of providing own proto. - -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. - - * gdbtk.c: lose "32" from cygwin_ func calls. ifndef for - checking DISPLAY should be for _WIN32, not WINNT. - * gdbtk.h: pick GDBTK_PATH_SEP based on _WIN32, not WINNT. - * gdbtk-cmds.c (gdb_path_conv): lose "32" from cygwin_ func call, - change ifdef to __CYGWIN32__ instead of WINNT. - * {gdbtk.c, gdbtk-hooks.c}: __CYGWIN32__ refs drop the "32". - -Thu Nov 12 15:20:15 1998 Jim Ingham <jingham@cygnus.com> - - * gdbtk-cmds.c (gdb_cmd): Added an optional second argument to the - gdb_cmd, which is from_tty. This is passed to the gdb command - parser. It is 0 by default, and the console window passes 1. - - * gdbtk-cmds.c: moved disassemble_from_exec from gdbtk.c to gdbtk-cmds.c - with all the other link-var'ed variables - - * gdbtk-hooks.c (gdbtk_trace_find): Only run the hook functions if - we are called from_tty. - - * gdbtk-hooks.c (gdbtk_trace_start_stop): Set the trace buttons - from a trace_start_command callback rather than doing it as a - special case in gdb_cmd. - - * tracepoint.c (tstart_command, tstop_command): Add call to - trace_start_stop_hook here. - -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. - -1998-11-03 Keith Seitz <keiths@cygnus.com> - - * v850ice.c (do_gdb): New function. - (ice_stepi): Use do_gdb to step properly. - (ice_nexti): Use do_gdb to step properly. - (view_source): Correct call to src window's location for new version. - -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 16:19:02 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk-cmds.c (gdb_set_bp_addr): For callback, send full - pathname instead of just basename. - -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-10-13 Jason Molenda (jsm@bugshack.cygnus.com) - - * gdbtk.c, gdbtk-cmds.c: Cast parameters passed to make_cleanup to - use the new make_cleanup_func typedef. - -1998-10-08 Keith Seitz <keiths@cygnus.com> - - * gdbtk-hooks.c (gdbtk_add_hooks): Install a hook for - (new) file_changed_hook. - (gdbtk_exec_file_changed): Rename to gdbtk_exec_file_display - to mimic hook's name. - (gdbtk_file_changed): New hook function. - -Tue Oct 6 22:57:13 1998 Andrew Cagney <cagney@b1.cygnus.com> - - * configure.in (links): Link gdbtcl2 directory instead of gdbtcl. - -Mon Oct 5 00:34:00 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk-cmds.c (gdb_set_bp_addr): New command. Sets a - breakpoint at an address. Use this instead of gdb_cmd "break" - because the syntax of the break command is broken and doesn't - allow you to create a thread-specific BP at an address. Also - this is faster. - -Sun Oct 4 22:35:47 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk-cmds.c (gdb_set_bp): Add an optional thread number. - (gdb_find_bp_at_line): New function. Returns a list of bpnums - at the specified line number. - (gdb_find_bp_at_addr): New function. Returns a list of bpnums - at an address.. - -1998-10-02 Keith Seitz <keiths@cygnus.com> - - * gdbtk-hooks.c (gdbtk_exec_file_changed): New function which handles - exec_file changes. - (gdbtk_add_hooks): Define exec_file_display_hook (to gdbtk_exec_file_changed) - - * gdbtk-cmds.c (gdb_stop): target_stop is ALWAYS defined, so - compare against something a little more meaningful (target_ignore). - -1998-09-24 Keith Seitz <keiths@cygnus.com> - - * gdbtk.c (gdbtk_wait): Don't run the timer for ice targets. - - * v850ice.c (WM_ADDR_TO_SYM): New message. - (v850ice_wndproc): Add handler for WM_SOURCE. - (v850ice_wait): Call the ui_loop_hook occasionally. - (ice_cont): Acknowledge message before doing anything. - (ice_stepi): Ack message and let gdbtk do stepping. - (ice_nexti): Ack message and let gdbtk do stepping. - (view_source): New function ICE calls to display source code. - -1998-09-18 Keith Seitz <keiths@cygnus.com> - - * gdbtk-cmds.c (get_frame_name): Demangle function names, too. - -Thu Sep 10 22:10:29 1998 Jim Ingham <jingham@cygnus.com> - - *gdbtk-cmds.c (gdb_disassemble): Make sure the symtab's linetable is not - null before trying to use it... - -1998-09-02 Keith Seitz <keiths@cygnus.com> - - * gdbtk-cmds.c (gdb_cmd): Do not run the timer when downloading -- - the ui_progress_hook that has been installed will actually - update the gui for us. - -Mon Aug 31 15:42:10 1998 Tom Tromey <tromey@cygnus.com> - - * gdbtk-hooks.c (context_hook): Don't define. - -1998-08-31 Keith Seitz <keiths@cygnus.com> - - * gdbtk-cmds.c (gdb_listfuncs): When stripping out "global destructors" - and "global constructors", do not append any elements to the result. - -Sun Aug 30 00:49:18 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk-cmds.c (Gdbtk_Init): Link C variable gdb_context - with tcl variable gdb_context_id. - - * gdbtk-hooks.c (gdbtk_context_change): Implement new hook called - context_hook. Called when threads change. - - * gdbtk.c: Initialize gdb_context. - - * gdbtk.h: Declare gdb_context. - - * infrun (wait_for_inferior): Call context_hook. - - * thread.c (thread_command): Call context_hook. - - * defs.h: Declare context_hook. - -Fri Aug 28 12:14:49 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk-cmds.c (gdb_loadfile): Open the file after doing - the symtab lookup and calling symtab_to_filename(). This - makes GDBtk work with the GDB "dir" command. - -1998-08-18 Keith Seitz <keiths@cygnus.com> - - * gdbtk-hooks.c (gdbtk_add_hooks): Set selected_frame_level_changed_hook. - (gdbtk_selected_frame_changed): New function. - - * gdbtk-cmds.c (Gdbtk_Init): Add command gdb_stack into interpreter. - Link gdb's global selected_frame_level with interpreter global - gdb_selected_frame_level. - (gdb_stack): New function to faciltate speedier backtraces from - gdbtk. - (get_frame_name): New helper function for gdb_stack. - -Tue Aug 18 15:42:40 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk-cmds.c (gdb_listfuncs): Strip out global constructors - and destructors from the function list. - -Thu Aug 13 15:09:59 1998 Drew Moseley <dmoseley@cygnus.com> - - * gdbtk.c (gdbtk_cleanup): added a scope-level around the contents - of the #ifdef so that the variable declarations in there would not - be illegal in a C compilation. - -Mon Jul 27 13:07:16 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdbtk_call_command): Removed because it is now - in gdbtk-hooks.c - (null_routine): Removed. - - * gdbtk-hooks.c (tracepoint_notify): Fix sprintf to - match number of arguments. - - * gdbtk-cmds.c (gdb_loc): When calling gdb_loc with an - argument, call find_pc_line() to get a complete - symtab_and_line struct. - -Fri Jul 24 14:25:43 1998 Keith Seitz <keiths@cygnus.com> - - * gdbtk-cmds.c (gdb_search): Add missing NULL to switches. - Add missing flags to result_ptr. - Pass along any errors caused by getting the list of files from - tcl. - Allocate correct amount of memory for the file list. - Don't do any unecessary cleanups. - -Fri Jul 24 01:08:37 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk-cmds.c (gdb_loadfile): When there are no - linenumbers, use only one tab. - -Sat Jul 18 12:28:39 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdbtk_cleanup): Add call to tcl function - gdbtk_cleanup. We need this so the GUI gets to clean - up no matter how GDB exits. - -Wed Jul 1 13:10:58 1998 Jim Ingham <jingham@cygnus.com> - - * Moved gdbtk_hooks.c & gdbtk_cmds.c to gdbtk-hooks.c & - gdbtk-cmds.c to comply with the gdb conventions. Changed the - configure & makefile to reflect the change... - -Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> - - * gdbtk.c: removed all the commands and hooks from this file so - now it contains only the startup code. - * gdbtk.c (gdbtk_init): Fixed a bug in the startup code on Windows - that caused gdbtk not to find the share directory unless - GDBTK_LIBRARY was set. - * gdbtk_cmds.c: New file - this contains all the Tcl commands that - gdb defines. All the old commands were moved here, the - string-based commands were converted to object commands, and the - object-based commands were all converted to uniformly use the - call_wrapper. A new function, Gdbtk_Init was added to centralize - initializing the gdb package. - * gdbtk_hooks.c: New file - All the hooks were moved here, and a new - function, gdbtk_add_hooks was added to centralize adding all these - hook functions. gdbtk_fputs was also modified to handle the new - result_ptr structure. See the comments in gdbtk.h for more - details. - * gdbtk.h: New file - this contains all the defines and globals - shared by gdbtk.c, gdbtk_cmds.c & gdbtk_hooks.c - * Makefile.in, configure.in & configure: mutatis mutandi for the - new files. - - -Mon Jun 29 11:49:17 1998 Keith Seitz <keiths@cygnus.com> - - * main.c (main): Don't include gdbtk test code if GDBTK is - not defined by configure. - - * configure.in: When enabling gdbtk, add "-DGDBTK" to ENABLE_CFLAGS. - - * configure: Regenerate. - -Fri Jun 26 13:56:07 1998 Keith Seitz <keiths@cygnus.com> - - * gdbtk.c: Change all references to static global "interp" to - "gdbtk_interp" and export this global. - (gdbtk_init): If gdbtk_source_filename is not NULL, source this file - into the interpreter when it goes idle. - Add new command "gdb_search". - (gdb_search): New function which searches the symbol table. - (gdbtk_test): New function called by main when the --tclcommand - option is used. - - * main.c (main): Add a new option "--tclcommand" which is used - by the testsuite to source a file into the interpreter when it - goes idle. - -Sun Jun 21 09:31:12 1998 Ron Unrau (runrau@cygnus.com) - - * gdbtk.c (gdb_set_bp): Use new interface. - -Wed Jun 17 19:12:23 1998 Jeff Holcomb <jeffh@cygnus.com> - - * Makefile.in (install-only): Install tracing help files. - -Mon Jun 15 13:18:21 1998 Jim Ingham <jingham@cygnus.com> - - * gdbtk.c (gdbtk_init): Add elements to the auto_path AS LIST - ELEMENTS. This allows gdbtk to work when installed in a directory - which has a space in the path. D. Moseley pointed out the bug. - - -Tue Jun 9 14:10:46 1998 Keith Seitz <keiths@cygnus.com> - - * gdbtk.c (gdb_get_vars_command): Return static variables and - variables stored in registers. - - * main.c (main): Call pre/post_add_symbol_hook's when loading - executables and symbol files. - -Fri Jun 5 00:16:22 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdbtk_init): Change all references to - GDBTK_IDE to IDE_ENABLED. - -Thu Jun 4 18:31:53 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdbtk_init): Initialize tkTable. - -Thu Jun 4 10:15:03 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> - - * gdbtk.c: merged: - - - Elena Zannoni <ezannoni@kwikemart.cygnus.com> - (call_obj_wrapper): in case of error, copy the - error message from the result to the error_string. - (gdbtk_fputs): add comments. - (gdb_actions_command): call validate_actionline when installing the - tracepoint, to do the syntax checking of the actions for us. - - Elena Zannoni <ezannoni@kwikemart.cygnus.com> - (gdb_get_trace_frame_num): new function to get the - trace frame number from gdb. - (gdbtk_init): added new command gdb_get_trace_frame_num. - - Jim Blandy <jimb@zwingli.cygnus.com> - (struct wrapped_call_objs): Change the `func' member to - be a Tcl_ObjCmdProc, not an Tcl_CmdProc, since it accepts a vector - of objects as arguments. Change the object vector to be const, - since that's what all the users of this structure seem to expect. - (call_obj_wrapper): Cast clientData properly before storing it in - the wrapped_args structure. - -Thu May 28 17:19:14 1998 Keith Seitz <keiths@cygnus.com> - - * gdbtk.c (_initialize_gdbtk): Get rid of the console. Patch from - Chris Faylor (cgf@cygnus.com). - - * configure.in: Link cygwin32 with subsystem console. - - * configure: Regenerated - -Sun May 24 14:00:24 1998 Keith Seitz <keiths@cygnus.com> - - * ser-unix.c (wait_for): Do not reset timeout_remaining for cygwin32 so that - we can use this member to track real timeouts. - (hardwire_readchar): Modify for cygwin32 so that we only ever use a real - system timeout of one second. Track the "real" timeout as a series of these - one second timeouts. - Call ui_loop_hook to keep the gui alive. - - * top.c: Define new hook for cygwin32, "ui_loop_hook". - - * gdbtk.c (gdbtk_init): Add ui_loop_hook for CygWin32 to work around - update problems. - -Thu May 21 13:56:24 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> - - * gdbtk.c: reinserted the changes that were accidentally deleted: - (_initialize_gdbtk): Use correct device names in - cygwin-specific call (cosmetic change). - (gdbtk_ignorable_warning): removed va_list parameter, - which was unused. - (_initialize_gdbtk): add cygwin32 specific code to - allow `gdb -nw' to work when specified specified from a windows - console-mode command line. - -1998-05-19 Jim Blandy <jimb@zwingli.cygnus.com> - - * gdbtk.c (struct wrapped_call_objs): Change the `func' member to - be a Tcl_ObjCmdProc, not an Tcl_CmdProc, since it accepts a vector - of objects as arguments. Change the object vector to be const, - since that's what all the users of this structure seem to expect. - (call_obj_wrapper): Cast clientData properly before storing it in - the wrapped_args structure. - -Wed May 13 11:12:58 1998 James Ingham <jingham@leda.cygnus.com> - - * gdbtk.c: Fixed a goof in the definition of the gdb_get_args & - gdb_get_locals Tcl commands. Moved the previous ChangeLog entry - from ChangeLog to ChangeLog-gdbtk (here)... - -Tue May 12 13:29:20 1998 Jeff Holcomb <jeffh@cygnus.com> - - * Makefile.in (install-only): Add images/icons.txt and - images2/icons.txt to files that need to be installed. - -Tue May 12 12:03:16 1998 James Ingham <jingham@leda.cygnus.com> - - * gdbtk.c: Add an object call wrapper for the new Tcl_Obj based - commands. This way the obj commands will also go through - catch_errors. This is just a bandaid while I rewrite the - string-based commands to use the object format. - -Tue May 5 09:30:25 1998 Christopher Faylor <cgf@cygnus.com> - - * gdbtk.c (_initialize_gdbtk): Use correct device names in - cygwin-specific call (cosmetic change). - -Wed Apr 29 15:53:16 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> - - * gdbtk.c (gdbtk_ignorable_warning): removed va_list parameter, - which was unused. - -Tue Apr 28 19:41:33 1998 Tom Tromey <tromey@cygnus.com> - - * Makefile.in (GDBTKLIBS): New macro. - (INSTALLED_LIBS): Include GDBTKLIBS. - (CLIBS): Likewise. - * configure: Rebuilt. - * configure.in: Put Tcl/Tk libs into GDBTKLIBS, not LIBS. - (GDBTKLIBS): AC_SUBST. - -Thu Apr 23 19:01:05 1998 Keith Seitz <keiths@onions.cygnus.com> - - * Makefile.in (install-only): Install help files. - -Wed Apr 22 21:17:35 1998 Christopher Faylor <cgf@cygnus.com> - - * gdbtk.c (_initialize_gdbtk): add cygwin32 specific code to - allow `gdb -nw' to work when specified specified from a windows - console-mode command line. - -Wed Apr 15 11:23:53 1998 Stan Shebs <shebs@andros.cygnus.com> - - * gdbtcl: Remove directory and contents, this version of - the interface is obsolete. - -Mon Apr 13 16:17:52 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdb_loadfile): Change fstat() call to stat(). - Needed because you can't convert a FILE* to an fd. - -Mon Apr 13 16:28:07 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> - - * gdbtk.c: (perror_with_name_wrapper) new function to call - perror_with_name safely. - (gdb_loadfile) added source vs. executable time stamp check. - (gdbtk_warning) new function to pass a warning message to the gui. - (gdbtk_ignorable_warning) new function to pass a warning - to the gui. Used only for the src. vs. exec check. - (gdbtk_init) added warning_hook - added include <sys/stat.h> - -Mon Apr 13 12:58:26 1998 Keith Seitz <keiths@onions.cygnus.com> - - * gdbtk.c (gdbtk_start_timer): Include on all platforms. Decrease - timer interval a little. - (gdbtk_stop_timer): Include on all platforms. - (gdbtk_wait): No more signals! Use a timer on all platforms to keep the - GUI alive. - (gdbtk_init): Remove FIOASYNC and all x_fd references. Now using timers - on all platforms. - -Fri Apr 10 15:48:10 1998 Jason Molenda (crash@bugshack.cygnus.com) - - * gdbtk.c (gdb_listfiles): Allocate space for 'files' dynamically. - -Thu Apr 9 14:20:59 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdbtk_init): Remove redundant variable "IDE". - -Tue Apr 7 15:13:58 1998 Stan Shebs <shebs@andros.cygnus.com> - - * gdbtk.tcl: Remove, no longer used. - -Tue Apr 7 12:49:45 1998 Keith Seitz <keiths@onions.cygnus.com> - - * gdbtk.c (gdb_cmd): NEVER call the busy, update, and idle hooks. - -Tue Mar 31 15:42:06 1998 Keith Seitz <keiths@onions.cygnus.com> - - * gdbtk.c (gdb_loadfile): Don't use the return result from - sprintf, which returns a char * under SunOS4. - -Tue Mar 31 17:18:43 1998 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: Add $(LIBIDETCL) as well as $(LIBIDE) if - --enable-ide. - * Makefile.in (IDE_CFLAGS_X): Add -I for libidetcl/src. - (LIBIDETCL): Define. - * configure: Rebuild. - -Sun Mar 29 21:19:46 1998 Keith Seitz <keiths@onions.cygnus.com> - - * gdbtk.c (gdb_get_tracepoint_info): Change formatting of address. - (tracepoint_exists): Remove code which confuses assembly traces. - -Sat Mar 28 12:13:23 1998 Keith Seitz <keiths@onions.cygnus.com> - - * gdbtk.c (gdb_cmd): If argc > 2, assume that the busy and idle hooks - should not be called. - -Thu Mar 26 22:29:28 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> - - * gdbtk.c: (gdb_trace_status) new function. - (gdbtk_init) added command "gdb_is_tracing". - (tracepoint_notify) added passcount information. - -Thu Mar 26 12:00:35 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdbtk_fputs): Insert fencepost. - (gdb_loc): Correct pc calculation. - (gdb_immediate_command): Return if a load is in progress. - (gdb_cmd): Return if a load is in progress. - (target_stop_wrapper): New function. - (gdb_stop): Call target_stop_wrapper. - (x_event): Add fencepost and optimize load cancel check. - (gdbtk_start_timer): Set up structs only once. - (gdbtk_stop_timer): Just use preset structs to set timer parameters. - (gdb_loadfile): If file cannot be loaded, return error message. - (gdb_loadfile): Add space before tab so that lines without - a '-' can later be changed to have one. - -Wed Mar 25 14:08:51 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> - - * gdbtk.c (gdbtk_pre_add_symbol): Use Tcl_merge to form Tcl commands. - -Mon Mar 23 13:41:39 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> - - * gdbtk.c (gdb_get_mem): Rewrite to fetch entire contents - of the memory window at once. - -Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> - - Merged changes from Foundry: list follows by author: - - - Tom Tromey <tromey@cygnus.com> - - * Makefile.in (gdbres.o): New target. - (WINDRES): New define. - * configure: Rebuilt. - * configure.in (WINDRES): Define. - (CONFIG_OBS): Include gdbres.o on Windows. - * gdbtool.ico: New file. - * gdb.rc: New file. - * gdbtk.c (gdbtk_init): Call ide_create_messagebox_command. - (gdbtk_cleanup): Call ide_interface_deregister_all. - (gdbtk_init): Pass event handle to cleanup. - (TclDebug): Use Tcl_Merge to construct command. - (gdbtk_init): Call ide_create_cygwin_path_command. - - - Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdb_set_bp): Set addr_string for bp. - (gdb_get_breakpoint_info): Demangle function - names in breakpoint info. - Include "demangle.h". - (gdb_loc, gdb_listfuncs): Demangle C++ - function names. - (gdb_set_bp): Properly quote filename to fix - problems with spaces. Send pc back as a hex string. - (gdb_listfuncs): Remove debugging line. - Turn off some debugging lines. - (breakpoint_notify): Return correct line number. - (gdb_get_breakpoint_info): Return correct line number. - (gdb_set_bp): New function to provide a better way to - set breakpoints. - (gdbtk_readline, gdbtk_readline_begin): Memory - allocated by tcl needs to be freed by Tcl_Free(). - (find_file_in_dir): Deleted. - (gdb_find_file_command): Call full_lookup_symtab(). - (gdb_listfuncs): Call full_lookup_symtab(). - (full_lookup_symtab): New function. Like lookup_symtab - except handles multiple files with the same basename, - full pathnames, and always sets symtab->fullname. - (gdb_loadfile): Call full_lookup_symtab(). Clear - realloc'd memory. - (gdb_loadfile): Don't tag lines without source. - Tag source lines with source_tag. - (gdb_find_file_command, find_file_in_dir): - Rewrite. Now searches symtabs and psymtabs for a match - on the partial or full filename. Returns the full pathname. - (gdb_loadfile): Realloc additional memory - if someone loads in a file with more than 160,000 - lines. I don't know if this really works because - I don't have enough memory to test it. - (gdb_sourcelines): Deleted. - (gdb_loadfile): New function. Takes a text widget - and loads it with the contents of a file. Marks - and tags source lines. - (pc_changed): New function. - (get_pc_register): Returns the value of - the PC to GDB. - (gdb_loc): If looking on the stack, return - real pc along with calling source line. - (gdb_loc): Return "" instead of "N/A" if - filename is not found. - (gdb_get_breakpoint_info): Same. - (get_register): For Natural mode, set format to 0. - Minor bugfixes from keiths. - (TclDebug): New function for debugging use. - (gdb_loc): Return correct PC for frames - that are not the innermost frame. - (gdb_listfiles): Rewritten to use object - API. Now takes an optional dirname which will cause - only files in that directory or its subdirectories - to be returned. Now returns basenames instead of - full pathnames. - (gdb_cmd): Set/reset load_in_progress flag. - (call_wrapper): Don't pop up dialog for errors in - downloads; just abort download. - (gdbtk_load_hash): Set return value correctly. - - - Keith Seitz <keiths@onions.cygnus.com> - - * gdbtk.c (gdbtk_init): Define the ui_loop_hook so that it can be - called by routines which might block, allowing us to update the GUI. - (gdbtk_wait): Move timer calls to annotation hooks. - (gdbtk_init): Define the annotation hooks. - (gdbtk_annotate_starting): New function for cygwin32 hosts. - (gdbtk_annotate_stopped): New function for cygwin32 hosts. - (gdbtk_annotate_exited): New function for cygwin32 hosts. - (gdbtk_annotate_signalled): New function. for cygwin32 hosts. - (gdbtk_init): Use gdbtk_print_frame_info hook. - (gdbtk_print_frame_info): New function which sets current_source_symtab - based on the given symtab and line info. - (gdb_immediate_command): New function which does - not buffer any - output. (Contrast to gdb_cmd.) - (gdb_prompt_command): New function to return gdb's prompt. - (find_file_in_dir): New functon which searches source paths - for a given filename. - (gdb_find_file): New function which returns path to given file -- uses - find_file_in_dir. - (gdbtk_init): Install "gdb_immediate", "gdb_find_file", and - "gdb_prompt" - commands into interpreter. - - - Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c (gdbtk_timer_going): If __CYGWIN32__, new static - variable. - (gdb_cmd): If __CYGWIN32__, if executing the load command, call - gdbtk_start_timer and gdbtk_stop_timer. - (call_wrapper): If __CYGWIN32__, if the timer is going, turn it - off. Clear load_in_progress. - (x_event): If load_in_progress, quit if download_cancel_ok. - (gdbtk_start_timer): Set gdbtk_timer_going. - (gdbtk_stop_timer): Clear gdbtk_timer_going. - (gdbtk_wait): Call x_event. - (gdbtk_init): Call ide_create_win_grab_command if - __CYGIN32__. - (gdb_clear_file): Clear stop_pc. - -Wed Mar 4 16:50:18 1998 Jason Molenda (crash@bugshack.cygnus.com) - - * gdbtk.c (gdb_listfiles): Fix thinko in last change. - -Wed Mar 4 15:34:49 1998 Jason Molenda (crash@bugshack.cygnus.com) - - * gdbtk.c (gdb_listfiles): Allocate space for 'files' dynamically. - -Tue Feb 10 17:50:37 1998 Keith Seitz <keiths@onions.cygnus.com> - - * gdbtk.c (gdbtk_modify_tracepoint): Define new tracepoint modification hook. - (gdbtk_print_frame_info): Define this hook so that current_source_symtab - is set properly. - (gdb_actions_command): Use free_actions () from tracepoint.c/h. - -Mon Jan 26 11:37:55 1998 Keith Seitz <keiths@onions.cygnus.com> - - * gdbtk.c (gdb_actions_command): Make note of next action - before freeing all references to it. - -Sat Jan 24 23:52:08 1998 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c: Merge from Foundry branch. - (TclDebug): New debugging function. - (gdb_loc): For frames, find address of calling function - instead of whatever is on the stack (usually the next - instruction). - (gdb_listfiles): Takes an optional pathname argument and - returns an alphabetized list of basenames of files in the - path. - -Wed Jan 22 10:37:02 1998 Keith Seitz <keiths@onions.cygnus.com> - - * symfile.c: Define two new hooks for symbol reading: - "pre_add_symbol_hook" and "post_add_symbol_hook". These hooks - are called before we begin reading symbols, and after we finish. - (generic_load): Use new symbol reading hooks and get rid of - compiler warning. - - * gdbtk.c (gdbtk_init): Add hooks for pre- and post-symbol reading. - (gdbtk_pre_add_symbol): New function: the pre-add-symbol hook. - (gdbtk_post_add_symbol): New function: the post-add-symbol hook. - (find_file_in_dir): New function. Moved the guts of gdb_find_file_command - into here to allow its use by others. - (gdb_loc): Use find_file_in_dir to return the real path to the file - (or "N/A" if we can't find it). - - * configure.in (TIX_LIB_EXT): Define new variable for those special cases - when TCL_SHLIB_SUFFIX is not enough to specify the dependency. - - * configure: Regenerate. - -Fri Jan 23 07:47:06 1998 Fred Fish <fnf@cygnus.com> - - * Makefile.in (uninstall): Remove installed gdbtcl dir, if one - was installed. - -Thu Jan 15 12:42:28 1998 Keith Seitz <keiths@onions.cygnus.com> - - * gdbtk.c (gdb_immediate_command): New function which does not buffer any - output. (Contrast to gdb_cmd.) - (gdbtk_init): Install "gdb_immediate" command into interpreter. - -Wed Jan 14 16:38:44 1998 Keith Seitz <keiths@pizza.cygnus.com> - - * configure.in (--enable-gdbtk): If tcl was built with --enable-shared, - use TCL_SHLIB_SUFFIX to specify the suffix of the library file so that - we don't expect to see "libfoo.a" instead of "libfoo.{so,sl, etc}". - - * configure: Regenerate. - -Wed Dec 31 16:50:26 1998 Keith Seitz (keiths@onions.cygnus.com) - - * gdbtk.c (gdb_actions_command): extract and save step count - from "while-stepping" command - -Tue Dec 16 21:16:42 1997 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in (LIBGUI): New variable. - (GUI_CFLAGS_X): New variable. - (IDE_CFLAGS): Add $(GUI_CFLAGS_X). - * configure.in: Add $(LIBGUI) to TCL_LIBS and CONFIG_DEPS. - * configure: Rebuild. - -Wed Dec 10 13:16:45 1997 Keith Seitz <keiths@onions.cygnus.com> - - * gdbtk.c (gdb_get_tracepoint_info): Use info in struct - symtab_and_line (not struct tracepoint) so that we get the - real line info for an address. Arrange data more like - gdb_get_breakpoint_info. - (tracepoint_notify): Use info in struct symtab_and_line again. - (gdbtk_init): Add command "gdb_get_tracepoint_list" into - interpreter. - (gdb_get_tracepoint_list): New function that aids the source - window in displaying tracepoints when the file changes. - -Fri Dec 5 10:31:23 1997 Keith Seitz <keiths@pizza.cygnus.com> - - * gdbtk.c (gdbtk_init): Add gdb_find_file into interpreter. - (gdb_find_file_command): New function which searches source path - to find the real full filename of a file. - -Mon Dec 1 10:19:44 1997 Keith Seitz <keiths@onions.cygnus.com> - - * gdbtk.c: Move include of "guitcl.h" back out of IDE ifdef. - (gdbtk_init): Move ide_initialize_paths out of IDE ifdef. - - * configure.in (TCL_LIBS, CONFIG_DEPS): Add IDE libraries for all - builds. - (CONFIG_OBS): Remove tracepoint.o, which should always be included. - - * configure: regenerate - - * Makefile.in (install-only): ALWAYS install the new gdbtk - (REMOTE_OBS): add tracepoint.o - -Thu Nov 27 09:07:18 1997 Michael Meissner <meissner@cygnus.com> - - * configure.in ({TCL_LIBS,CONFIG_DEPS}): Don't add IDE libraries - if not --enable-ide. - (CONFIG_OBS): Add tracepoint.o to list if --enable-gdbtk. - * configure: Regenerate. - - * gdbtk.c (gdb_get_breakpoint_info): Add missing filename - argument. - (toplevel): Move include of guitcl.h into #ifdef IDE region. - (gdbtk_init): Move ide_initialize_paths call into #ifdef IDE - section. - - * Makefile.in (gdbtk.o): Update dependencies. - -Wed Nov 26 15:02:43 1997 Keith Seitz <keiths@onions.cygnus.com> - - * gdbtk.c (gdb_loc): symtab_to_filename can return NULL. - (breakpoint_notify): Ditto. - (gdb_get_breakpoint_info): Ditto. - -Wed Nov 26 11:33:09 1997 Keith Seitz <keiths@onions.cygnus.com> - - Merge in code from Foundry branch: - - * Makefile.in (install-only): install the new gdbtk, not the old - - * gdbtk.c (gdbtk_call_command): also run idle hooks for class_trace - commands - (gdbtk_init): Add new commands "gdb_get_locals", "gdb_get_args", - "gdb_get_function", "gdb_get_line", "gdb_get_file", - "gdb_tracepoint_exists", "gdb_get_tracepoint_info", "gdb_actions", - and "gdb_prompt". - (gdb_get_vars_command): New function. - (gdb_get_line_command): New. - (gdb_get_file_command): New. - (gdb_get_function_command): New. - (gdb_get_tracepoint_info): New. - (gdbtk_create_tracepoint): New. - (gdbtk_delete_tracepoint): New. - (tracepoint_notify): New. - (tracepoint_exists): New. - (gdb_actions_command): New. - (gdb_tracepoint_exists_command): New. - (gdb_prompt_command): New. - -Thu Nov 13 18:15:54 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c: Move include of gdbcore.h to top of file. - (close_bfds): New static function if _WIN32. - (gdbtk_readline): Call close_bfds. - (call_wrapper, tk_command_loop): Likewise. - (gdb_clear_file): New static function. - (gdbtk_init): Create gdb_clear_file Tcl command. - -Wed Nov 12 14:58:39 1997 Jeff Holcomb <jeffh@cygnus.com> - - * gdbtk.c: gdbtk_load_hash and ui_load_progress_hook return an - int result. - (gdbtk_load_hash): download hash routine returns an int result. - -Mon Nov 10 15:11:51 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c (gdbtk_init): Call ide_create_shell_execute_command if - __CYGWIN32__. - * configure.in: Add -lshell32 to WIN32LIBS on cygwin32. - * configure: Rebuild. - -Sun Nov 9 16:25:34 1997 Tom Tromey <tromey@cygnus.com> - - * gdbtk.c (gdbtk_init): Run ide_create_help_command. - -Tue Oct 28 17:31:47 1997 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdbtk_init): Call ide_create_winprint_command. - -Thu Oct 23 15:53:37 1997 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: Add -lgdi32 to WIN32LIBS when linking gdbtk on - cygwin32. - * configure: Rebuild. - -Wed Oct 22 21:32:54 1997 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdbtk_init): Create sizebox command on Windows. - -Thu Oct 9 14:33:21 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c (gdbtk_init): Remove assertion argument from call to - ide_create_window_register_command. - -Wed Oct 1 11:09:52 1997 Tom Tromey <tromey@cygnus.com> - - * gdbtk.c (gdbtk_init): Pass name of restore interface to - ide_create_window_register_command. - -Fri Sep 26 21:08:22 1997 Keith Seitz <keiths@pizza.cygnus.com> - - * gdbtk.c (gdbtk_init): Initialize ui_load_progress_hook. - -Thu Sep 25 03:05:00 1997 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdb_load_info): New function. Returns a list - of section names and sizes for an executable. - (gdbtk_load_hash): Stub function to call tcl function - download_hash. - -Tue Sep 23 01:29:00 1997 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdb_get_mem): Fix compiler warning. - -Sun Sep 21 00:15:00 1997 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdb_get_mem): Fix problem with ASCII dump. - -Tue Sep 16 18:07:17 1997 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdb_get_mem): New function. Returns - a formatted memory dump with optional ASCII dump. - -Mon Sep 8 12:48:50 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c: Include ilutk.h if IDE. - (gdb_confirm_quit, gdb_force_quit): New static functions. - (gdbtk_init): Add Tcl commands gdb_confirm_quit and - gdb_force_quit. - -Mon Sep 8 03:05:33 1997 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdb_get_breakpoint_info): Now returns the - function a breakpoint is in. - -Fri Sep 5 20:23:58 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c (gdbtk_init): Call ide_create_exit_command. - -Wed Sep 3 19:39:15 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c: Include guitcl.h. - (gdbtk_init): Always call ide_initialize_paths. Set the Tcl - variable IDE to 1 when using the IDE. Always try using auto path - to find main.tcl. - * Makefile.in (IDE_CFLAGS_X): Always include libide. - (LIBIDE): New variable. - (IDE_X): Omit -lide. - (IDE_DEPS): Omit libide. - * configure.in: Add LIBIDE to TCL_LIBS and CONFIG_DEPS. - * configure: Rebuild. - -Mon Aug 25 02:28:55 1997 Keith Seitz <keiths@pizza.cygnus.com> - - * gdbtk.c: (gdb_target_has_inferior) check if inferior_pid is non-zero - before assuming that the inferior is running. - -Mon Aug 25 01:06:48 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c (gdbtk_start_timer): Pass third argument to setitimer. - (gdbtk_stop_timer): Likewise. - -Mon Aug 25 00:23:08 1997 Keith Seitz <keiths@pizza.cygnus.com> - - * gdbtk.c: (gdbtk_init) create new command "gdb_target_has_execution" - (gdb_target_has_execution_command) new function - -Sun Aug 24 20:27:22 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c (gdb_loc): If there are no symbols, just bail - immediately. - (tk_command_loop): Print errors encountered while running - gdbtk_tcl_preloop. - -Sun Aug 24 13:44:03 1997 Tom Tromey <tromey@cygnus.com> - - * gdbtk.c (gdbtk_init): Run ide_create_build_command. - -Sat Aug 23 21:53:39 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c: If CYGWIN32, include <sys/time.h>. - (x_fd): Don't define if WINNT. - (gdbtk_start_timer, gdbtk_stop_timer): New static functions if - CYGWIN32. - (gdbtk_wait): Don't set up signal handling if WINNT. If CYGWIN32, - call gdbtk_start_timer and gdbtk_stop_timer. - (gdbtk_init): Don't set up signal handling or make x_fd - asynchronous if CYGWIN32. - -Fri Aug 22 15:23:15 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c (error_string_ptr): New static variable. - (gdbtk_fputs): If result_ptr is NULL, and error_string_ptr is not - NULL, and we're outputting to stderr, append string to - error_string_ptr rather than calling gdbtk_tcl_fputs. - (call_wrapper): Set up error_string_ptr. Put both error string - and normal string in Tcl result. - - * gdbtk.c (gdbtk_init): Don't call ide_run_server_init until after - gdb has initialized. - -Thu Aug 21 19:14:38 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c: If _WIN32, include winuser.h. - (gdbtk_init): If _WIN32, use MessageBox to display an error - evaluating main.tcl. - -Thu Aug 21 00:48:00 1997 Martin M. Hunt <hunt@pern.cygnus.com> - - * gdbtk.c (gdbtk_init): Add call to ide_run_server_init(). - (gdb_cmd): For the load command, don't buffer the I/O. - -Wed Aug 20 11:41:22 1997 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdbtk_query): Chaneg free() call to Tcl_Free(). - -Tue Aug 19 17:09:19 1997 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in (TCL_DEPS, TK_DEPS): New variables. - (ITCL_DEPS, TIX_DEPS): New variables. - (IDE_DEPS): New variable. - (CDEPS): Include @CONFIG_DEPS@. - * configure.in: Set and substitute CONFIG_DEPS and TIX_DEPS. - * configure: Rebuild. - -Sun Aug 17 00:42:11 1997 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (gdb_listfuncs): New function that returns - a list of all the functions in a source file. - -Tue Aug 12 16:35:21 1997 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in (install-only): Install tclIndex if ENABLE_IDE. - -Mon Aug 11 10:43:04 1997 Tom Tromey <tromey@cygnus.com> - - * gdbtk.c (gdbtk_init): Use ide_event_init_from_environment. - -Fri Aug 8 15:59:24 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c (gdbtk_init): Change gdbtk_lib_tmp and gdbtk_file to be - dynamically allocated, rather than fixed size. Pass "gdbtcl" to - ide_initialize_paths to match installed directory name. If IDE, - use auto_path to search for main.tcl. - * Makefile.in (install-only): If ENABLE_IDE, install from gdbtcl2 - rather than gdbtcl. - - * gdbtk.c (gdbtk_cleanup): New static function. - (gdbtk_init): Add gdbtk_cleanup as a final cleanup. Uncomment - call to ide_initialize_paths. If we can't initialize the event - system, set GDBTK_IDE to 0 in the Tcl interpreter. Create the - ide_window_register and the ide_window commands. Initialize tk, - itcl, and tix after initializing the IDE. - - * configure.in (tixdir): Update for cygwin32 case for Tcl 8.0. - * configure: Rebuild. - -Fri Aug 8 00:13:32 1997 Martin M. Hunt <hunt@cygnus.com> - - * gdbtk.c (breakpoint_notify): Change buffer size from 100 - to 256 to avoid memory corruption with very long pathnames. - -Thu Aug 7 14:08:23 1997 Martin M. Hunt <hunt@cygnus.com> - - * configure.in: Change required Tix version to 4.1.8.0 . - * configure: Rebuilt. - -Fri Aug 1 15:21:44 1997 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c (Tcl_Alloc): Don't provide our own version of this if - _WIN32. - (Tcl_Realloc, Tcl_Free): Likewise. - * configure.in: Check for cygwin32 environment. Define and - substitute WIN32LIBS and WIN32LDAPP. Always set configdir to - unix; setting it to win was for an old Tcl/Tk configuration - scheme. - * aclocal.m4 (CY_AC_LOAD_TKCONFIG): Substitute TK_BUILD_INCLUDES. - * Makefile.in (TK_CFLAGS): Add @TK_BUILD_INCLUDES@. - (WIN32LDAPP, WIN32LIBS): Define. - (CLIBS): Add $(WIN32LIBS). - (gdb): Use $(WIN32LDAPP). - * configure: Rebuild. - -Tue Jul 22 19:45:37 1997 Martin M. Hunt <hunt@cygnus.com> - - * configure.in, aclocal.m4: Another fix to find the - correct Tix library name. - - * configure: Rebuilt. - -Mon Jul 21 22:24:07 1997 Martin M. Hunt <hunt@cygnus.com> - - * aclocal.m4: Search for the correct tix library. - -Thu Jul 10 00:02:41 1997 Martin M. Hunt <hunt@cygnus.com> - - * Makefile.in, configure.in, aclocal.m4: Add Itcl, Tix, and - IDE configuration information. - - * gdbtk.c (breakpoint_notify): Send address, linenumber and - filename when a breakpoint is set. Avoids call to bp_info. - (gdbtk_init): Call Tcl_FindExecutable(). Add code to handle - Itcl, Tix and IDE initialization. - - * configure: Regenerated. - -Fri Jun 13 10:28:09 1997 Fred Fish <fnf@cygnus.com> - - * gdbtk.c (gdbtk_init): Make truth value test explicit. - Remove unused static variable "Gdbtk_Library". - -Sat Jun 7 02:34:19 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) - - * gdbtk.c (gdb_get_breakpoint_info): Add string for new - enumeration del_at_next_stop to bpdisp array. - -Tue Jun 3 15:46:51 1997 Tom Tromey <tromey@cygnus.com> - - * Makefile.in (LIB_RUNTIME_DIR): New variable. - -Wed May 7 19:10:19 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk.c (wrapped_call): New function - make actual call to tk - worker function. - (call_wrapper): Rewrite to use top.c:catch_errors. - - * gdbtk.c (gdb_stop): If No target_stop set quit flag and hope for - best. - -Mon Apr 21 14:00:08 1997 Doug Evans <dje@canuck.cygnus.com> - - * gdbtk.c (gdb_disassemble): Store endian-ness in `di'. - -Wed Apr 16 12:33:06 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * Makefile.in (install-only): Make list of gdbtcl files to install - explicit - was picking up files such as ChangeLog etc. - (install-only): Don't blindly create the directory. - -Tue Apr 1 15:04:21 1997 Jason Molenda (crash@godzilla.cygnus.co.jp) - - * configure.in (gdbtcl): Create soft-link for gdbtcl/ directory - instead of gdbtk.tcl. - -Fri Mar 28 17:04:02 1997 Jason Molenda (crash@godzilla.cygnus.co.jp) - - * Makefile.in (gdbtk.o): look for GDBTK_LIBRARY in $(datadir) by - default, not $(srcdir). - -Wed Mar 19 15:16:17 1997 Martin M. Hunt <hunt@onions.cygnus.com> - - * Makefile.in: Install gdbtcl dir instead of gdbtk.tcl. - - * gdbtk.c: Added some ifdefs for Windows. Changed GDBTK_FILENAME - to GDBTK_LIBRARY, which is now a path to search. - (gdb_path_conv): New function. Convert Cygwin32 pathname to - DOS-style pathname. - - * {aclocal.m4,configure.in}: Changes for Windows builds. - - * configure: Rebuilt. - -Fri Mar 14 10:01:29 1997 Tom Tromey <tromey@cygnus.com> - - * configure: Regenerated. - * configure.in (LIBS): Re-reverse order of TCL_LIBS and TK_LIBS. - -Wed Mar 12 14:29:52 1997 Tom Tromey <tromey@cygnus.com> - - * gdbtk.c (x_event): Use Tcl_DoOneEvent, TCL_DONT_WAIT, - TCL_ALL_EVENTS. - - * configure: Regenerated. - * configure.in (ENABLE_GDBTK): Put TCL_LIBS after TK_LIBS in - LIBS. - -Mon Feb 10 13:50:53 1997 Stu Grossman (grossman@critters.cygnus.com) - - * gdbtk.c (call_wrapper): Clear running_now if an error occurs. - -Wed Dec 11 18:51:35 1996 Mark Alexander <marka@cygnus.com> - - * gdbtk.c (gdb_loc): Correct truncation of PC on 64-bit MIPS. - -Tue Nov 19 09:26:14 1996 Tom Tromey <tromey@cygnus.com> - - * gdbtk.c (gdbtk_readline): Fix memory leak. - -Mon Nov 18 23:43:05 1996 Tom Tromey <tromey@cygnus.com> - - Fixes for Tcl 7.6 / Tk 4.2: - * gdbtk.tcl (apply_filespec): Use tk_getOpenFile. - Remove old fileselect code. - * gdbtk.c (Tcl_Alloc): Rename from Tcl_Malloc. - -Fri Sep 27 10:25:30 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.tcl (create_copyright_window): Increase timeout from - 15 seconds to 30 seconds. - -Wed Sep 4 17:28:40 1996 Stu Grossman (grossman@critters.cygnus.com) - - * configure configure.in: Add host *windows* to list of hosts - that don't support GDBtk. - -Fri Aug 23 00:44:57 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.c (gdbtk_init): Check for a DISPLAY env variable and - gracefully degrade to using command line interface if none is - found. - -Fri Aug 9 12:32:53 1996 Tom Tromey <tromey@creche.cygnus.com> - - * Makefile.in (LIB_INSTALL_DIR): New macro. - (TCL): Include @TCL_LD_SEARCH_FLAGS@. - -Thu Aug 1 20:35:01 1996 Tom Tromey <tromey@creche.cygnus.com> - - * gdbtk.c (mainWindow): Deleted. - (cleanup_init): Don't destroy main window. - (gdbtk_init): Main window now created by Tk_Init. - - * configure.in: Most X checks now handled automatically by Tk. - Use new macros to find Tcl/Tk. - * aclocal.m4: New version for new Tcl/Tk; from Don Libes. - * config.in, configure: Regenerated. - - * Makefile.in (TCL, TCL_CFLAGS, TK, TK_CFLAGS, X11_CFLAGS, - X11_LDFLAGS, X11_LIBS): Changed for new Tcl and Tk. - -Thu Aug 1 16:12:05 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) - - * Makefile.in (gdbtk.tcl): put in $(datadir), not $(libdir). - -Fri Jul 26 14:07:37 1996 Ian Lance Taylor <ian@cygnus.com> - - * gdbtk.c (gdb_disassemble): Initialize di.flavour. - -Thu Jul 25 19:41:31 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.c (null_routine): Ditto. - (gdbtk_flush): Ditto. - (gdbtk_fputs): Ditto. - (gdbtk_query): Ditto. - (gdbtk_readline): Ditto. - (gdbtk_readline_end): Ditto. - (gdb_get_breakpoint_list): Ditto. - (gdb_get_breakpoint_info): Ditto. - (breakpoint_notify): Ditto. - (gdbtk_create_breakpoint): Ditto. - (gdbtk_delete_breakpoint): Ditto. - (gdbtk_modify_breakpoint): Ditto. - (gdb_loc): Ditto. - (gdb_eval): Ditto. - (gdb_sourcelines): Ditto. - (map_arg_registers): Ditto. - (get_register_name): Ditto. - (gdb_regnames): Ditto. - (get_register): Ditto. - (gdb_fetch_registers): Ditto. - (register_changed_p): Ditto. - (gdb_changed_register_list): Ditto. - (gdb_cmd): Ditto. - (call_wrapper): Ditto. - (gdb_listfiles): Ditto. - (gdb_stop): Ditto. - (gdbtk_dis_asm_read_memory): Ditto. - (compare_lines): Ditto. - (gdb_disassemble): Ditto. - (tk_command): Ditto. - (cleanup_init): Ditto. - (gdbtk_interactive): Ditto. - (x_event): Ditto. - (gdbtk_wait): Ditto. - (gdbtk_call_command): Ditto. - (tk_command_loop): Ditto. - (gdbtk_init): Ditto. - - * gdbtk.c (register_changed_p): Remove unused local variable "buf". - -Sat Jul 20 17:46:40 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.tcl (files_command): Reorder the binding tags for - the listbox widget to avoid referencing the listbox after - the containing widget has been destroyed by the action of - a previous binding. - -Sat Jul 20 10:09:28 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.tcl (delete_expr): Unset corresponding element of - expr_update_list when destroying an expression. - (create_expr_window): Initialize expr_num, delete_expr_num, - and expr_update_list here when each new expression window - is created, rather than once at startup. - -Mon Jul 15 16:44:05 1996 Stu Grossman (grossman@critters.cygnus.com) - - * gdbtk.c (gdb_disassemble): Setup di.mach from - tm_print_insn_info.mach, and set endian from TARGET_BYTE_ORDER. - -Fri Jun 21 11:04:47 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.tcl (create_register_windows): Include missing '$'s. - Add global declarations for various reg_format_* variables. - * gdbtk.tcl (populate_register_window): Make initial window one - line taller to account for new column header line. - -Fri Jun 21 09:46:47 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.c (get_register): Support for printing raw formats. - * gdbtk.tcl: Add hint for using debug_interface. - (center_window, add_breakpoint_frame, delete_breakpoint_frame): - Enclose arg in braces for consistency. - (create_registers_window, populate_reg_window, update_registers): - Major rewrite to support displaying multiple formats in the register - window. - (init_reg_info): New function. - (recompute_reg_display_list): Reset reg_display_list, start - register display lines at line 2. - -Thu Jun 20 08:18:59 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.tcl (gdbtk_tcl_readline_begin): Handle backspace to - avoid backing up over prompt. At every input, make sure insert - point is at least after command start, handle control-u to delete - current input line. - (tclsh): Handle backspace to avoid backing up over prompt. Handle - control-u to delete current input line. - -Wed Jun 19 17:23:38 1996 Geoffrey Noer <noer@cygnus.com> - - * configure.in: disable gdbtk for *cygwin32* hosted compiles - * configure: regenerated with autoconf 2.8 - -Sun May 19 16:49:37 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.c (gdbtk_readline_begin, gdbtk_readline, gdbtk_readline_end): - New functions. - (tk_command_loop): Set instream to NULL to enable Tk user interaction. - (gdbtk_init): Set readline_begin_hook, readline_hook, - and readline_end_hook. - * gdbtk.tcl (gdbtk_tcl_readline_begin, gdbtk_tcl_readline, - gdbtk_tcl_readline_end): New functions. - (tclsh): Pack scroll bar on right side of window, not left. - -Fri May 17 13:54:34 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.tcl (create_command_window): Change a misspelled "get" - to the intended "cget". - (delete_line): Fix so it deletes the current line at the - insertion cursor. - -Thu May 16 19:20:29 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.tcl (gdb_prompt): Set this early on. - (create_command_window): Use gdb_prompt rather than "(gdb) ". - (gdbtk_tcl_preloop): Proc executed just prior to Tk main loop. - (tclsh): If an evaluation window already exists, just bring it - to the front instead of trying to create another. - * gdbtk.c (tk_command_loop): New function. - (gdbtk_init): Call tk_command_loop rather than Tk_MainLoop. - -Thu May 16 16:16:35 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.tcl (evaluate_tcl_command, tclsh): New functions that - implement a tcl evaluation window for gdbtk maintainers to use. - -Thu May 16 11:42:58 1996 Tom Tromey <tromey@creche.cygnus.com> - - * gdbtk.tcl (files_command): Correctly insert list of files into - listbox widget. - - * gdbtk.tcl (files_command): listbox command no longer accepts - -geometry. - -Wed May 15 16:04:09 1996 Stan Shebs <shebs@andros.cygnus.com> - - * gdbtk.tcl (create_command_window): If command window's buffer - is disabled, don't execute any of the key bindings. - -Mon May 13 13:43:25 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.c (tk_command): Catch case where no argument is given - since this will cause the tcl interpreter to dump core. - -Wed May 8 20:33:24 1996 Fred Fish <fnf@cygnus.com> - - * gdbtk.c: Fix a couple of misspellings. - -Thu May 2 19:17:49 1996 Stan Shebs <shebs@andros.cygnus.com> - - * gdbtk.tcl (debug_interface): New global, use to aid debugging. - (insert_breakpoint_tag, delete_breakpoint_tag): Fix range. - (file_popup_menu): Delete, never used. - (listing_window_popup): Rename from listing_window_button_1, - remove breakpoint toggling code. - (toggle_breakpoint): New procedure. - (create_file_win): Bind popup menu to button 2, toggle breakpoints - with button 1 in breakpoint area, add display of tagged areas if - debugging on. - -Fri Apr 5 13:44:40 1996 Stan Shebs <shebs@andros.cygnus.com> - - * gdbtk.c (running_now): New global variable. - (gdb_cmd): Test it before executing any command. - (gdbtk_call_command): Set it when inferior is running. - * gdbtk.tcl (gdbtk_tcl_busy, gdbtk_tcl_idle): Enable and - disable interaction with command window's text appropriately. - -Fri Apr 5 13:25:42 1996 Michael Meissner <meissner@tiktok.cygnus.com> - - * gdbtk.c (SIOCSPGRP, linux): If on Linux, undef SIOCSPGRP, since - some versions of the kernel don't support it. - -Tue Feb 6 16:31:25 1996 Tom Tromey <tromey@creche.cygnus.com> - - * gdbtk.tcl (create_file_win): Eliminate text widget B1 binding so - double-clicking will work again. - (create_asm_win): Put "break" at end of all B1 bindings. - (create_file_win): Lower "sel" tag, don't raise it. - (ensure_line_visible): New proc. - (update_listing, update_assembly): Use it. - (create_copyright_window): Destroy window on Leave event. - (create_command_window): Put "break" at end of all B2 bindings. - -Wed Jan 24 15:28:41 1996 Tom Tromey <tromey@creche.cygnus.com> - - * gdbtk.tcl, gdbtk.c: Updated copyrights. - - * configure.in: Look for -ldl or -ldld when using Tcl 7.5 or - greater. - * configure: Rebuilt. - -Tue Jan 23 09:00:48 1996 Doug Evans <dje@charmed.cygnus.com> - - * gdbtk.c (gdb_disassemble): Pass fprintf_unfiltered to - INIT_DISASSEMBLE_INFO. - -Mon Jan 15 09:58:41 1996 Tom Tromey <tromey@creche.cygnus.com> - - * gdbtk.tcl (create_expr_window): Many changes to update GUI. - (add_expr): Changes from create_expr_window. - (create_command_window): Set focus. - (delete_expr): Rewrote. - (expr_update_button): New proc. - (add_expr): Put bindings on FocusIn, FocusOut. - Don't allow .file_popup to be torn off. - -Fri Jan 12 09:36:17 1996 Tom Tromey <tromey@creche.cygnus.com> - - * gdbtk.tcl (gdbtk_tcl_query): Swap Yes and No buttons. - (update_listing): Use lassign. Use "see" to scroll. Don't need - screen_top, screen_bot, screen_height. - (update_assembly): Use "see" to scroll. - (textscrollproc): Removed. - (create_file_win): Don't use textscrollproc. - (asmscrollproc): Removed. - (create_asm_window): Don't use asmscrollproc. - (create_asm_win): Ditto. - (screen_height, screen_top, screen_bot): Removed. - (run_editor): New proc. - (build_framework): Use it. - (create_file_win, create_source_window): Don't use textscrollproc. - (create_breakpoints_window): Set -xscrollcommand on canvas. - (not_implemented_yet): Default button is 0. - (delete_char): Don't use tk_textBackspace. - (create_command_window): Allow Tk bindings to fire after deleting - character. - (create_command_window): Make Delete delete left, not right. - -Thu Jan 11 10:08:14 1996 Tom Tromey <tromey@creche.cygnus.com> - - * gdbtk.tcl (FSBox): Don't use tk_listboxSingleSelect. - - Changes in sync with expect: - * configure.in (ENABLE_GDBTK): Use CY_AC_PATH_TCL and - CY_AC_PATH_TK. - * aclocal.m4: Replaced with version from expect. - * configure: Regenerated. - -Wed Jan 10 09:07:22 1996 Tom Tromey <tromey@creche.cygnus.com> - - * gdbtk.tcl (gdbtk_tcl_fputs, gdbtk_tcl_fputs_error, - gdbtk_tcl_flush): Use "see", not "yview". - (gdbtk_tcl_query): Use questhead bitmap. - various: Always wrap condition of 'if' in {...}. - (add_breakpoint_frame): Set -value on radiobuttons. - (lassign): New proc. - (add_breakpoint_frame): Use lassign, not series of assignments. - (decr): Made faster. - (interactive_cmd): Use "see", not "yview". - (not_implemented_yet): Use warning bitmap. - (update_expr): Don't allow $expr to be evalled by Tcl. - (create_expr_window): Don't use "focus". - (delete_char, delete_line): Define globally. - (delete_line, delete_char, create_command_window, update_autocmd, - build_framework, create_asm_win, create_file_win): Use "see", not - "yview". - (create_copyright_window, center_window, bind_widget_after_class): - New procs. - (FSBox,create_command_window, create_autocmd_window): Binding - changes for Tk4. - (textscrollproc): Define globally. - (build_framework): tk_menuBar no longer needed. Keys Prior, Next, - Home, End, Up, and Down are all defined by Tk. - (apply_filespec): Use error bitmap in dialog. - (files_command): Don't use tk_listboxSingleSelect. - (files_command): Don't use "uniq" to remove duplicates from a - list. - (update_assembly): Use lassign. - (create_asm_win): Removed redundant bindings. - (listing_window_button_1, file_popup_menu): Use tk_popup. - (ButtonRelease-1 binding): Just remove tag from window; rest - handled by Tk. - - * gdbtk.c (gdbtk_query): Use Tcl_Merge to provide quoting. - (call_wrapper): Use Tcl_Eval, not Tcl_VarEval. - (gdbtk_call_command): Ditto. - -Thu Jan 4 16:04:54 1996 Stu Grossman (grossman@cygnus.com) - - * configure configure.in: Make --enable-gdbtk be the default. - -Thu Dec 28 15:10:49 1995 Stan Shebs <shebs@andros.cygnus.com> - - * README.GDBTK: Polish introductory paragraph. - -Mon Oct 16 11:27:06 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c (gdb_disassemble): Use fprintf_unfiltered instead of - fprintf_filtered. - -Tue Oct 10 15:26:39 1995 Fred Fish <fnf@cygnus.com> - - * README.GDBTK: Updated for version 4.15. - -Sat Aug 19 17:20:22 1995 Michael Tiemann <tiemann@axon.cygnus.com> - - * gdbtk.tcl: ENABLE comes back as "1" or "0", not "enable" or - "disable". - Also, wire up the breakpoint window so that it can be demo'd. - -Tue Aug 1 11:44:53 1995 J.T. Conklin <jtc@rtl.cygnus.com> - - * gdbtk.c: Include "gdb_string.h" instead of <string.h>. - -Tue Jun 20 10:19:40 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c: Add functions Tcl_Malloc, Tcl_Realloc, and Tcl_Free. - - * gdbtk.tcl (add_breakpoint_frame): Add more fields. - * (create_file_win create_asm_win build_framework): Create null - bindings for meta keys to keep window from dropping down to - insertion point when meta is pressed by itself. New bindings: - Up/Down - Scroll up/down one line at a time - Next/Prior - Scroll up/down one page at a time - Home/End - Warp to current pc/end of file - * (build_framework): Turn on breakpoint menu. - * (create_command_window): Implement tab completion. Add binding - for ^C to stop target. - -Fri May 19 06:15:40 1995 Jim Kingdon <kingdon@deneb.cygnus.com> - - * gdbtk.c: Conditionalize use of stdarg rather than varargs on - ANSI_PROTOTYPES not __STDC__; it must match the definition of - PARAMS. - -Thu May 18 15:58:46 1995 J.T. Conklin <jtc@rtl.cygnus.com> - - * gdbtk.c (gdbtk_query): Use stdarg.h macros when compiling with - an ANSI compiler. - -Sat Apr 15 13:52:24 1995 Stan Shebs <shebs@andros.cygnus.com> - - * gdbtk.c (gdb_disassemble): Read from inferior if connected - to a VxWorks target. - -Fri Apr 14 10:18:20 1995 Stu Grossman (grossman@cygnus.com) - - * README.GDBTK: New file. Contains the obvious. - -Tue Apr 11 11:07:12 1995 Michael Meissner <meissner@tiktok.cygnus.com> - - * gdbtk.c (gdbtk_init): If SIOCSPGRP is not available, but - F_SETOWN is, use that. - -Thu Apr 6 17:00:46 1995 Michael Meissner <meissner@tiktok.cygnus.com> - - * Makefile.in (X11_INCLUDES): Define as empty. - (X11_CFLAGS): Define as including $(X11_INCLUDES). - (X11_LIB_SWITCHES): Define as empty. - (X11_LIBS): Define as -lX11. - - * configure.in (enable_gdbtk): If gdbtk, support the --x-includes - and --x-libraries switches, setting the X11_INCLUDES and - X11_LIB_SWITCHES respectively. Instead of using a hardcoded -lX11 - in ENABLE_CLIBS, use the X11_LIB_SWITCHES and X11_LIBS variables. - - * gdbtk.c (gdbtk_init): If SIOCSPGRP is not available, don't use - it. This means that the stop button doesn't work, but is better - than nothing. - -Wed Mar 29 17:09:29 1995 Stu Grossman (grossman@cygnus.com) - - * Makefile.in (gdbtk.o): Use X11_CFLAGS to provide alternate - locations (per-host) for X11 include files. - * config/pa/hppahpux.mh (XM_CLIBS): Add -L/usr/lib/X11R5 to force - the use of R5 libs. - (X11_CFLAGS): Add this to indicate the locs - of the R5 include files. - -Wed Mar 8 16:12:21 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c (gdb_get_breakpoint_info): Return error if breakpoint - type is not bp_breakpoint. - -Tue Feb 14 17:16:41 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c: Ditto. - * gdbtk.c: General cleanups, get rid of unused variables. Redo - handling of stdout/stderr to just return output as the result of - the tcl command that caused the output. Cleanup -Wall stuff. - * (breakpoint_notify): Now returns just action and breakpoint - number. - * (gdb_get_breakpoint_list): New routine. Does the obvious. - * (gdb_get_breakpoint_info): Mostly derived from the old - breakpoint_notify, but returns lots more info. - * (dsprintf_append_element): Helper routine, works like printf, - but appends a tcl element onto the specified DString. Good for - building up lists as return values. - * (gdbtk_enable/disable_breakpoint): Go away. Replaced with - gdbtk_modify_breakpoint. - * (*many routines*): Use new result protocol. - * (call_wrapper): Make sure that recursive calls don't trash results. - * gdbtk.tcl: New windows, autocmd, and breakpoints. - * (gdbtk_tcl_fputs): Don't use $current_output_win redirection - anymore. It's not needed (in fact, this routine may not be needed - anymore). - * (gdbtk_tcl_breakpoint): Change to reflect new breakpoint - notification protocol. - * (gdbtk_tcl_busy gdbtk_tcl_idle): Straighten out buttons, remove - catches. - * (interactive_cmd): Use this wrapper around button invocations - of many commands. This will catch errors and put the results into - the command window. It also updates all the other windows. - * Also, change reliefs of most things to sunken. This actually - looks better. - * (create_file_win): Fix margin binding to allow breakpoints to - work again. - * (create_asm_win): Use return value of gdb_disassemble instead - of implicit I/O to the command window. - * (create_command_window): Use new result protocol to get output - from commands. - -Sun Feb 5 20:32:44 1995 Jim Kingdon (kingdon@lioth.cygnus.com) - - * gdbtk.c (gdb_disassemble): Deference pointer to function before - calling it (pre-ANSI compilers generally require this). - -Fri Feb 3 11:19:20 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c (gdb_disassemble): Get rid of - dis_asm_read_memory_hook. We can now call the disassemblers - directly and have no need for this hook anymore. - -Mon Jan 30 17:34:24 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.tcl (create_file_win): Disable old popup menu for source - window. - -Wed Jan 25 18:23:46 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c (gdbtk_init): Prevent segfault when gdbtk.tcl can't be - found. - * gdbtk.tcl: Initialize expr_update_list() to prevent errors when - popping up expression window for the first time. - -Tue Jan 24 12:10:28 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.tcl (create_registers_window): Work around a radiobutton - widget bug to make Options|Natural button work. - - * gdbtk.c (gdb_disassemble): Fix problem with source+assembly and - g++ caused by out-of-order pc's. - * gdbtk.tcl (files_command): Remove duplicate file names. Also, - add scrollbar. - -Mon Jan 23 17:21:09 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.tcl: Take .gdbtkinit if it exists. Makes gdbtk match the - doc! - -Thu Jan 12 15:02:40 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c, gdbtk.tcl: Update/add copyright. - * gdbtk.tcl (build_framework): Several fixes for filespec widget, - including dismiss button, and better error handling. - * (create_command_win): Bind button 2 to retrieve selection. - -Wed Jan 11 17:06:55 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.tcl: Add button to control mixed source disassembly. - Use text widgets in expr window. The give me more control over - layout. - Add auto-updating of exprs in expression window. - Handle expressions out of scope a bit better. - Make selected window pop up to the top when invoked via the - menubar. - Make copyright message have raised relief. - - * gdbtk.c (gdbtk_init): Improve handling for errors in gdbtk.tcl - during startup. - -Thu Jan 5 17:38:29 1995 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c (finish_saving_output): Don't do anything if not saving - output. - * (breakpoint_notify): Don't send null filename to tcl. - * (gdb_eval): New tcl command to eval an expression. - * (gdb_disassemble): New tcl command to do disassembly. This - allows tcl code to choose between exec file and target memeory, - and can also do mixed source and assembly. - * (gdbtk_init): Move reading of gdbtk.tcl to the end to make sure - that more of the environment is set up. Also, create link between - gdb and tcl vars disassemble{-_}from{-_}exec. - - * gdbtk.tcl: New expression window support. - * Make assembly window be 80 columns wide. - * Use new disassembly method. Add menu items to select - disassembly from exec file or target. - * Change View menubar item to Options. - - * Get rid of Stack, Breakpoints, Signals, and Variables Windows, - since they don't exist yet. - - * Pop up a copyright window on startup. - -Wed Jan 4 19:49:10 1995 Stan Shebs <shebs@andros.cygnus.com> - - * gdbtk.tcl (build_framework): Add standard commands menu, more - windows to standard windows menu. - (not_implemented_yet): Clarify message. - -Fri Dec 30 15:49:00 1994 Stan Shebs <shebs@andros.cygnus.com> - - * gdbtk.tcl (FSBox): New proc, File Selection Box code from exmh. - (not_implemented_yet): New proc. - (build_framework): Add various file commands to file menu. - -Fri Dec 23 16:18:50 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c (gdbtk_wait gdbtk_init): Portability improvements for - SIGIO handling. - -Mon Dec 19 09:55:47 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.tcl (update_assembly): Force update to make sure that pc - is visible when creating new assembly windows. - -Sun Dec 18 23:31:20 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c (gdbtk_wait gdbtk_init): Use different method of - enabling I/O interrupts for SVR4 (streams). - * (start_saving_output save_output get_saved_output - finish_saving_output flush_holdbuf gdbtk_flush gdbtk_fputs - gdbtk_init): - Totally revamp to use TCLs dynamic string functions. Also, quote - all data passed back to TCL to prevent errors with unmatched - braces, odd characters, etc... This fixes several wierd problems - with outputting strings containing unmatched braces. - * (breakpoint_notify gdb_loc): Use long hex format to output - addresses of breakpoints and PCs. This fixes some Alpha problems. - * (breakpoint_notify): Add stream arg to call to gdbtk_fputs. - * (gdb_listfiles): Also, go through the symtabs when looking for - files. This makes xcoff work (sort of), but probably breaks - something else. - * (gdb_stop): Return TCL_OK instead of nothing. This fixes odd - TCL errors when hitting stop button. - * (tk_command): Don't pass interp->result on to Tcl_{Var}Eval, as - that will trash the result. strdup the result instead and pass - that on. Improve error handling as well. - - * gdbtk.tcl (gdbtk_tcl_flush): Use global def of - current_output_win. Makes flushing actually work! - * (asm_win_name create_asm_win update_assembly): Bunch of fixes - to make assembly windows stop flashing when loading a new file. - * (gdbtk_tcl_busy gdbtk_tcl_idle): Use catch to prevent gdb_cmd - errors from losing control. - * (create_source_window): Add source file selection to View menu. - * (create_command_window (<Key-Return> binding): Quote text fed - into gdb_cmd to prevent eval errors. - -Thu Dec 15 16:40:10 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c: Improve mechanism for capturing output values. - (full_filename): Remove. - (gdb_cmd call_wrapper gdbtk_init): Protect all calls from tcl land - with call_wrapper. This prevents longjmps (usually via error()) - from jumping out of tcl/tk and leaving things in an indeterminate - state. - (gdbtk_fputs): Differentiate stdout from stderr when passing text - into tcl land. - * gdbtk.tcl: New view option to disable line numbers. Put catch - around most uses of gdb_cmd. Add update button to reg config - window. Stop doing immediate updates when selecting registers. - Change register view values into checkbuttons. - -Mon Dec 12 16:59:29 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.tcl (reg_config_menu create_registers_window - recompute_reg_display_list): Use array instead of individual vars - for register display list. - * (recompute_reg_display_list update_registers): Fix bug with not - displaying all registers. - -Mon Dec 12 12:22:21 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c: New tcl commands: gdb_fetch_registers, - gdb_changed_register_list, and gdb_regnames. - * gdbtk.tcl: Use monochrome color model for now. - * (delete_breakpoint_tag create_file_win): Add breakdot support. - * (create_file_win create_asm_win update_listing build_framework - create_source_window create_command_window): Re-org window - creation to give all windows consistent look and feel. - * (update_listing update_asm): Change pc pointer to '->'. - * (registers_command reg_config_menu create_registers_window - populate_reg_window update_registers): Revamp register window. - Allow selection of registers to be displayed. Highlight changed - registers. - -Mon Nov 28 09:17:20 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.tcl (build_framework): Fix bug with setting window titles. - - * gdbtk.tcl (build_framework): Add "Report bug" to help menu. - - * gdbtk.tcl: Re-arrange windows using new, consistent layout. Clean - up lots of code and centralize framework initialization. - -Wed Nov 16 15:28:29 1994 Rob Savoye (rob@cygnus.com) - - * Makefile.in: Fix the test for installing gdbtk. - -Mon Nov 14 08:51:29 1994 Stu Grossman (grossman@cygnus.com) - - * Makefile.in: Install gdbtk.tcl. - * configure.in: Add ENABLE_GDBTK flag. - * gdbtk.c (gdb_sourcelines): Returns list of source lines - containing code. (gdb_regnames): Returns list of register names. - -Thu Nov 3 14:25:24 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c (gdb_stop): Switch to target_stop(). - -Tue Nov 1 16:41:12 1994 Stu Grossman (grossman@cygnus.com) - - * Makefile.in: Use $(objdir)/tcl and $(objdir)/tk if they are - available. - * configure.in (ENABLE_CLIBS): Use $(TCL) and $(TK) instead of - -ltcl and -ltk. - * gdbtk.c: Get rid of lots of unnecessary #includes. - * (gdbtk_init): Use ConnectionNumber macro instead of referencing - Display structure directly. - * gdbtk.tcl: Change exit button to quit button. - -Wed Oct 26 15:41:07 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c: Change sense and name of no_windows variable. Now - called use_windows, and defaults to off (for compatibility). - -Thu Oct 20 17:35:45 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c (gdb_cmd): Force GUI into idle mode when errors occur. - * (gdb_stop): New tcl command to stop the target process. - * (x_event, gdbtk_wait): Allow GUI to interrupt gdb out of target - waits. - * (gdbtk_call_command): Wrapper around command processing to - alert GUI of target state changes. - * (gdbtk_init): Get the fd of X server for doing async - notification of X events (via x_event). Setup new hooks. - * gdbtk.tcl: Add scrollbars to assembly and command windows. - * Change window foreground & background colors. - * Create margin tag for breakpoints in source and assembly windows. - * Add new routines to be invoked when target state changes to/from - idle. - * Add start of expression window. - * Change bindings of mouse button 1 in assembly and source window - to just set or clear breakpoints when in the margin tag. - * Change shape of register window to be more vertical to better - reflect its contents. - * Add stop button. - * Cleanup some code around command window bindings. - -Sat Sep 17 17:05:14 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.tcl: Let ^U delete lines in the command window. - -Fri Sep 16 15:40:34 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c: Replace calls to full_filename with symtab_to_filename. - * gdbtk.tcl: New routine pc_to_line replaces in line code. New - routine decr replaces in line code. - * (create_file_win): Use catch to handle open failures more - elegantly. Also, create special window to display file open - failure message. Move opening of file prior to creation of text - widget. - * (create_asm_win): Add PC as argument. We now base disassembly - on PC instead of function name, since function names can be - ambiguous (usually seen with shared libs). Also, use catch to - simplify code where we don't care about failures. - -Wed Sep 14 00:55:26 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.tcl: Add ref counts to breakpoint tags. - * Put quotes around function name in disassemble command to better - handle assembler names containing `.'. - * Make pclist element 0 be filler to avoid off-by-one problem with - line numbers. - * Set names of top-level windows. - * Add register display window. - * Add PC to label of assembly window. - -Tue Sep 13 08:59:04 1994 Stu Grossman (grossman@cygnus.com) - - * gdbtk.c (gdbtk_flush gdbtk_fputs): Buffer up output to make - disassembly more efficient. - * (breakpoint_notify): Include pc in gdbtk_tcl_breakpoint - callback. - * (gdb_loc): Include pc in return value. Also, return function - name if arg was specified. - * (gdb_cmd_stub): Call gdb_flush to drain internal GDB buffers - after command completes. - * (gdbtk_init): Improve error handling. - - * gdbtk.tcl: Add lots of comments. Clean up code. - * (gdbtk_tcl_fputs): Make output window redirectable. - * Add assembly window, and breapoint support. - * Make button 1 in margin toggle breakpoints. - * Use stippling to indicate breakpoint disabling. - -Fri Sep 2 19:11:40 1994 Stu Grossman (grossman@cygnus.com) - - * configure.in: Don't symlink to gdbtk.tcl if it's already there. - -Thu Jul 28 14:37:36 1994 Stu Grossman (grossman@cygnus.com) - - Support for TK GUI. - * Makefile.in: Add rule for gdbtk.o. - * configure.in: Add support for --enable-gdbtk. - * gdbtk.c: New file. Contains support routines for TK interface. - * gdbtk.tcl: New file. Implements GUI policy. - - -Local Variables: -mode: change-log -left-margin: 8 -fill-column: 74 -version-control: never -End: diff --git a/gdb/gdbtk/generic/ChangeLog-2000 b/gdb/gdbtk/generic/ChangeLog-2000 deleted file mode 100644 index 51993bdee1a..00000000000 --- a/gdb/gdbtk/generic/ChangeLog-2000 +++ /dev/null @@ -1,211 +0,0 @@ -2000-11-29 Tom Tromey <tromey@cygnus.com> - - * gdbtk-cmds.c (Gdbtk_Init): Create gdb_current_directory, - gdb_inferior_args, and gdb_source_path variables. - -2000-11-29 Tom Tromey <tromey@cygnus.com> - - * gdbtk-cmds.c (call_wrapper): Don't reset result if wrapped - command returned error. - -2000-11-28 Tom Tromey <tromey@cygnus.com> - - * gdbtk-cmds.c (gdb_clear_file): Use Tcl_WrongNumArgs. - (gdb_confirm_quit): Likewise. - (gdb_force_quit): Likewise. - (gdb_eval): Likewise. - (gdb_immediate_command): Likewise. - (gdb_get_vars_command): Likewise. - (gdb_get_line_command): Likewise. - (gdb_get_file_command): Likewise. - (gdb_get_function_command): Likewise. - (gdb_cmd): Likewise. Also, don't allow more than 2 arguments. - (gdb_listfiles): Corrected usage of Tcl_WrongNumArgs. - (gdb_listfuncs): Use Tcl_WrongNumArgs. Return error. - (gdb_fetch_registers): Likewise. - (gdb_tracepoint_exists_command): Use Tcl_WrongNumArgs. - (gdb_get_tracepoint_info): Likewise. - (gdb_get_trace_frame_num): Likewise. - (gdb_actions_command): Likewise. - (gdb_disassemble): Likewise. Also, return error. - (gdb_get_breakpoint_list): Likewise. - (gdb_path_conv): Likewise. - (gdb_load_disassembly): Use Tcl_WrongNumArgs. - (gdb_loc): Likewise. - (gdb_set_bp): Likewise. - (gdb_set_bp_addr): Likewise. - (gdb_get_breakpoint_info): Likewise. - -2000-10-23 Fernando Nasser <fnasser@redhat.com> - - From 2000-10-19 Steven Johnson <sbjohnson@ozemail.com.au> - Note: The original patch used asprintf/vasprintf. I changed it to - use the new xasprintf/xvasprintf gdb functions. - * gdbtk.c (TclDebug, gdbtk_init): Replaced the vast majority of - sprintf/vsprintf calls with asprintf and vasprintf respectively. - Should prevent any possible buffer overruns possible with - fixed size sprintf buffers. Specifically fixes a problem with long - filenames and clearing breakpoints overflowing their buffers when - using sprintf, causing a segfault. Generically should also prevent - any other similar problems from occuring. - * gdbtk-cmds.c (sprintf_append_element_to_obj, get_pc_register, - gdb_get_tracepoint_info, gdb_load_disassembly, gdbtk_load_source, - gdbtk_load_asm, gdb_set_bp, gdb_set_bp_addr, gdb_get_breakpoint_info, - gdb_selected_frame, gdb_selected_block, gdb_get_blocks): Ditto. - * gdbtk-hooks.c (gdbtk_warning, gdbtk_ignorable_warning, - gdbtk_readline_begin, gdbtk_set_hook, breakpoint_notify, - gdbtk_query, tracepoint_notify, gdbtk_error_begin, - gdbtk_annotate_signal): Ditto. - -2000-10-23 Fernando Nasser <fnasser@totem.to.cygnus.com> - - * gdbtk-hooks.c (x_event): Only process events if the target is - running. - -2000-10-23 Fernando Nasser <fnasser@totem.to.cygnus.com> - - * gdbtk-variable.c: Removed. Obsolete file. - -2000-10-13 Fernando Nasser <fnasser@totem.to.cygnus.com> - - * gdbtk.c (target_is_native): The "multi-thread" target is native. - -2000-09-15 Fernando Nasser <fnasser@totem.to.cygnus.com> - - * gdbtk-varobj.c (variable_value): Send back the error text issued - by gdb so it can be displayed in a pop-up box. - -2000-07-25 Elena Zannoni <ezannoni@kwikemart.cygnus.com> - - * gdbtk-cmds.c (map_arg_registers): Set numregs to include the - pseudo regs as well. - -2000-07-10 Kevin Buettner <kevinb@redhat.com> - - * gdbtk-cmds.c, gdbtk-hooks.c, gdbtk-variable.c: Eliminate use - of PARAMS in function pointer declarations. - -2000-07-02 Kevin Buettner <kevinb@redhat.com> - - * gdbtk-cmds.c, gdbtk-hooks.c, gdbtk-variable.c, - gdbtk-varobj.c, gdbtk-wrapper.c, gdbtk-wrapper.h, gdbtk.c, - gdbtk.h: Eliminate use of PARAMS from declarations in these - files. - -2000-06-08 Fernando Nasser <fnasser@cygnus.com> - - * gdbtk-cmds.c (get_register): Allow editing of typed registers if - the type is a union with the first tag equal to the register name. - -Thu Jun 8 17:59:01 2000 Andrew Cagney <cagney@b1.cygnus.com> - - (gdb_load_info): Use make_cleanup_bfd_close. - (gdb_search): Use make_cleanup_free_search_symbols. - * gdbtk.c (cleanup_init): Change signature to match make_cleanups. - (gdbtk_init): Discard make_cleanup_func cast. - * gdbtk-cmds.c (gdb_eval): Ditto. - -2000-06-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com> - - * gdbtk.c: Remove CYGWIN32 conditional around timer machinery. - Cygwin can handle timers fine now. - -2000-04-17 Jonathan Larmour <jlarmour@redhat.co.uk> - - * ChangeLog-gdbtk: Renamed to ChangeLog - * ChangeLog: New file - * gdbtk-cmds.c, gdbtk-hooks.c, gdbtk-variable.c, gdbtk-varobj.c, - gdbtk-wrapper.h, gdbtk-wrapper.c, gdbtk.h, gdbtk.c: No need for - changelog-default-name hint for Emacs now - -2000-04-14 Jonathan Larmour <jlarmour@redhat.co.uk> - - * gdbtk.c (gdbtk_init): For now, reset gdb_stdtarg to gdb_stdout - when using gdbtk. - -2000-04-01 Jim Blandy <jimb@redhat.com> - - * gdbtk-hooks.c (gdbtk_restore_result_ptr): New function. - * gdbtk.h (gdbtk_restore_result_ptr): Declare it. - * gdbtk-cmds.c (gdbtk_load_asm): Use it to restore the old value - of result_ptr, in case we get errors while disassembling things. - -2000-03-28 Jim Blandy <jimb@redhat.com> - - Handle the fact that there are holes in the register numbering. - * gdbtk-cmds.c (gdb_regnames): If given the -numbers option, - return the register numbers along with their names. - (get_register_name): Record both the register name and number, if - requested. - -2000-03-13 James Ingham <jingham@leda.cygnus.com> - - * gdbtk-varobj.c (variable_create): Pass the correct - "how_specified" flag to the varobj_create routine. - -2000-02-29 James Ingham <jingham@leda.cygnus.com> - - * gdbtk-cmds.c (gdb_disassemble_driver): The to_shortname for - Linux is "linuxthreads", not "linux-threads", so we have to change - the heuristic to account for this. This fixes a crash when trying - to disassemble from shared libraries. - -2000-02-23 Keith R Seitz <kseitz@nwlink.com> - - * gdbtk-wrapper.h: Add declarations for GDB_get_prev_frame, GDB_get_next_frame, - GDB_find_relative_frame, GDB_get_current_frame. - * gdbtk-wrapper.c (GDB_get_prev_frame, wrap_get_prev_frame): New functions. - (GDB_get_next_frame, wrap_get_next_frame): New functions. - (GDB_find_relative_frame, wrap_find_relative_frame): New functions. - (GDB_get_current_frame, wrap_get_current_frame): New functions. - - * gdbtk-hooks.c (gdbtk_add_hooks): Use "specify_exec_file_hook" so - that our hook is added to the list of hooks run instead of overwriting - all other hooks. - - * gdbtk-cmds.c (gdb_stack): Wrap all calls to internal functions and - deal with errors more gracefully. - -Wed Feb 23 13:01:36 2000 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk-cmds.c (gdbtk_dis_asm_read_memory): Change LEN to unsigned - long. Match ../include/dis-asm.h change. - -Fri Feb 4 23:19:03 2000 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk.c (gdbtk_init): Update default path to tcl code - now - gdbtk/library. - -Fri Feb 4 23:19:03 2000 Andrew Cagney <cagney@b1.cygnus.com> - - * ChangeLog-gdbtk, gdbtk-cmds.c, gdbtk-hooks.c, gdbtk-variable.c, - gdbtk-varobj.c, gdbtk-wrapper.c, gdbtk-wrapper.h, gdbtk.c, - gdbtk.h: Moved here from the top level GDB directory. - -Tue Feb 1 00:17:12 2000 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk-hooks.c, gdbtk-variable.c, gdbtk-wrapper.c, - gdbtk-wrapper.h, gdbtk.h: Update to reflect rename of gdb-file / - GDB_FILE to ui-file / ``struct ui_file''. - -2000-01-31 Keith Seitz <kseitz@nwlink.com> - - * gdbtk-cmds.c (gdb_disassemble_driver) If using multi-arch, set the - architecture in the disassembly info. - -Mon Jan 31 18:32:06 2000 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk-variable.c, gdbtk-cmds.c, gdbtk.c: Include "tui/tui-file.h" - -Mon Jan 3 01:09:24 2000 Andrew Cagney <cagney@b1.cygnus.com> - - * gdbtk-cmds.c (gdb_get_mem): Use builtin_type_int32 et.al. to - force the word size to 32 bits. - - -Local Variables: -mode: change-log -left-margin: 8 -fill-column: 74 -version-control: never -End: diff --git a/gdb/gdbtk/generic/gdbtk-bp.c b/gdb/gdbtk/generic/gdbtk-bp.c deleted file mode 100644 index 9c46a4cc735..00000000000 --- a/gdb/gdbtk/generic/gdbtk-bp.c +++ /dev/null @@ -1,994 +0,0 @@ -/* Tcl/Tk command definitions for Insight - Breakpoints. - Copyright 2001, 2002 Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - -#include "defs.h" -#include "symtab.h" -#include "symfile.h" -#include "linespec.h" -#include "breakpoint.h" -#include "tracepoint.h" -#include "gdb_string.h" -#include <tcl.h> -#include "gdbtk.h" -#include "gdbtk-cmds.h" - -/* From breakpoint.c */ -extern struct breakpoint *breakpoint_chain; - -/* From gdbtk-hooks.c */ -extern void report_error (void); - -/* These two lookup tables are used to translate the type & disposition fields - of the breakpoint structure (respectively) into something gdbtk understands. - They are also used in gdbtk-hooks.c */ - -char *bptypes[] = - {"none", "breakpoint", "hw breakpoint", "until", - "finish", "watchpoint", "hw watchpoint", - "read watchpoint", "acc watchpoint", - "longjmp", "longjmp resume", "step resume", - "sigtramp", "watchpoint scope", - "call dummy", "shlib events", "catch load", - "catch unload", "catch fork", "catch vfork", - "catch exec", "catch catch", "catch throw" - }; -char *bpdisp[] = - {"delete", "delstop", "disable", "donttouch"}; - -/* Is this breakpoint interesting to a user interface? */ -#define BREAKPOINT_IS_INTERESTING(bp) \ -((bp)->type == bp_breakpoint \ - || (bp)->type == bp_hardware_breakpoint \ - || (bp)->type == bp_watchpoint \ - || (bp)->type == bp_hardware_watchpoint \ - || (bp)->type == bp_read_watchpoint \ - || (bp)->type == bp_access_watchpoint) - -/* Is this breakpoint a watchpoint? */ -#define BREAKPOINT_IS_WATCHPOINT(bp) \ -((bp)->type == bp_watchpoint \ - || (bp)->type == bp_hardware_watchpoint \ - || (bp)->type == bp_read_watchpoint \ - || (bp)->type == bp_access_watchpoint) - -/* - * These are routines we need from breakpoint.c. - * at some point make these static in breakpoint.c and move GUI code there - */ - -extern struct breakpoint *set_raw_breakpoint (struct symtab_and_line sal, - enum bptype bp_type); -extern void set_breakpoint_count (int); -extern int breakpoint_count; - -/* Breakpoint/Tracepoint lists. Unfortunately, gdb forces us to - keep a list of breakpoints, too. Why couldn't it be done like - treacepoints? */ -#define DEFAULT_LIST_SIZE 32 -static struct breakpoint **breakpoint_list; -static int breakpoint_list_size = DEFAULT_LIST_SIZE; - -/* - * Forward declarations - */ - -/* Breakpoint-related functions */ -static int gdb_find_bp_at_addr (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST objv[]); -static int gdb_find_bp_at_line (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST objv[]); -static int gdb_get_breakpoint_info (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST[]); -static int gdb_get_breakpoint_list (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST[]); -static int gdb_set_bp (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST objv[]); -static int gdb_set_bp_addr (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST objv[]); - -/* Tracepoint-related functions */ -static int gdb_actions_command (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST objv[]); -static int gdb_get_trace_frame_num (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST objv[]); -static int gdb_get_tracepoint_info (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST objv[]); -static int gdb_get_tracepoint_list (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST objv[]); -static int gdb_trace_status (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST[]); -static int gdb_tracepoint_exists_command (ClientData, Tcl_Interp *, - int, Tcl_Obj * CONST objv[]); -static Tcl_Obj *get_breakpoint_commands (struct command_line *cmd); - -static int tracepoint_exists (char *args); - -/* Breakpoint/tracepoint events and related functions */ - -void gdbtk_create_breakpoint (int); -void gdbtk_delete_breakpoint (int); -void gdbtk_modify_breakpoint (int); -void gdbtk_create_tracepoint (int); -void gdbtk_delete_tracepoint (int); -void gdbtk_modify_tracepoint (int); -static void breakpoint_notify (int, const char *); -static void tracepoint_notify (int, const char *); - -int -Gdbtk_Breakpoint_Init (Tcl_Interp *interp) -{ - /* Breakpoint commands */ - Tcl_CreateObjCommand (interp, "gdb_find_bp_at_addr", gdbtk_call_wrapper, - gdb_find_bp_at_addr, NULL); - Tcl_CreateObjCommand (interp, "gdb_find_bp_at_line", gdbtk_call_wrapper, - gdb_find_bp_at_line, NULL); - Tcl_CreateObjCommand (interp, "gdb_get_breakpoint_info", gdbtk_call_wrapper, - gdb_get_breakpoint_info, NULL); - Tcl_CreateObjCommand (interp, "gdb_get_breakpoint_list", gdbtk_call_wrapper, - gdb_get_breakpoint_list, NULL); - Tcl_CreateObjCommand (interp, "gdb_set_bp", gdbtk_call_wrapper, gdb_set_bp, NULL); - Tcl_CreateObjCommand (interp, "gdb_set_bp_addr", gdbtk_call_wrapper, - gdb_set_bp_addr, NULL); - - /* Tracepoint commands */ - Tcl_CreateObjCommand (interp, "gdb_actions", - gdbtk_call_wrapper, gdb_actions_command, NULL); - Tcl_CreateObjCommand (interp, "gdb_get_trace_frame_num", - gdbtk_call_wrapper, gdb_get_trace_frame_num, NULL); - Tcl_CreateObjCommand (interp, "gdb_get_tracepoint_info", - gdbtk_call_wrapper, gdb_get_tracepoint_info, NULL); - Tcl_CreateObjCommand (interp, "gdb_get_tracepoint_list", - gdbtk_call_wrapper, gdb_get_tracepoint_list, NULL); - Tcl_CreateObjCommand (interp, "gdb_is_tracing", - gdbtk_call_wrapper, gdb_trace_status, NULL); - Tcl_CreateObjCommand (interp, "gdb_tracepoint_exists", - gdbtk_call_wrapper, gdb_tracepoint_exists_command, NULL); - - /* Initialize our tables of BPs. */ - breakpoint_list = (struct breakpoint **) xmalloc (breakpoint_list_size * sizeof (struct breakpoint *)); - memset (breakpoint_list, 0, breakpoint_list_size * sizeof (struct breakpoint *)); - - return TCL_OK; -} - -/* - * This section contains commands for manipulation of breakpoints. - */ - -/* set a breakpoint by source file and line number - flags are as follows: - least significant 2 bits are disposition, rest is - type (normally 0). - - enum bptype { - bp_breakpoint, Normal breakpoint - bp_hardware_breakpoint, Hardware assisted breakpoint - } - - Disposition of breakpoint. Ie: what to do after hitting it. - enum bpdisp { - del, Delete it - del_at_next_stop, Delete at next stop, whether hit or not - disable, Disable it - donttouch Leave it alone - }; -*/ - - -/* This implements the tcl command "gdb_find_bp_at_addr" - -* Tcl Arguments: -* addr: CORE_ADDR -* Tcl Result: -* It returns a list of breakpoint numbers -*/ -static int -gdb_find_bp_at_addr (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - int i; - CORE_ADDR addr; - Tcl_WideInt waddr; - - if (objc != 2) - { - Tcl_WrongNumArgs (interp, 1, objv, "address"); - return TCL_ERROR; - } - - if (Tcl_GetWideIntFromObj (interp, objv[1], &waddr) != TCL_OK) - return TCL_ERROR; - addr = waddr; - - Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL); - for (i = 0; i < breakpoint_list_size; i++) - { - if (breakpoint_list[i] != NULL - && breakpoint_list[i]->loc->address == addr) - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewIntObj (i)); - } - - return TCL_OK; -} - -/* This implements the tcl command "gdb_find_bp_at_line" - -* Tcl Arguments: -* filename: the file in which to find the breakpoint -* line: the line number for the breakpoint -* Tcl Result: -* It returns a list of breakpoint numbers -*/ -static int -gdb_find_bp_at_line (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) - -{ - struct symtab *s; - int i, line; - - if (objc != 3) - { - Tcl_WrongNumArgs (interp, 1, objv, "filename line"); - return TCL_ERROR; - } - - s = lookup_symtab (Tcl_GetStringFromObj (objv[1], NULL)); - if (s == NULL) - return TCL_ERROR; - - if (Tcl_GetIntFromObj (interp, objv[2], &line) == TCL_ERROR) - { - result_ptr->flags = GDBTK_IN_TCL_RESULT; - return TCL_ERROR; - } - - Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL); - for (i = 0; i < breakpoint_list_size; i++) - if (breakpoint_list[i] != NULL - && breakpoint_list[i]->line_number == line - && !strcmp (breakpoint_list[i]->source_file, s->filename)) - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewIntObj (i)); - - return TCL_OK; -} - -/* This implements the tcl command gdb_get_breakpoint_info - * - * Tcl Arguments: - * breakpoint_number - * Tcl Result: - * A list with {file, function, line_number, address, type, enabled?, - * disposition, ignore_count, {list_of_commands}, - * condition, thread, hit_count user_specification} - */ -static int -gdb_get_breakpoint_info (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) -{ - struct symtab_and_line sal; - int bpnum; - struct breakpoint *b; - char *funcname, *filename; - - Tcl_Obj *new_obj; - - if (objc != 2) - { - Tcl_WrongNumArgs (interp, 1, objv, "breakpoint"); - return TCL_ERROR; - } - - if (Tcl_GetIntFromObj (NULL, objv[1], &bpnum) != TCL_OK) - { - result_ptr->flags = GDBTK_IN_TCL_RESULT; - return TCL_ERROR; - } - - b = (bpnum <= breakpoint_list_size ? breakpoint_list[bpnum] : NULL); - if (!b || b->type != bp_breakpoint) - { - gdbtk_set_result (interp, "Breakpoint #%d does not exist.", bpnum); - return TCL_ERROR; - } - - sal = find_pc_line (b->loc->address, 0); - - filename = symtab_to_filename (sal.symtab); - if (filename == NULL) - filename = ""; - - Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL); - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewStringObj (filename, -1)); - - funcname = pc_function_name (b->loc->address); - new_obj = Tcl_NewStringObj (funcname, -1); - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, new_obj); - - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewIntObj (b->line_number)); - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewStringObj (core_addr_to_string - (b->loc->address), - -1)); - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewStringObj (bptypes[b->type], -1)); - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewBooleanObj (b->enable_state == bp_enabled)); - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewStringObj (bpdisp[b->disposition], -1)); - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewIntObj (b->ignore_count)); - - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - get_breakpoint_commands (b->commands)); - - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewStringObj (b->cond_string, -1)); - - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewIntObj (b->thread)); - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewIntObj (b->hit_count)); - - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewStringObj (BREAKPOINT_IS_WATCHPOINT (b) - ? b->exp_string - : b->addr_string, -1)); - - return TCL_OK; -} - -/* Helper function for gdb_get_breakpoint_info, this function is - responsible for figuring out what to type at the "commands" command - in gdb's cli in order to get at the same command list passed here. */ - -static Tcl_Obj * -get_breakpoint_commands (struct command_line *cmd) -{ - Tcl_Obj *obj, *tmp; - - obj = Tcl_NewObj (); - while (cmd != NULL) - { - switch (cmd->control_type) - { - case simple_control: - /* A simple command. Just append it. */ - Tcl_ListObjAppendElement (NULL, obj, - Tcl_NewStringObj (cmd->line, -1)); - break; - - case break_control: - /* A loop_break */ - Tcl_ListObjAppendElement (NULL, obj, - Tcl_NewStringObj ("loop_break", -1)); - break; - - case continue_control: - /* A loop_continue */ - Tcl_ListObjAppendElement (NULL, obj, - Tcl_NewStringObj ("loop_continue", -1)); - break; - - case while_control: - /* A while loop. Must append "end" to the end of it. */ - tmp = Tcl_NewStringObj ("while ", -1); - Tcl_AppendToObj (tmp, cmd->line, -1); - Tcl_ListObjAppendElement (NULL, obj, tmp); - Tcl_ListObjAppendList (NULL, obj, - get_breakpoint_commands (*cmd->body_list)); - Tcl_ListObjAppendElement (NULL, obj, - Tcl_NewStringObj ("end", -1)); - break; - - case if_control: - /* An if statement. cmd->body_list[0] is the true part, - cmd->body_list[1] contains the "else" (false) part. */ - tmp = Tcl_NewStringObj ("if ", -1); - Tcl_AppendToObj (tmp, cmd->line, -1); - Tcl_ListObjAppendElement (NULL, obj, tmp); - Tcl_ListObjAppendList (NULL, obj, - get_breakpoint_commands (cmd->body_list[0])); - if (cmd->body_count == 2) - { - Tcl_ListObjAppendElement (NULL, obj, - Tcl_NewStringObj ("else", -1)); - Tcl_ListObjAppendList (NULL, obj, - get_breakpoint_commands(cmd->body_list[1])); - } - Tcl_ListObjAppendElement (NULL, obj, - Tcl_NewStringObj ("end", -1)); - break; - - case invalid_control: - /* Something invalid. Just skip it. */ - break; - } - - cmd = cmd->next; - } - - return obj; -} - -/* This implements the tcl command gdb_get_breakpoint_list - * It builds up a list of the current breakpoints. - * - * Tcl Arguments: - * None. - * Tcl Result: - * A list of breakpoint numbers. - */ -static int -gdb_get_breakpoint_list (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - int i; - Tcl_Obj *new_obj; - - if (objc != 1) - { - Tcl_WrongNumArgs (interp, 1, objv, NULL); - return TCL_ERROR; - } - - for (i = 0; i < breakpoint_list_size; i++) - { - if (breakpoint_list[i] != NULL - && breakpoint_list[i]->type == bp_breakpoint) - { - new_obj = Tcl_NewIntObj (i); - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, new_obj); - } - } - - return TCL_OK; -} - -/* This implements the tcl command "gdb_set_bp" - * It sets breakpoints, and notifies the GUI. - * - * Tcl Arguments: - * filename: the file in which to set the breakpoint - * line: the line number for the breakpoint - * type: the type of the breakpoint - * thread: optional thread number - * Tcl Result: - * The return value of the call to gdbtk_tcl_breakpoint. - */ -static int -gdb_set_bp (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - struct symtab_and_line sal; - int line, thread = -1; - struct breakpoint *b; - char *buf, *typestr; - enum bpdisp disp; - - if (objc != 4 && objc != 5) - { - Tcl_WrongNumArgs (interp, 1, objv, "filename line type ?thread?"); - return TCL_ERROR; - } - - sal.symtab = lookup_symtab (Tcl_GetStringFromObj (objv[1], NULL)); - if (sal.symtab == NULL) - return TCL_ERROR; - - if (Tcl_GetIntFromObj (interp, objv[2], &line) == TCL_ERROR) - { - result_ptr->flags = GDBTK_IN_TCL_RESULT; - return TCL_ERROR; - } - - typestr = Tcl_GetStringFromObj (objv[3], NULL); - if (strncmp (typestr, "temp", 4) == 0) - disp = disp_del; - else if (strncmp (typestr, "normal", 6) == 0) - disp = disp_donttouch; - else - { - gdbtk_set_result (interp, "type must be \"temp\" or \"normal\""); - return TCL_ERROR; - } - - if (objc == 5) - { - if (Tcl_GetIntFromObj (interp, objv[4], &thread) == TCL_ERROR) - { - result_ptr->flags = GDBTK_IN_TCL_RESULT; - return TCL_ERROR; - } - } - - sal.line = line; - if (!find_line_pc (sal.symtab, sal.line, &sal.pc)) - return TCL_ERROR; - - sal.section = find_pc_overlay (sal.pc); - b = set_raw_breakpoint (sal, bp_breakpoint); - set_breakpoint_count (breakpoint_count + 1); - b->number = breakpoint_count; - b->disposition = disp; - b->thread = thread; - - /* FIXME: this won't work for duplicate basenames! */ - xasprintf (&buf, "%s:%d", basename (Tcl_GetStringFromObj (objv[1], NULL)), - line); - b->addr_string = xstrdup (buf); - free(buf); - - /* now send notification command back to GUI */ - breakpoint_create_event (b->number); - return TCL_OK; -} - -/* This implements the tcl command "gdb_set_bp_addr" - * It sets breakpoints, and notifies the GUI. - * - * Tcl Arguments: - * addr: the CORE_ADDR at which to set the breakpoint - * type: the type of the breakpoint - * thread: optional thread number - * Tcl Result: - * The return value of the call to gdbtk_tcl_breakpoint. - */ -static int -gdb_set_bp_addr (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) - -{ - struct symtab_and_line sal; - int thread = -1; - CORE_ADDR addr; - Tcl_WideInt waddr; - struct breakpoint *b; - char *saddr, *typestr; - enum bpdisp disp; - - if (objc != 3 && objc != 4) - { - Tcl_WrongNumArgs (interp, 1, objv, "address type ?thread?"); - return TCL_ERROR; - } - - if (Tcl_GetWideIntFromObj (interp, objv[1], &waddr) != TCL_OK) - return TCL_ERROR; - addr = waddr; - saddr = Tcl_GetStringFromObj (objv[1], NULL); - - typestr = Tcl_GetStringFromObj (objv[2], NULL); - if (strncmp (typestr, "temp", 4) == 0) - disp = disp_del; - else if (strncmp (typestr, "normal", 6) == 0) - disp = disp_donttouch; - else - { - gdbtk_set_result (interp, "type must be \"temp\" or \"normal\""); - return TCL_ERROR; - } - - if (objc == 4) - { - if (Tcl_GetIntFromObj (interp, objv[3], &thread) == TCL_ERROR) - { - result_ptr->flags = GDBTK_IN_TCL_RESULT; - return TCL_ERROR; - } - } - - sal = find_pc_line (addr, 0); - sal.pc = addr; - b = set_raw_breakpoint (sal, bp_breakpoint); - set_breakpoint_count (breakpoint_count + 1); - b->number = breakpoint_count; - b->disposition = disp; - b->thread = thread; - b->addr_string = xstrdup (saddr); - - /* now send notification command back to GUI */ - breakpoint_create_event (b->number); - return TCL_OK; -} - -/* - * This section contains functions that deal with breakpoint - * events from gdb. - */ - -/* The next three functions use breakpoint_notify to allow the GUI - * to handle creating, deleting and modifying breakpoints. These three - * functions are put into the appropriate gdb hooks in gdbtk_init. - */ - -void -gdbtk_create_breakpoint (int num) -{ - struct breakpoint *b; - for (b = breakpoint_chain; b != NULL; b = b->next) - { - if (b->number == num) - break; - } - - if (b == NULL || !BREAKPOINT_IS_INTERESTING (b)) - return; - - /* Check if there is room to store it */ - if (num >= breakpoint_list_size) - { - int oldsize = breakpoint_list_size; - while (num >= breakpoint_list_size) - breakpoint_list_size += DEFAULT_LIST_SIZE; - breakpoint_list = (struct breakpoint **) xrealloc (breakpoint_list, breakpoint_list_size * sizeof (struct breakpoint *)); - memset (&(breakpoint_list[oldsize]), 0, (breakpoint_list_size - oldsize) * sizeof (struct breakpoint *)); - } - - breakpoint_list[num] = b; - breakpoint_notify (num, "create"); -} - -void -gdbtk_delete_breakpoint (int num) -{ - if (num >= 0 - && num <= breakpoint_list_size - && breakpoint_list[num] != NULL) - { - breakpoint_notify (num, "delete"); - breakpoint_list[num] = NULL; - } -} - -void -gdbtk_modify_breakpoint (int num) -{ - if (num >= 0) - breakpoint_notify (num, "modify"); -} - -/* This is the generic function for handling changes in - * a breakpoint. It routes the information to the Tcl - * command "gdbtk_tcl_breakpoint" in the form: - * gdbtk_tcl_breakpoint action b_number b_address b_line b_file - * On error, the error string is written to gdb_stdout. - */ -static void -breakpoint_notify (int num, const char *action) -{ - char *buf; - - if (num > breakpoint_list_size - || num < 0 - || breakpoint_list[num] == NULL - /* FIXME: should not be so restrictive... */ - || breakpoint_list[num]->type != bp_breakpoint) - return; - - /* We ensure that ACTION contains no special Tcl characters, so we - can do this. */ - xasprintf (&buf, "gdbtk_tcl_breakpoint %s %d", action, num); - - if (Tcl_Eval (gdbtk_interp, buf) != TCL_OK) - report_error (); - free(buf); -} - -/* - * This section contains the commands that deal with tracepoints: - */ - -/* This implements the tcl command gdb_actions - * It sets actions for a given tracepoint. - * - * Tcl Arguments: - * number: the tracepoint in question - * actions: the actions to add to this tracepoint - * Tcl Result: - * None. - */ - -static int -gdb_actions_command (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - struct tracepoint *tp; - Tcl_Obj **actions; - int nactions, i, len; - char *number, *args, *action; - long step_count; - struct action_line *next = NULL, *temp; - enum actionline_type linetype; - - if (objc != 3) - { - Tcl_WrongNumArgs (interp, 1, objv, "number actions"); - return TCL_ERROR; - } - - args = number = Tcl_GetStringFromObj (objv[1], NULL); - tp = get_tracepoint_by_number (&args, 0, 0); - if (tp == NULL) - { - Tcl_AppendStringsToObj (result_ptr->obj_ptr, "Tracepoint \"", - number, "\" does not exist", NULL); - return TCL_ERROR; - } - - /* Free any existing actions */ - if (tp->actions != NULL) - free_actions (tp); - - step_count = 0; - - Tcl_ListObjGetElements (interp, objv[2], &nactions, &actions); - - /* Add the actions to the tracepoint */ - for (i = 0; i < nactions; i++) - { - temp = xmalloc (sizeof (struct action_line)); - temp->next = NULL; - action = Tcl_GetStringFromObj (actions[i], &len); - temp->action = savestring (action, len); - - linetype = validate_actionline (&(temp->action), tp); - - if (linetype == BADLINE) - { - free (temp); - continue; - } - - if (next == NULL) - { - tp->actions = temp; - next = temp; - } - else - { - next->next = temp; - next = temp; - } - } - - return TCL_OK; -} - -static int -gdb_get_trace_frame_num (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - if (objc != 1) - { - Tcl_WrongNumArgs (interp, 1, objv, "linespec"); - return TCL_ERROR; - } - - Tcl_SetIntObj (result_ptr->obj_ptr, get_traceframe_number ()); - return TCL_OK; - -} - -static int -gdb_get_tracepoint_info (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - struct symtab_and_line sal; - int tpnum; - struct tracepoint *tp; - struct action_line *al; - Tcl_Obj *action_list; - char *filename, *funcname; - - if (objc != 2) - { - Tcl_WrongNumArgs (interp, 1, objv, "tpnum"); - return TCL_ERROR; - } - - if (Tcl_GetIntFromObj (NULL, objv[1], &tpnum) != TCL_OK) - { - result_ptr->flags |= GDBTK_IN_TCL_RESULT; - return TCL_ERROR; - } - - ALL_TRACEPOINTS (tp) - if (tp->number == tpnum) - break; - - if (tp == NULL) - { - gdbtk_set_result (interp, "Tracepoint #%d does not exist", tpnum); - return TCL_ERROR; - } - - Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL); - sal = find_pc_line (tp->address, 0); - filename = symtab_to_filename (sal.symtab); - if (filename == NULL) - filename = "N/A"; - Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, - Tcl_NewStringObj (filename, -1)); - - funcname = pc_function_name (tp->address); - Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, Tcl_NewStringObj - (funcname, -1)); - - Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, - Tcl_NewIntObj (sal.line)); - Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, - Tcl_NewStringObj (core_addr_to_string (tp->address), -1)); - Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, - Tcl_NewIntObj (tp->enabled_p)); - Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, - Tcl_NewIntObj (tp->pass_count)); - Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, - Tcl_NewIntObj (tp->step_count)); - Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, - Tcl_NewIntObj (tp->thread)); - Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, - Tcl_NewIntObj (tp->hit_count)); - - /* Append a list of actions */ - action_list = Tcl_NewObj (); - for (al = tp->actions; al != NULL; al = al->next) - { - Tcl_ListObjAppendElement (interp, action_list, - Tcl_NewStringObj (al->action, -1)); - } - Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, action_list); - - return TCL_OK; -} - -/* return a list of all tracepoint numbers in interpreter */ -static int -gdb_get_tracepoint_list (ClientData clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[]) -{ - struct tracepoint *tp; - - Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL); - - ALL_TRACEPOINTS (tp) - Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, - Tcl_NewIntObj (tp->number)); - - return TCL_OK; -} - -static int -gdb_trace_status (ClientData clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[]) -{ - int result = 0; - - if (trace_running_p) - result = 1; - - Tcl_SetIntObj (result_ptr->obj_ptr, result); - return TCL_OK; -} - -/* returns -1 if not found, tracepoint # if found */ -static int -tracepoint_exists (char *args) -{ - struct tracepoint *tp; - char **canonical; - struct symtabs_and_lines sals; - char *file = NULL; - int result = -1; - - sals = decode_line_1 (&args, 1, NULL, 0, &canonical, NULL); - if (sals.nelts == 1) - { - resolve_sal_pc (&sals.sals[0]); - file = xmalloc (strlen (sals.sals[0].symtab->dirname) - + strlen (sals.sals[0].symtab->filename) + 1); - if (file != NULL) - { - strcpy (file, sals.sals[0].symtab->dirname); - strcat (file, sals.sals[0].symtab->filename); - - ALL_TRACEPOINTS (tp) - { - if (tp->address == sals.sals[0].pc) - result = tp->number; -#if 0 - /* Why is this here? This messes up assembly traces */ - else if (tp->source_file != NULL - && strcmp (tp->source_file, file) == 0 - && sals.sals[0].line == tp->line_number) - result = tp->number; -#endif - } - } - } - if (file != NULL) - free (file); - return result; -} - -static int -gdb_tracepoint_exists_command (ClientData clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[]) -{ - char *args; - - if (objc != 2) - { - Tcl_WrongNumArgs (interp, 1, objv, - "function:line|function|line|*addr"); - return TCL_ERROR; - } - - args = Tcl_GetStringFromObj (objv[1], NULL); - - Tcl_SetIntObj (result_ptr->obj_ptr, tracepoint_exists (args)); - return TCL_OK; -} - -/* - * This section contains functions which deal with tracepoint - * events from gdb. - */ - -void -gdbtk_create_tracepoint (int num) -{ - tracepoint_notify (num, "create"); -} - -void -gdbtk_delete_tracepoint (int num) -{ - tracepoint_notify (num, "delete"); -} - -void -gdbtk_modify_tracepoint (int num) -{ - tracepoint_notify (num, "modify"); -} - -static void -tracepoint_notify (int num, const char *action) -{ - char *buf; - - /* We ensure that ACTION contains no special Tcl characters, so we - can do this. */ - xasprintf (&buf, "gdbtk_tcl_tracepoint %s %d", action, num); - - if (Tcl_Eval (gdbtk_interp, buf) != TCL_OK) - report_error (); - free(buf); -} diff --git a/gdb/gdbtk/generic/gdbtk-cmds.c b/gdb/gdbtk/generic/gdbtk-cmds.c deleted file mode 100644 index 2c8ecb286cd..00000000000 --- a/gdb/gdbtk/generic/gdbtk-cmds.c +++ /dev/null @@ -1,3001 +0,0 @@ -/* Tcl/Tk command definitions for Insight. - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003 - Free Software Foundation, Inc. - - Written by Stu Grossman <grossman@cygnus.com> of Cygnus Support. - Substantially augmented by Martin Hunt, Keith Seitz & Jim Ingham of - Cygnus Support. - - This file is part of GDB. - - 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. */ - -#include "defs.h" -#include "inferior.h" -#include "source.h" -#include "symfile.h" -#include "objfiles.h" -#include "gdbcore.h" -#include "demangle.h" -#include "linespec.h" -#include "tui/tui-file.h" -#include "top.h" -#include "annotate.h" -#include "block.h" -#include "dictionary.h" -#include "filenames.h" -#include "disasm.h" - -/* tcl header files includes varargs.h unless HAS_STDARG is defined, - but gdb uses stdarg.h, so make sure HAS_STDARG is defined. */ -#define HAS_STDARG 1 - -#include <itcl.h> -#include <tcl.h> -#include <tk.h> - -#include "guitcl.h" -#include "gdbtk.h" -#include "gdbtk-wrapper.h" -#include "gdbtk-cmds.h" - -#include <signal.h> -#include <fcntl.h> -#include <sys/ioctl.h> -#include <sys/time.h> -#include <sys/stat.h> - -#include "gdb_string.h" -#include "dis-asm.h" -#include "gdbcmd.h" - -#ifdef HAVE_CTYPE_H -#include <ctype.h> /* for isprint() */ -#endif - -/* Various globals we reference. */ -extern char *source_path; - -/* These two objects hold boolean true and false, - and are shared by all the list objects that gdb_listfuncs - returns. */ - -static Tcl_Obj *mangled, *not_mangled; - -/* These two control how the GUI behaves when gdb is either tracing or loading. - They are used in this file & gdbtk_hooks.c */ - -int No_Update = 0; -int load_in_progress = 0; - -/* This Structure is used in gdb_disassemble_driver. - We need a different sort of line table from the normal one cuz we can't - depend upon implicit line-end pc's for lines to do the - reordering in this function. */ - -struct my_line_entry -{ - int line; - CORE_ADDR start_pc; - CORE_ADDR end_pc; -}; - -/* Use this to pass the Tcl Text widget command and the open file - descriptor to the disassembly load command. */ - -struct disassembly_client_data -{ - FILE *fp; - int file_opened_p; - int widget_line_no; - Tcl_Interp *interp; - char *widget; - Tcl_Obj *result_obj[3]; - const char *asm_argv[14]; - const char *source_argv[7]; - char *map_arr; - Tcl_DString src_to_line_prefix; - Tcl_DString pc_to_line_prefix; - Tcl_DString line_to_pc_prefix; - Tcl_CmdInfo cmd; -}; - -/* This variable determines where memory used for disassembly is read - from. See note in gdbtk.h for details. */ -/* NOTE: cagney/2003-09-08: This variable is unused. */ -int disassemble_from_exec = -1; - -extern int gdb_variable_init (Tcl_Interp * interp); - -/* - * Declarations for routines exported from this file - */ - -int Gdbtk_Init (Tcl_Interp * interp); - -/* - * Declarations for routines used only in this file. - */ - -static int compare_lines (const PTR, const PTR); -static int comp_files (const void *, const void *); -static int gdb_clear_file (ClientData, Tcl_Interp * interp, int, - Tcl_Obj * CONST[]); -static int gdb_cmd (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]); -static int gdb_confirm_quit (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST[]); -static int gdb_entry_point (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]); -static int gdb_eval (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]); -static int gdb_find_file_command (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST objv[]); -static int gdb_force_quit (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]); -static int gdb_get_file_command (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST objv[]); -static int gdb_get_function_command (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST objv[]); -static int gdb_get_line_command (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST objv[]); -static int gdb_update_mem (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]); -static int gdb_set_mem (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]); -static int gdb_immediate_command (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST[]); -static int gdb_incr_addr (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]); -static int gdb_CA_to_TAS (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]); -static int gdb_listfiles (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]); -static int gdb_listfuncs (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]); -static int gdb_loadfile (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST objv[]); -static int gdb_load_disassembly (ClientData clientData, Tcl_Interp - * interp, int objc, Tcl_Obj * CONST objv[]); -static int gdb_get_inferior_args (ClientData clientData, - Tcl_Interp *interp, - int objc, Tcl_Obj * CONST objv[]); -static int gdb_set_inferior_args (ClientData clientData, - Tcl_Interp *interp, - int objc, Tcl_Obj * CONST objv[]); -static int gdb_load_info (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST objv[]); -static int gdb_loc (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]); -static int gdb_path_conv (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]); -static int gdb_prompt_command (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST objv[]); -static int gdb_restore_fputs (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST[]); -static int gdb_search (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST objv[]); -static int gdb_stop (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]); -static int gdb_target_has_execution_command (ClientData, - Tcl_Interp *, int, - Tcl_Obj * CONST[]); -static int gdbtk_dis_asm_read_memory (bfd_vma, bfd_byte *, unsigned int, - disassemble_info *); -static void gdbtk_load_source (ClientData clientData, - struct symtab *symtab, - int start_line, int end_line); -static CORE_ADDR gdbtk_load_asm (ClientData clientData, CORE_ADDR pc, - struct disassemble_info *di); -static int gdb_disassemble_driver (CORE_ADDR low, CORE_ADDR high, - int mixed_source_and_assembly, - ClientData clientData, - void (*print_source_fn) (ClientData, struct - symtab *, int, - int), - CORE_ADDR (*print_asm_fn) (ClientData, - CORE_ADDR, - struct - disassemble_info - *)); -char *get_prompt (void); -static int perror_with_name_wrapper (PTR args); -static int wrapped_call (PTR opaque_args); -static int hex2bin (const char *hex, char *bin, int count); -static int fromhex (int a); - - -/* Gdbtk_Init - * This loads all the Tcl commands into the Tcl interpreter. - * - * Arguments: - * interp - The interpreter into which to load the commands. - * - * Result: - * A standard Tcl result. - */ - -int -Gdbtk_Init (Tcl_Interp *interp) -{ - Tcl_CreateObjCommand (interp, "gdb_cmd", gdbtk_call_wrapper, gdb_cmd, NULL); - Tcl_CreateObjCommand (interp, "gdb_immediate", gdbtk_call_wrapper, - gdb_immediate_command, NULL); - Tcl_CreateObjCommand (interp, "gdb_loc", gdbtk_call_wrapper, gdb_loc, NULL); - Tcl_CreateObjCommand (interp, "gdb_path_conv", gdbtk_call_wrapper, gdb_path_conv, - NULL); - Tcl_CreateObjCommand (interp, "gdb_listfiles", gdbtk_call_wrapper, gdb_listfiles, - NULL); - Tcl_CreateObjCommand (interp, "gdb_listfuncs", gdbtk_call_wrapper, gdb_listfuncs, - NULL); - Tcl_CreateObjCommand (interp, "gdb_entry_point", gdbtk_call_wrapper, - gdb_entry_point, NULL); - Tcl_CreateObjCommand (interp, "gdb_update_mem", gdbtk_call_wrapper, gdb_update_mem, - NULL); - Tcl_CreateObjCommand (interp, "gdb_set_mem", gdbtk_call_wrapper, gdb_set_mem, - NULL); - Tcl_CreateObjCommand (interp, "gdb_stop", gdbtk_call_wrapper, gdb_stop, NULL); - Tcl_CreateObjCommand (interp, "gdb_restore_fputs", gdbtk_call_wrapper, gdb_restore_fputs, - NULL); - Tcl_CreateObjCommand (interp, "gdb_eval", gdbtk_call_wrapper, gdb_eval, NULL); - Tcl_CreateObjCommand (interp, "gdb_incr_addr", gdbtk_call_wrapper, gdb_incr_addr, NULL); - Tcl_CreateObjCommand (interp, "gdb_CA_to_TAS", gdbtk_call_wrapper, gdb_CA_to_TAS, NULL); - Tcl_CreateObjCommand (interp, "gdb_clear_file", gdbtk_call_wrapper, - gdb_clear_file, NULL); - Tcl_CreateObjCommand (interp, "gdb_confirm_quit", gdbtk_call_wrapper, - gdb_confirm_quit, NULL); - Tcl_CreateObjCommand (interp, "gdb_force_quit", gdbtk_call_wrapper, - gdb_force_quit, NULL); - Tcl_CreateObjCommand (interp, "gdb_target_has_execution", - gdbtk_call_wrapper, - gdb_target_has_execution_command, NULL); - Tcl_CreateObjCommand (interp, "gdb_load_info", gdbtk_call_wrapper, gdb_load_info, - NULL); - Tcl_CreateObjCommand (interp, "gdb_get_function", gdbtk_call_wrapper, - gdb_get_function_command, NULL); - Tcl_CreateObjCommand (interp, "gdb_get_line", gdbtk_call_wrapper, - gdb_get_line_command, NULL); - Tcl_CreateObjCommand (interp, "gdb_get_file", gdbtk_call_wrapper, - gdb_get_file_command, NULL); - Tcl_CreateObjCommand (interp, "gdb_prompt", - gdbtk_call_wrapper, gdb_prompt_command, NULL); - Tcl_CreateObjCommand (interp, "gdb_find_file", - gdbtk_call_wrapper, gdb_find_file_command, NULL); - Tcl_CreateObjCommand (interp, "gdb_loadfile", gdbtk_call_wrapper, gdb_loadfile, - NULL); - Tcl_CreateObjCommand (interp, "gdb_load_disassembly", gdbtk_call_wrapper, - gdb_load_disassembly, NULL); - Tcl_CreateObjCommand (gdbtk_interp, "gdb_search", gdbtk_call_wrapper, - gdb_search, NULL); - Tcl_CreateObjCommand (interp, "gdb_get_inferior_args", gdbtk_call_wrapper, - gdb_get_inferior_args, NULL); - Tcl_CreateObjCommand (interp, "gdb_set_inferior_args", gdbtk_call_wrapper, - gdb_set_inferior_args, NULL); - - /* gdb_context is used for debugging multiple threads or tasks */ - Tcl_LinkVar (interp, "gdb_context_id", - (char *) &gdb_context, - TCL_LINK_INT | TCL_LINK_READ_ONLY); - - /* Make gdb's notion of the pwd visible. This is read-only because - (1) it doesn't make sense to change it directly and (2) it is - allocated using xmalloc and not Tcl_Alloc. You might think we - could just use the Tcl `pwd' command. However, Tcl (erroneously, - imho) maintains a cache of the current directory name, and - doesn't provide a way for gdb to invalidate the cache. */ - Tcl_LinkVar (interp, "gdb_current_directory", - (char *) ¤t_directory, - TCL_LINK_STRING | TCL_LINK_READ_ONLY); - - /* Current gdb source file search path. This is read-only for - reasons similar to those for gdb_current_directory. */ - Tcl_LinkVar (interp, "gdb_source_path", - (char *) &source_path, - TCL_LINK_STRING | TCL_LINK_READ_ONLY); - - /* Init variable interface... */ - if (gdb_variable_init (interp) != TCL_OK) - return TCL_ERROR; - - /* Init breakpoint module */ - if (Gdbtk_Breakpoint_Init (interp) != TCL_OK) - return TCL_ERROR; - - /* Init stack module */ - if (Gdbtk_Stack_Init (interp) != TCL_OK) - return TCL_ERROR; - - /* Init register module */ - if (Gdbtk_Register_Init (interp) != TCL_OK) - return TCL_ERROR; - - /* Determine where to disassemble from */ - Tcl_LinkVar (gdbtk_interp, "disassemble-from-exec", - (char *) &disassemble_from_exec, - TCL_LINK_INT); - - Tcl_PkgProvide (interp, "Gdbtk", GDBTK_VERSION); - return TCL_OK; -} - -/* This routine acts as a top-level for all GDB code called by Tcl/Tk. It - handles cleanups, and uses catch_errors to trap calls to return_to_top_level - (usually via error). - This is necessary in order to prevent a longjmp out of the bowels of Tk, - possibly leaving things in a bad state. Since this routine can be called - recursively, it needs to save and restore the contents of the result_ptr as - necessary. */ - -int -gdbtk_call_wrapper (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - struct wrapped_call_args wrapped_args; - gdbtk_result new_result, *old_result_ptr; - int wrapped_returned_error = 0; - - old_result_ptr = result_ptr; - result_ptr = &new_result; - result_ptr->obj_ptr = Tcl_NewObj (); - result_ptr->flags = GDBTK_TO_RESULT; - - wrapped_args.func = (Tcl_ObjCmdProc *) clientData; - wrapped_args.interp = interp; - wrapped_args.objc = objc; - wrapped_args.objv = objv; - wrapped_args.val = TCL_OK; - - if (!catch_errors (wrapped_call, &wrapped_args, "", RETURN_MASK_ALL)) - { - - wrapped_args.val = TCL_ERROR; /* Flag an error for TCL */ - - /* Make sure the timer interrupts are turned off. */ - gdbtk_stop_timer (); - - gdb_flush (gdb_stderr); /* Flush error output */ - gdb_flush (gdb_stdout); /* Sometimes error output comes here as well */ - - /* If we errored out here, and the results were going to the - console, then gdbtk_fputs will have gathered the result into the - result_ptr. We also need to echo them out to the console here */ - - gdb_flush (gdb_stderr); /* Flush error output */ - gdb_flush (gdb_stdout); /* Sometimes error output comes here as well */ - - /* In case of an error, we may need to force the GUI into idle - mode because gdbtk_call_command may have bombed out while in - the command routine. */ - - running_now = 0; - Tcl_Eval (interp, "gdbtk_tcl_idle"); - - } - else - { - /* If the wrapped call returned an error directly, then we don't - want to reset the result. */ - wrapped_returned_error = wrapped_args.val == TCL_ERROR; - } - - /* do not suppress any errors -- a remote target could have errored */ - load_in_progress = 0; - - /* - * Now copy the result over to the true Tcl result. If - * GDBTK_TO_RESULT flag bit is set, this just copies a null object - * over to the Tcl result, which is fine because we should reset the - * result in this case anyway. If the wrapped command returned an - * error, then we assume that the result is already set correctly. - */ - if ((result_ptr->flags & GDBTK_IN_TCL_RESULT) || wrapped_returned_error) - { - Tcl_DecrRefCount (result_ptr->obj_ptr); - } - else - { - Tcl_SetObjResult (interp, result_ptr->obj_ptr); - } - - result_ptr = old_result_ptr; - -#ifdef _WIN32 - close_bfds (); -#endif - - return wrapped_args.val; -} - -/* - * This is the wrapper that is passed to catch_errors. - */ - -static int -wrapped_call (PTR opaque_args) -{ - struct wrapped_call_args *args = (struct wrapped_call_args *) opaque_args; - args->val = (*args->func) (args->func, args->interp, args->objc, args->objv); - return 1; -} - - -/* - * This section contains the commands that control execution. - */ - -/* This implements the tcl command gdb_clear_file. - -* Prepare to accept a new executable file. This is called when we -* want to clear away everything we know about the old file, without -* asking the user. The Tcl code will have already asked the user if -* necessary. After this is called, we should be able to run the -* `file' command without getting any questions. -* -* Arguments: -* None -* Tcl Result: -* None -*/ - -static int -gdb_clear_file (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - if (objc != 1) - { - Tcl_WrongNumArgs (interp, 1, objv, NULL); - return TCL_ERROR; - } - - if (! ptid_equal (inferior_ptid, null_ptid) && target_has_execution) - { - if (attach_flag) - target_detach (NULL, 0); - else - target_kill (); - } - - if (target_has_execution) - pop_target (); - - delete_command (NULL, 0); - exec_file_clear (0); - symbol_file_clear (0); - - return TCL_OK; -} - -/* This implements the tcl command gdb_confirm_quit - * Ask the user to confirm an exit request. - * - * Arguments: - * None - * Tcl Result: - * A boolean, 1 if the user answered yes, 0 if no. - */ - -static int -gdb_confirm_quit (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - int ret; - - if (objc != 1) - { - Tcl_WrongNumArgs (interp, 1, objv, NULL); - return TCL_ERROR; - } - - ret = quit_confirm (); - Tcl_SetBooleanObj (result_ptr->obj_ptr, ret); - return TCL_OK; -} - -/* This implements the tcl command gdb_force_quit - * Quit without asking for confirmation. - * - * Arguments: - * None - * Tcl Result: - * None - */ - -static int -gdb_force_quit (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - if (objc != 1) - { - Tcl_WrongNumArgs (interp, 1, objv, NULL); - return TCL_ERROR; - } - - quit_force ((char *) NULL, 1); - return TCL_OK; -} - -/* Pressing the stop button on the source window should attempt to - * stop the target. If, after some short time, this fails, a dialog - * should appear allowing the user to detach. - * - * The global GDBTK_FORCE_DETACH is set when we wish to detach - * from a target. This value is returned by ui_loop_hook (x_event), - * indicating to callers that they should detach. - * - * Read the comments before x_event to find out how we (try) to keep - * gdbtk alive while some other event loop has stolen control from us. - */ - -/* - * This command implements the tcl command gdb_stop, which - * is used to either stop the target or detach. - * Note that it is assumed that a simulator or native target - * can ALWAYS be stopped. Doing a "detach" on them has no effect. - * - * Arguments: - * None or "detach" - * Tcl Result: - * None - */ - -static int -gdb_stop (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - int force = 0; - char *s; - - if (objc > 1) - { - s = Tcl_GetStringFromObj (objv[1], NULL); - if (strcmp (s, "detach") == 0) - force = 1; - } - - if (force) - { - /* Set the "forcibly detach from target" flag. x_event will - return this value to callers when they should forcibly detach. */ - gdbtk_force_detach = 1; - } - else - { - if (target_stop != target_ignore) - target_stop (); - else - quit_flag = 1; /* hope something sees this */ - } - - return TCL_OK; -} - - -/* - * This section contains Tcl commands that are wrappers for invoking - * the GDB command interpreter. - */ - - -/* This implements the tcl command `gdb_eval'. - * It uses the gdb evaluator to return the value of - * an expression in the current language - * - * Tcl Arguments: - * expression - the expression to evaluate. - * format - optional format character. Valid chars are: - * o - octal - * x - hex - * d - decimal - * u - unsigned decimal - * t - binary - * f - float - * a - address - * c - char - * Tcl Result: - * The result of the evaluation. - */ - -static int -gdb_eval (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - struct expression *expr; - struct cleanup *old_chain = NULL; - int format = 0; - value_ptr val; - struct ui_file *stb; - long dummy; - char *result; - - if (objc != 2 && objc != 3) - { - Tcl_WrongNumArgs (interp, 1, objv, "expression [format]"); - return TCL_ERROR; - } - - if (objc == 3) - format = *(Tcl_GetStringFromObj (objv[2], NULL)); - - expr = parse_expression (Tcl_GetStringFromObj (objv[1], NULL)); - old_chain = make_cleanup (free_current_contents, &expr); - val = evaluate_expression (expr); - - /* "Print" the result of the expression evaluation. */ - stb = mem_fileopen (); - make_cleanup_ui_file_delete (stb); - val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), - VALUE_EMBEDDED_OFFSET (val), VALUE_ADDRESS (val), - stb, format, 0, 0, 0); - result = ui_file_xstrdup (stb, &dummy); - Tcl_SetObjResult (interp, Tcl_NewStringObj (result, -1)); - xfree (result); - result_ptr->flags |= GDBTK_IN_TCL_RESULT; - - do_cleanups (old_chain); - return TCL_OK; -} - -/* This implements the tcl command "gdb_cmd". - -* It sends its argument to the GDB command scanner for execution. -* This command will never cause the update, idle and busy hooks to be called -* within the GUI. -* -* Tcl Arguments: -* command - The GDB command to execute -* from_tty - 1 indicates this comes to the console. -* Pass this to the gdb command. -* Tcl Result: -* The output from the gdb command (except for the "load" & "while" -* which dump their output to the console. -*/ - -static int -gdb_cmd (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - int from_tty = 0; - - if (objc < 2 || objc > 3) - { - Tcl_WrongNumArgs (interp, 1, objv, "command ?from_tty?"); - return TCL_ERROR; - } - - if (objc == 3) - { - if (Tcl_GetBooleanFromObj (NULL, objv[2], &from_tty) != TCL_OK) - { - gdbtk_set_result (interp, "from_tty must be a boolean."); - return TCL_ERROR; - } - } - - if (running_now || load_in_progress) - return TCL_OK; - - No_Update = 1; - - /* for the load instruction (and possibly others later) we - set turn off the GDBTK_TO_RESULT flag bit so gdbtk_fputs() - will not buffer all the data until the command is finished. */ - - if ((strncmp ("load ", Tcl_GetStringFromObj (objv[1], NULL), 5) == 0)) - { - result_ptr->flags &= ~GDBTK_TO_RESULT; - load_in_progress = 1; - } - - execute_command (Tcl_GetStringFromObj (objv[1], NULL), from_tty); - - if (load_in_progress) - { - load_in_progress = 0; - result_ptr->flags |= GDBTK_TO_RESULT; - } - - bpstat_do_actions (&stop_bpstat); - - return TCL_OK; -} - -/* - * This implements the tcl command "gdb_immediate" - * - * It does exactly the same thing as gdb_cmd, except NONE of its outut - * is buffered. This will also ALWAYS cause the busy, update, and idle - * hooks to be called, contrasted with gdb_cmd, which NEVER calls them. - * It turns off the GDBTK_TO_RESULT flag, which diverts the result - * to the console window. - * - * Tcl Arguments: - * command - The GDB command to execute - * from_tty - 1 to indicate this is from the console. - * Tcl Result: - * None. - */ - -static int -gdb_immediate_command (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - int from_tty = 0; - - if (objc < 2 || objc > 3) - { - Tcl_WrongNumArgs (interp, 1, objv, "command ?from_tty?"); - return TCL_ERROR; - } - - if (objc == 3) - { - if (Tcl_GetBooleanFromObj (NULL, objv[2], &from_tty) != TCL_OK) - { - gdbtk_set_result (interp, "from_tty must be a boolean."); - return TCL_ERROR; - } - } - - if (running_now || load_in_progress) - return TCL_OK; - - No_Update = 0; - - result_ptr->flags &= ~GDBTK_TO_RESULT; - - execute_command (Tcl_GetStringFromObj (objv[1], NULL), from_tty); - - bpstat_do_actions (&stop_bpstat); - - result_ptr->flags |= GDBTK_TO_RESULT; - - return TCL_OK; -} - -/* This implements the tcl command "gdb_prompt" - -* It returns the gdb interpreter's prompt. -* -* Tcl Arguments: -* None. -* Tcl Result: -* The prompt. -*/ - -static int -gdb_prompt_command (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - Tcl_SetStringObj (result_ptr->obj_ptr, get_prompt (), -1); - return TCL_OK; -} - - -/* - * This section contains general informational commands. - */ - -/* This implements the tcl command "gdb_target_has_execution" - -* Tells whether the target is executing. -* -* Tcl Arguments: -* None -* Tcl Result: -* A boolean indicating whether the target is executing. -*/ - -static int -gdb_target_has_execution_command (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - int result = 0; - - if (target_has_execution && ! ptid_equal (inferior_ptid, null_ptid)) - result = 1; - - Tcl_SetBooleanObj (result_ptr->obj_ptr, result); - return TCL_OK; -} - -/* This implements the tcl command "gdb_get_inferior_args" - -* Returns inferior command line arguments as a string -* -* Tcl Arguments: -* None -* Tcl Result: -* A string containing the inferior command line arguments -*/ - -static int -gdb_get_inferior_args (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - if (objc != 1) - { - Tcl_WrongNumArgs (interp, 1, objv, NULL); - return TCL_ERROR; - } - - Tcl_SetStringObj (result_ptr->obj_ptr, get_inferior_args (), -1); - return TCL_OK; -} - -/* This implements the tcl command "gdb_set_inferior_args" - -* Sets inferior command line arguments -* -* Tcl Arguments: -* A string containing the inferior command line arguments -* Tcl Result: -* None -*/ - -static int -gdb_set_inferior_args (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - char *args; - - if (objc != 2) - { - Tcl_WrongNumArgs (interp, 1, objv, "argument"); - return TCL_ERROR; - } - - args = Tcl_GetStringFromObj (objv[1], NULL); - - /* The xstrdup/xfree stuff is so that we maintain a coherent picture - for gdb. I would expect the accessors to do this, but they - don't. */ - args = xstrdup (args); - args = set_inferior_args (args); - xfree (args); - - return TCL_OK; -} - -/* This implements the tcl command "gdb_load_info" - -* It returns information about the file about to be downloaded. -* -* Tcl Arguments: -* filename: The file to open & get the info on. -* Tcl Result: -* A list consisting of the name and size of each section. -*/ - -static int -gdb_load_info (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - bfd *loadfile_bfd; - struct cleanup *old_cleanups; - asection *s; - Tcl_Obj *ob[2]; - - char *filename = Tcl_GetStringFromObj (objv[1], NULL); - - loadfile_bfd = bfd_openr (filename, gnutarget); - if (loadfile_bfd == NULL) - { - gdbtk_set_result (interp, "Open of %s failed", filename); - return TCL_ERROR; - } - old_cleanups = make_cleanup_bfd_close (loadfile_bfd); - - if (!bfd_check_format (loadfile_bfd, bfd_object)) - { - gdbtk_set_result (interp, "Bad Object File"); - return TCL_ERROR; - } - - Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL); - - for (s = loadfile_bfd->sections; s; s = s->next) - { - if (s->flags & SEC_LOAD) - { - bfd_size_type size = bfd_get_section_size_before_reloc (s); - if (size > 0) - { - ob[0] = Tcl_NewStringObj ((char *) - bfd_get_section_name (loadfile_bfd, s), - -1); - ob[1] = Tcl_NewLongObj ((long) size); - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewListObj (2, ob)); - } - } - } - - do_cleanups (old_cleanups); - return TCL_OK; -} - - -/* This implements the tcl command "gdb_get_line" - -* It returns the linenumber for a given linespec. It will take any spec -* that can be passed to decode_line_1 -* -* Tcl Arguments: -* linespec - the line specification -* Tcl Result: -* The line number for that spec. -*/ -static int -gdb_get_line_command (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - struct symtabs_and_lines sals; - char *args, **canonical; - - if (objc != 2) - { - Tcl_WrongNumArgs (interp, 1, objv, "linespec"); - return TCL_ERROR; - } - - args = Tcl_GetStringFromObj (objv[1], NULL); - sals = decode_line_1 (&args, 1, NULL, 0, &canonical, NULL); - if (sals.nelts == 1) - { - Tcl_SetIntObj (result_ptr->obj_ptr, sals.sals[0].line); - return TCL_OK; - } - - Tcl_SetStringObj (result_ptr->obj_ptr, "N/A", -1); - return TCL_OK; - -} - -/* This implements the tcl command "gdb_get_file" - -* It returns the file containing a given line spec. -* -* Tcl Arguments: -* linespec - The linespec to look up -* Tcl Result: -* The file containing it. -*/ - -static int -gdb_get_file_command (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - struct symtabs_and_lines sals; - char *args, **canonical; - - if (objc != 2) - { - Tcl_WrongNumArgs (interp, 1, objv, "linespec"); - return TCL_ERROR; - } - - args = Tcl_GetStringFromObj (objv[1], NULL); - sals = decode_line_1 (&args, 1, NULL, 0, &canonical, NULL); - if (sals.nelts == 1) - { - Tcl_SetStringObj (result_ptr->obj_ptr, - sals.sals[0].symtab->filename, -1); - return TCL_OK; - } - - Tcl_SetStringObj (result_ptr->obj_ptr, "N/A", -1); - return TCL_OK; -} - -/* This implements the tcl command "gdb_get_function" - -* It finds the function containing the given line spec. -* -* Tcl Arguments: -* linespec - The line specification -* Tcl Result: -* The function that contains it, or "N/A" if it is not in a function. -*/ -static int -gdb_get_function_command (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - char *function; - struct symtabs_and_lines sals; - char *args, **canonical; - - if (objc != 2) - { - Tcl_WrongNumArgs (interp, 1, objv, "linespec"); - return TCL_ERROR; - } - - args = Tcl_GetStringFromObj (objv[1], NULL); - sals = decode_line_1 (&args, 1, NULL, 0, &canonical, NULL); - if (sals.nelts == 1) - { - resolve_sal_pc (&sals.sals[0]); - function = pc_function_name (sals.sals[0].pc); - Tcl_SetStringObj (result_ptr->obj_ptr, function, -1); - return TCL_OK; - } - - Tcl_SetStringObj (result_ptr->obj_ptr, "N/A", -1); - return TCL_OK; -} - -/* This implements the tcl command "gdb_find_file" - -* It searches the symbol tables to get the full pathname to a file. -* -* Tcl Arguments: -* filename: the file name to search for. -* Tcl Result: -* The full path to the file, an empty string if the file was not -* available or an error message if the file is not found in the symtab. -*/ - -static int -gdb_find_file_command (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - struct symtab *st; - char *filename, *fullname = NULL; - - if (objc != 2) - { - Tcl_WrongNumArgs (interp, 1, objv, "filename"); - return TCL_ERROR; - } - - filename = Tcl_GetStringFromObj (objv[1], NULL); - - /* Shortcut: There seems to be some mess in gdb dealing with - files. While we should let gdb sort it out, it doesn't hurt - to be a little defensive here. - - If the filename is already an absolute filename, just try - to stat it. If it's not found, then ask gdb to find it for us. */ - if (IS_ABSOLUTE_PATH (filename)) - { - struct stat st; - const int status = stat (filename, &st); - - if (status == 0) - { - if (S_ISREG (st.st_mode)) - fullname = filename; - } - } - else - { - /* Ask gdb to find the file for us. */ - st = lookup_symtab (filename); - - /* We should always get a symtab. */ - if (!st) - { - gdbtk_set_result (interp, "File not found in symtab (2)"); - return TCL_ERROR; - } - - fullname = - (st->fullname == NULL ? symtab_to_filename (st) : st->fullname); - } - - /* We may not be able to open the file (not available). */ - if (fullname == NULL) - { - Tcl_SetStringObj (result_ptr->obj_ptr, "", -1); - return TCL_OK; - } - - Tcl_SetStringObj (result_ptr->obj_ptr, fullname, -1); - - return TCL_OK; -} - -/* This implements the tcl command "gdb_listfiles" - -* This lists all the files in the current executible. -* -* Note that this currently pulls in all sorts of filenames -* that aren't really part of the executable. It would be -* best if we could check each file to see if it actually -* contains executable lines of code, but we can't do that -* with psymtabs. -* -* Arguments: -* ?pathname? - If provided, only files which match pathname -* (up to strlen(pathname)) are included. THIS DOES NOT -* CURRENTLY WORK BECAUSE PARTIAL_SYMTABS DON'T SUPPLY -* THE FULL PATHNAME!!! -* -* Tcl Result: -* A list of all matching files. -*/ -static int -gdb_listfiles (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - struct objfile *objfile; - struct partial_symtab *psymtab; - struct symtab *symtab; - char *lastfile, *pathname = NULL, **files; - int files_size; - int i, numfiles = 0, len = 0; - - files_size = 1000; - files = (char **) xmalloc (sizeof (char *) * files_size); - - if (objc > 2) - { - Tcl_WrongNumArgs (interp, 1, objv, "?pathname?"); - return TCL_ERROR; - } - else if (objc == 2) - pathname = Tcl_GetStringFromObj (objv[1], &len); - - ALL_PSYMTABS (objfile, psymtab) - { - if (numfiles == files_size) - { - files_size = files_size * 2; - files = (char **) xrealloc (files, sizeof (char *) * files_size); - } - if (psymtab->filename) - { - if (!len || !strncmp (pathname, psymtab->filename, len) - || !strcmp (psymtab->filename, basename (psymtab->filename))) - { - files[numfiles++] = basename (psymtab->filename); - } - } - } - - ALL_SYMTABS (objfile, symtab) - { - if (numfiles == files_size) - { - files_size = files_size * 2; - files = (char **) xrealloc (files, sizeof (char *) * files_size); - } - if (symtab->filename && symtab->linetable && symtab->linetable->nitems) - { - if (!len || !strncmp (pathname, symtab->filename, len) - || !strcmp (symtab->filename, basename (symtab->filename))) - { - files[numfiles++] = basename (symtab->filename); - } - } - } - - qsort (files, numfiles, sizeof (char *), comp_files); - - lastfile = ""; - - /* Discard the old result pointer, in case it has accumulated anything - and set it to a new list object */ - - Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL); - - for (i = 0; i < numfiles; i++) - { - if (strcmp (files[i], lastfile)) - Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, - Tcl_NewStringObj (files[i], -1)); - lastfile = files[i]; - } - - free (files); - return TCL_OK; -} - -static int -comp_files (const void *file1, const void *file2) -{ - return strcmp (*(char **) file1, *(char **) file2); -} - - -/* This implements the tcl command "gdb_search" - - -* Tcl Arguments: -* option - One of "functions", "variables" or "types" -* regexp - The regular expression to look for. -* Then, optionally: -* -files fileList -* -static 1/0 -* -filename 1/0 -* Tcl Result: -* A list of all the matches found. Optionally, if -filename is set to 1, -* then the output is a list of two element lists, with the symbol first, -* and the file in which it is found second. -*/ - -static int -gdb_search (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - struct symbol_search *ss = NULL; - struct symbol_search *p; - struct cleanup *old_chain = NULL; - Tcl_Obj *CONST * switch_objv; - int index, switch_objc, i, show_files = 0; - domain_enum space = 0; - char *regexp; - int static_only, nfiles; - Tcl_Obj **file_list; - char **files; - static const char *search_options[] = - {"functions", "variables", "types", (char *) NULL}; - static const char *switches[] = - {"-files", "-filename", "-static", (char *) NULL}; - enum search_opts - { - SEARCH_FUNCTIONS, SEARCH_VARIABLES, SEARCH_TYPES - }; - enum switches_opts - { - SWITCH_FILES, SWITCH_FILENAME, SWITCH_STATIC_ONLY - }; - - if (objc < 3) - { - Tcl_WrongNumArgs (interp, 1, objv, "option regexp ?arg ...?"); - return TCL_ERROR; - } - - if (Tcl_GetIndexFromObj (interp, objv[1], search_options, "option", 0, - &index) != TCL_OK) - { - result_ptr->flags |= GDBTK_IN_TCL_RESULT; - return TCL_ERROR; - } - - /* Unfortunately, we cannot teach search_symbols to search on - multiple regexps, so we have to do a two-tier search for - any searches which choose to narrow the playing field. */ - switch ((enum search_opts) index) - { - case SEARCH_FUNCTIONS: - space = FUNCTIONS_DOMAIN; - break; - case SEARCH_VARIABLES: - space = VARIABLES_DOMAIN; - break; - case SEARCH_TYPES: - space = TYPES_DOMAIN; - break; - } - - regexp = Tcl_GetStringFromObj (objv[2], NULL); - /* Process any switches that refine the search */ - switch_objc = objc - 3; - switch_objv = objv + 3; - - static_only = 0; - nfiles = 0; - files = (char **) NULL; - while (switch_objc > 0) - { - if (Tcl_GetIndexFromObj (interp, switch_objv[0], switches, - "option", 0, &index) != TCL_OK) - { - result_ptr->flags |= GDBTK_IN_TCL_RESULT; - return TCL_ERROR; - } - - switch ((enum switches_opts) index) - { - case SWITCH_FILENAME: - { - if (switch_objc < 2) - { - Tcl_WrongNumArgs (interp, 3, objv, - "?-files fileList -filename 1|0 -static 1|0?"); - result_ptr->flags |= GDBTK_IN_TCL_RESULT; - return TCL_ERROR; - } - if (Tcl_GetBooleanFromObj (interp, switch_objv[1], &show_files) - != TCL_OK) - { - result_ptr->flags |= GDBTK_IN_TCL_RESULT; - return TCL_ERROR; - } - switch_objc--; - switch_objv++; - } - break; - case SWITCH_FILES: - { - int result; - if (switch_objc < 2) - { - Tcl_WrongNumArgs (interp, 3, objv, - "?-files fileList -filename 1|0 -static 1|0?"); - result_ptr->flags |= GDBTK_IN_TCL_RESULT; - return TCL_ERROR; - } - result = Tcl_ListObjGetElements (interp, switch_objv[1], - &nfiles, &file_list); - if (result != TCL_OK) - return result; - - files = (char **) xmalloc (nfiles * sizeof (char *)); - for (i = 0; i < nfiles; i++) - files[i] = Tcl_GetStringFromObj (file_list[i], NULL); - switch_objc--; - switch_objv++; - } - break; - case SWITCH_STATIC_ONLY: - if (switch_objc < 2) - { - Tcl_WrongNumArgs (interp, 3, objv, - "?-files fileList -filename 1|0 -static 1|0?"); - result_ptr->flags |= GDBTK_IN_TCL_RESULT; - return TCL_ERROR; - } - if (Tcl_GetBooleanFromObj (interp, switch_objv[1], &static_only) - != TCL_OK) - { - result_ptr->flags |= GDBTK_IN_TCL_RESULT; - return TCL_ERROR; - } - switch_objc--; - switch_objv++; - } - switch_objc--; - switch_objv++; - } - - search_symbols (regexp, space, nfiles, files, &ss); - if (ss != NULL) - old_chain = make_cleanup_free_search_symbols (ss); - - Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL); - - for (p = ss; p != NULL; p = p->next) - { - Tcl_Obj *elem; - - if (static_only && p->block != STATIC_BLOCK) - continue; - - /* Strip off some C++ special symbols, like RTTI and global - constructors/destructors. */ - if ((p->symbol != NULL - && strncmp (SYMBOL_LINKAGE_NAME (p->symbol), "__tf", 4) != 0 - && strncmp (SYMBOL_LINKAGE_NAME (p->symbol), "_GLOBAL_", 8) != 0) - || p->msymbol != NULL) - { - elem = Tcl_NewListObj (0, NULL); - - if (p->msymbol == NULL) - Tcl_ListObjAppendElement (interp, elem, - Tcl_NewStringObj (SYMBOL_PRINT_NAME (p->symbol), -1)); - else - Tcl_ListObjAppendElement (interp, elem, - Tcl_NewStringObj (SYMBOL_PRINT_NAME (p->msymbol), -1)); - - if (show_files) - { - if ((p->symtab != NULL) && (p->symtab->filename != NULL)) - { - Tcl_ListObjAppendElement (interp, elem, Tcl_NewStringObj - (p->symtab->filename, -1)); - } - else - { - Tcl_ListObjAppendElement (interp, elem, - Tcl_NewStringObj ("", 0)); - } - } - - Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, elem); - } - } - - if (ss != NULL) - do_cleanups (old_chain); - - return TCL_OK; -} - -/* This implements the tcl command gdb_listfuncs - -* It lists all the functions defined in a given file -* -* Arguments: -* file - the file to look in -* Tcl Result: -* A list of two element lists, the first element is -* the symbol name, and the second is a boolean indicating -* whether the symbol is demangled (1 for yes). -*/ - -static int -gdb_listfuncs (clientData, interp, objc, objv) - ClientData clientData; - Tcl_Interp *interp; - int objc; - Tcl_Obj *CONST objv[]; -{ - struct symtab *symtab; - struct blockvector *bv; - struct block *b; - struct symbol *sym; - int i; - struct dict_iterator iter; - Tcl_Obj *funcVals[2]; - - if (objc != 2) - { - Tcl_WrongNumArgs (interp, 1, objv, "file"); - return TCL_ERROR; - } - - symtab = lookup_symtab (Tcl_GetStringFromObj (objv[1], NULL)); - if (!symtab) - { - gdbtk_set_result (interp, "No such file (%s)", - Tcl_GetStringFromObj (objv[1], NULL)); - return TCL_ERROR; - } - - if (mangled == NULL) - { - mangled = Tcl_NewBooleanObj (1); - not_mangled = Tcl_NewBooleanObj (0); - Tcl_IncrRefCount (mangled); - Tcl_IncrRefCount (not_mangled); - } - - Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL); - - bv = BLOCKVECTOR (symtab); - for (i = GLOBAL_BLOCK; i <= STATIC_BLOCK; i++) - { - b = BLOCKVECTOR_BLOCK (bv, i); - ALL_BLOCK_SYMBOLS (b, iter, sym) - { - if (SYMBOL_CLASS (sym) == LOC_BLOCK) - { - - char *name = SYMBOL_DEMANGLED_NAME (sym); - - if (name) - { - /* strip out "global constructors" and - * "global destructors" - * because we aren't interested in them. */ - - if (strncmp (name, "global ", 7)) - { - /* If the function is overloaded, - * print out the functions - * declaration, not just its name. */ - - funcVals[0] = Tcl_NewStringObj (name, -1); - funcVals[1] = mangled; - } - else - continue; - - } - else - { - funcVals[0] = Tcl_NewStringObj (DEPRECATED_SYMBOL_NAME (sym), -1); - funcVals[1] = not_mangled; - } - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewListObj (2, funcVals)); - } - } - } - return TCL_OK; -} - -/* This implements the TCL command `gdb_restore_fputs' - It sets the fputs_unfiltered hook back to gdbtk_fputs. - Its sole reason for being is that sometimes we move the - fputs hook out of the way to specially trap output, and if - we get an error which we weren't expecting, it won't get put - back, so we run this at idle time as insurance. -*/ - -static int -gdb_restore_fputs (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - gdbtk_disable_fputs = 0; - return TCL_OK; -} - - -/* This implements the tcl command gdb_load_disassembly - * - * Arguments: - * widget - the name of a text widget into which to load the data - * source_with_assm - must be "source" or "nosource" - * low_address - the CORE_ADDR from which to start disassembly - * ?hi_address? - the CORE_ADDR to which to disassemble, defaults - * to the end of the function containing low_address. - * Tcl Result: - * The text widget is loaded with the data, and a list is returned. - * The first element of the list is a two element list containing the - * real low & high elements, the rest is a mapping between line number - * in the text widget, and either the source line number of that line, - * if it is a source line, or the assembly address. You can distinguish - * between the two, because the address will start with 0x... - */ - -static int -gdb_load_disassembly (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - CORE_ADDR low, high, orig; - struct disassembly_client_data client_data; - int mixed_source_and_assembly, ret_val, i; - char *arg_ptr; - char *map_name; - Tcl_WideInt waddr; - - if (objc != 6 && objc != 7) - { - Tcl_WrongNumArgs (interp, 1, objv, "[source|nosource] map_arr index_prefix low_address ?hi_address"); - return TCL_ERROR; - } - - client_data.widget = Tcl_GetStringFromObj (objv[1], NULL); - if ( Tk_NameToWindow (interp, client_data.widget, - Tk_MainWindow (interp)) == NULL) - { - gdbtk_set_result (interp, "Invalid widget name."); - return TCL_ERROR; - } - - if (!Tcl_GetCommandInfo (interp, client_data.widget, &client_data.cmd)) - { - gdbtk_set_result (interp, "Can't get widget command info"); - return TCL_ERROR; - } - - arg_ptr = Tcl_GetStringFromObj (objv[2], NULL); - if (*arg_ptr == 's' && strcmp (arg_ptr, "source") == 0) - mixed_source_and_assembly = 1; - else if (*arg_ptr == 'n' && strcmp (arg_ptr, "nosource") == 0) - mixed_source_and_assembly = 0; - else - { - gdbtk_set_result (interp, "Second arg must be 'source' or 'nosource'"); - return TCL_ERROR; - } - - /* As we populate the text widget, we will also create an array in the - caller's scope. The name is given by objv[3]. - Each source line gets an entry or the form: - array($prefix,srcline=$src_line_no) = $widget_line_no - - Each assembly line gets two entries of the form: - array($prefix,pc=$pc) = $widget_line_no - array($prefix,line=$widget_line_no) = $src_line_no - - Where prefix is objv[4]. - */ - - map_name = Tcl_GetStringFromObj (objv[3], NULL); - - if (*map_name != '\0') - { - char *prefix; - int prefix_len; - - client_data.map_arr = "map_array"; - if (Tcl_UpVar (interp, "1", map_name, client_data.map_arr, 0) != TCL_OK) - { - gdbtk_set_result (interp, "Can't link map array."); - return TCL_ERROR; - } - - prefix = Tcl_GetStringFromObj (objv[4], &prefix_len); - - Tcl_DStringInit(&client_data.src_to_line_prefix); - Tcl_DStringAppend (&client_data.src_to_line_prefix, - prefix, prefix_len); - Tcl_DStringAppend (&client_data.src_to_line_prefix, ",srcline=", - sizeof (",srcline=") - 1); - - Tcl_DStringInit(&client_data.pc_to_line_prefix); - Tcl_DStringAppend (&client_data.pc_to_line_prefix, - prefix, prefix_len); - Tcl_DStringAppend (&client_data.pc_to_line_prefix, ",pc=", - sizeof (",pc=") - 1); - - Tcl_DStringInit(&client_data.line_to_pc_prefix); - Tcl_DStringAppend (&client_data.line_to_pc_prefix, - prefix, prefix_len); - Tcl_DStringAppend (&client_data.line_to_pc_prefix, ",line=", - sizeof (",line=") - 1); - - } - else - { - client_data.map_arr = ""; - } - - /* Now parse the addresses */ - if (Tcl_GetWideIntFromObj (interp, objv[5], &waddr) != TCL_OK) - return TCL_ERROR; - low = waddr; - - orig = low; - - if (objc == 6) - { - if (find_pc_partial_function (low, NULL, &low, &high) == 0) - error ("No function contains address 0x%s", core_addr_to_string (orig)); - } - else - { - if (Tcl_GetWideIntFromObj (interp, objv[6], &waddr) != TCL_OK) - return TCL_ERROR; - high = waddr; - } - - /* Setup the client_data structure, and call the driver function. */ - - client_data.file_opened_p = 0; - client_data.widget_line_no = 0; - client_data.interp = interp; - for (i = 0; i < 3; i++) - { - client_data.result_obj[i] = Tcl_NewObj(); - Tcl_IncrRefCount (client_data.result_obj[i]); - } - - /* Fill up the constant parts of the argv structures */ - client_data.asm_argv[0] = client_data.widget; - client_data.asm_argv[1] = "insert"; - client_data.asm_argv[2] = "end"; - client_data.asm_argv[3] = "-\t"; - client_data.asm_argv[4] = "break_rgn_tag"; - /* client_data.asm_argv[5] = address; */ - client_data.asm_argv[6] = "break_rgn_tag"; - /* client_data.asm_argv[7] = offset; */ - client_data.asm_argv[8] = "break_rgn_tag"; - client_data.asm_argv[9] = ":\t\t"; - client_data.asm_argv[10] = "source_tag"; - /* client_data.asm_argv[11] = code; */ - client_data.asm_argv[12] = "source_tag"; - client_data.asm_argv[13] = "\n"; - - if (mixed_source_and_assembly) - { - client_data.source_argv[0] = client_data.widget; - client_data.source_argv[1] = "insert"; - client_data.source_argv[2] = "end"; - /* client_data.source_argv[3] = line_number; */ - client_data.source_argv[4] = ""; - /* client_data.source_argv[5] = line; */ - client_data.source_argv[6] = "source_tag2"; - } - - ret_val = gdb_disassemble_driver (low, high, mixed_source_and_assembly, - (ClientData) &client_data, - gdbtk_load_source, gdbtk_load_asm); - - /* Now clean up the opened file, and the Tcl data structures */ - - if (client_data.file_opened_p == 1) - fclose(client_data.fp); - - if (*client_data.map_arr != '\0') - { - Tcl_DStringFree(&client_data.src_to_line_prefix); - Tcl_DStringFree(&client_data.pc_to_line_prefix); - Tcl_DStringFree(&client_data.line_to_pc_prefix); - } - - for (i = 0; i < 3; i++) - { - Tcl_DecrRefCount (client_data.result_obj[i]); - } - - /* Finally, if we were successful, stick the low & high addresses - into the Tcl result. */ - - if (ret_val == TCL_OK) - { - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewStringObj (core_addr_to_string (low), -1)); - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewStringObj (core_addr_to_string (high), -1)); - } - return ret_val; -} - -static void -gdbtk_load_source (ClientData clientData, struct symtab *symtab, - int start_line, int end_line) -{ - struct disassembly_client_data *client_data = - (struct disassembly_client_data *) clientData; - char *buffer; - int index_len; - - index_len = Tcl_DStringLength (&client_data->src_to_line_prefix); - - if (client_data->file_opened_p == 1) - { - const char **text_argv; - char line[10000], line_number[18]; - int found_carriage_return = 1; - - /* First do some sanity checks on the requested lines */ - - if (start_line < 1 - || end_line < start_line || end_line > symtab->nlines) - { - return; - } - - line_number[0] = '\t'; - line[0] = '\t'; - - text_argv = client_data->source_argv; - - text_argv[3] = line_number; - text_argv[5] = line; - - if (fseek (client_data->fp, symtab->line_charpos[start_line - 1], - SEEK_SET) < 0) - { - fclose(client_data->fp); - client_data->file_opened_p = -1; - return; - } - - for (; start_line < end_line; start_line++) - { - if (!fgets (line + 1, 9980, client_data->fp)) - { - fclose(client_data->fp); - client_data->file_opened_p = -1; - return; - } - - client_data->widget_line_no++; - - sprintf (line_number + 1, "%d", start_line); - - if (found_carriage_return) - { - char *p = strrchr(line, '\0') - 2; - if (*p == '\r') - { - *p = '\n'; - *(p + 1) = '\0'; - } - else - found_carriage_return = 0; - } - - /* Run the command, then add an entry to the map array in - the caller's scope, if requested. */ - - client_data->cmd.proc (client_data->cmd.clientData, - client_data->interp, 7, text_argv); - - if (*client_data->map_arr != '\0') - { - - Tcl_DStringAppend (&client_data->src_to_line_prefix, - line_number + 1, -1); - - /* FIXME: Convert to Tcl_SetVar2Ex when we move to 8.2. This - will allow us avoid converting widget_line_no into a string. */ - - xasprintf (&buffer, "%d", client_data->widget_line_no); - - Tcl_SetVar2 (client_data->interp, client_data->map_arr, - Tcl_DStringValue (&client_data->src_to_line_prefix), - buffer, 0); - free(buffer); - - Tcl_DStringSetLength (&client_data->src_to_line_prefix, index_len); - } - } - - } - else if (!client_data->file_opened_p) - { - int fdes; - /* The file is not yet open, try to open it, then print the - first line. If we fail, set FILE_OPEN_P to -1. */ - - fdes = open_source_file (symtab); - if (fdes < 0) - { - client_data->file_opened_p = -1; - } - else - { - /* FIXME: Convert to a Tcl File Channel and read from there. - This will allow us to get the line endings and conversion - to UTF8 right automatically when we move to 8.2. - Need a Cygwin call to convert a file descriptor to the native - Windows handler to do this. */ - - client_data->file_opened_p = 1; - client_data->fp = fdopen (fdes, FOPEN_RB); - clearerr (client_data->fp); - - if (symtab->line_charpos == 0) - find_source_lines (symtab, fdes); - - /* We are called with an actual load request, so call ourselves - to load the first line. */ - - gdbtk_load_source (clientData, symtab, start_line, end_line); - } - } - else - { - /* If we couldn't open the file, or got some prior error, just exit. */ - return; - } -} - - -/* FIXME: cagney/2003-09-08: "di" is not used and unneeded. */ -static CORE_ADDR -gdbtk_load_asm (ClientData clientData, CORE_ADDR pc, - struct disassemble_info *di) -{ - struct disassembly_client_data * client_data - = (struct disassembly_client_data *) clientData; - const char **text_argv; - int i, pc_to_line_len, line_to_pc_len; - gdbtk_result new_result; - int insn; - struct cleanup *old_chain = NULL; - - pc_to_line_len = Tcl_DStringLength (&client_data->pc_to_line_prefix); - line_to_pc_len = Tcl_DStringLength (&client_data->line_to_pc_prefix); - - text_argv = client_data->asm_argv; - - /* Preserve the current Tcl result object, print out what we need, and then - suck it out of the result, and replace... */ - - old_chain = make_cleanup (gdbtk_restore_result_ptr, (void *) result_ptr); - result_ptr = &new_result; - result_ptr->obj_ptr = client_data->result_obj[0]; - result_ptr->flags = GDBTK_TO_RESULT; - - /* Null out the three return objects we will use. */ - - for (i = 0; i < 3; i++) - Tcl_SetObjLength (client_data->result_obj[i], 0); - - print_address_numeric (pc, 1, gdb_stdout); - gdb_flush (gdb_stdout); - - result_ptr->obj_ptr = client_data->result_obj[1]; - print_address_symbolic (pc, gdb_stdout, 1, "\t"); - gdb_flush (gdb_stdout); - - result_ptr->obj_ptr = client_data->result_obj[2]; - /* FIXME: cagney/2003-09-08: This should use gdb_disassembly. */ - insn = gdb_print_insn (pc, gdb_stdout); - gdb_flush (gdb_stdout); - - client_data->widget_line_no++; - - text_argv[5] = Tcl_GetStringFromObj (client_data->result_obj[0], NULL); - text_argv[7] = Tcl_GetStringFromObj (client_data->result_obj[1], NULL); - text_argv[11] = Tcl_GetStringFromObj (client_data->result_obj[2], NULL); - - client_data->cmd.proc (client_data->cmd.clientData, - client_data->interp, 14, text_argv); - - if (*client_data->map_arr != '\0') - { - char *buffer; - - /* Run the command, then add an entry to the map array in - the caller's scope. */ - - Tcl_DStringAppend (&client_data->pc_to_line_prefix, core_addr_to_string (pc), -1); - - /* FIXME: Convert to Tcl_SetVar2Ex when we move to 8.2. This - will allow us avoid converting widget_line_no into a string. */ - - xasprintf (&buffer, "%d", client_data->widget_line_no); - - Tcl_SetVar2 (client_data->interp, client_data->map_arr, - Tcl_DStringValue (&client_data->pc_to_line_prefix), - buffer, 0); - - Tcl_DStringAppend (&client_data->line_to_pc_prefix, buffer, -1); - - - Tcl_SetVar2 (client_data->interp, client_data->map_arr, - Tcl_DStringValue (&client_data->line_to_pc_prefix), - core_addr_to_string (pc), 0); - - /* Restore the prefixes to their initial state. */ - - Tcl_DStringSetLength (&client_data->pc_to_line_prefix, pc_to_line_len); - Tcl_DStringSetLength (&client_data->line_to_pc_prefix, line_to_pc_len); - - xfree (buffer); - } - - do_cleanups (old_chain); - - return pc + insn; -} - -static int -gdb_disassemble_driver (CORE_ADDR low, CORE_ADDR high, - int mixed_source_and_assembly, - ClientData clientData, - void (*print_source_fn) (ClientData, struct symtab *, int, int), - CORE_ADDR (*print_asm_fn) (ClientData, CORE_ADDR, struct disassemble_info *)) -{ - CORE_ADDR pc; - - /* If just doing straight assembly, all we need to do is disassemble - everything between low and high. If doing mixed source/assembly, we've - got a totally different path to follow. */ - - if (mixed_source_and_assembly) - { /* Come here for mixed source/assembly */ - /* The idea here is to present a source-O-centric view of a function to - the user. This means that things are presented in source order, with - (possibly) out of order assembly immediately following. */ - struct symtab *symtab; - struct linetable_entry *le; - int nlines; - int newlines; - struct my_line_entry *mle; - struct symtab_and_line sal; - int i; - int out_of_order; - int next_line; - - /* Assume symtab is valid for whole PC range */ - symtab = find_pc_symtab (low); - - if (!symtab || !symtab->linetable) - goto assembly_only; - - /* First, convert the linetable to a bunch of my_line_entry's. */ - - le = symtab->linetable->item; - nlines = symtab->linetable->nitems; - - if (nlines <= 0) - goto assembly_only; - - mle = (struct my_line_entry *) alloca (nlines * - sizeof (struct my_line_entry)); - - out_of_order = 0; - - /* Copy linetable entries for this function into our data structure, - creating end_pc's and setting out_of_order as appropriate. */ - - /* First, skip all the preceding functions. */ - - for (i = 0; i < nlines - 1 && le[i].pc < low; i++) ; - - /* Now, copy all entries before the end of this function. */ - - newlines = 0; - for (; i < nlines - 1 && le[i].pc < high; i++) - { - if (le[i].line == le[i + 1].line - && le[i].pc == le[i + 1].pc) - continue; /* Ignore duplicates */ - - /* Skip any end-of-function markers. */ - if (le[i].line == 0) - continue; - - mle[newlines].line = le[i].line; - if (le[i].line > le[i + 1].line) - out_of_order = 1; - mle[newlines].start_pc = le[i].pc; - mle[newlines].end_pc = le[i + 1].pc; - newlines++; - } - - /* If we're on the last line, and it's part of the function, then we - need to get the end pc in a special way. */ - - if (i == nlines - 1 - && le[i].pc < high) - { - mle[newlines].line = le[i].line; - mle[newlines].start_pc = le[i].pc; - sal = find_pc_line (le[i].pc, 0); - mle[newlines].end_pc = sal.end; - newlines++; - } - - /* Now, sort mle by line #s (and, then by addresses within lines). */ - - if (out_of_order) - qsort (mle, newlines, sizeof (struct my_line_entry), compare_lines); - - /* Now, for each line entry, emit the specified lines (unless they have - been emitted before), followed by the assembly code for that line. */ - - next_line = 0; /* Force out first line */ - for (i = 0; i < newlines; i++) - { - /* Print out everything from next_line to the current line. */ - - if (mle[i].line >= next_line) - { - if (next_line != 0) - print_source_fn (clientData, symtab, next_line, - mle[i].line + 1); - else - print_source_fn (clientData, symtab, mle[i].line, - mle[i].line + 1); - - next_line = mle[i].line + 1; - } - - for (pc = mle[i].start_pc; pc < mle[i].end_pc; ) - { - QUIT; - /* FIXME: cagney/2003-09-08: This entire function should - be replaced by gdb_disassembly. */ - pc = print_asm_fn (clientData, pc, NULL); - } - } - } - else - { - assembly_only: - for (pc = low; pc < high; ) - { - QUIT; - /* FIXME: cagney/2003-09-08: This entire function should be - replaced by gdb_disassembly. */ - pc = print_asm_fn (clientData, pc, NULL); - } - } - - return TCL_OK; -} - -/* This is the memory_read_func for gdb_disassemble_driver when we are - disassembling from the exec file. */ - -static int -gdbtk_dis_asm_read_memory (bfd_vma memaddr, bfd_byte *myaddr, - unsigned int len, disassemble_info *info) -{ - extern struct target_ops exec_ops; - int res; - - errno = 0; - res = xfer_memory (memaddr, myaddr, len, 0, 0, &exec_ops); - - if (res == len) - return 0; - else if (errno == 0) - return EIO; - else - return errno; -} - -/* This will be passed to qsort to sort the results of the disassembly */ - -static int -compare_lines (const PTR mle1p, const PTR mle2p) -{ - struct my_line_entry *mle1, *mle2; - int val; - - mle1 = (struct my_line_entry *) mle1p; - mle2 = (struct my_line_entry *) mle2p; - - val = mle1->line - mle2->line; - - if (val != 0) - return val; - - return mle1->start_pc - mle2->start_pc; -} - -/* This implements the TCL command `gdb_loc', - -* Arguments: -* ?symbol? The symbol or address to locate - defaults to pc -* Tcl Return: -* a list consisting of the following: -* basename, function name, filename, line number, address, current pc -*/ - -static int -gdb_loc (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) -{ - char *filename; - struct symtab_and_line sal; - char *fname; - CORE_ADDR pc; - - if (objc == 1) - { - if (deprecated_selected_frame - && (get_frame_pc (deprecated_selected_frame) != read_pc ())) - { - /* Note - this next line is not correct on all architectures. - For a graphical debugger we really want to highlight the - assembly line that called the next function on the stack. - Many architectures have the next instruction saved as the - pc on the stack, so what happens is the next instruction - is highlighted. FIXME */ - pc = get_frame_pc (deprecated_selected_frame); - find_frame_sal (deprecated_selected_frame, &sal); - } - else - { - pc = read_pc (); - sal = find_pc_line (pc, 0); - } - } - else if (objc == 2) - { - struct symtabs_and_lines sals; - int nelts; - - sals = decode_line_spec (Tcl_GetStringFromObj (objv[1], NULL), 1); - - nelts = sals.nelts; - sal = sals.sals[0]; - free (sals.sals); - - if (sals.nelts != 1) - { - gdbtk_set_result (interp, "Ambiguous line spec", -1); - return TCL_ERROR; - } - resolve_sal_pc (&sal); - pc = sal.pc; - } - else - { - Tcl_WrongNumArgs (interp, 1, objv, "?symbol?"); - return TCL_ERROR; - } - - if (sal.symtab) - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewStringObj (sal.symtab->filename, -1)); - else - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewStringObj ("", 0)); - - fname = pc_function_name (pc); - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewStringObj (fname, -1)); - - filename = symtab_to_filename (sal.symtab); - if (filename == NULL) - filename = ""; - - /* file name */ - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, Tcl_NewStringObj (filename, -1)); - /* line number */ - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, Tcl_NewIntObj (sal.line)); - /* PC in current frame */ - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewStringObj (core_addr_to_string (pc), -1)); - /* Real PC */ - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewStringObj (core_addr_to_string (stop_pc), -1)); - /* shared library */ -#ifdef PC_SOLIB - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewStringObj (PC_SOLIB (pc), -1)); -#else - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewStringObj ("", -1)); -#endif - return TCL_OK; -} - -/* This implements the TCL command gdb_entry_point. It returns the current - entry point address. */ - -static int -gdb_entry_point (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - char *addrstr; - - /* If we have not yet loaded an exec file, then we have no - entry point, so return an empty string.*/ - if ((int) current_target.to_stratum > (int) dummy_stratum) - { - addrstr = (char *)core_addr_to_string (entry_point_address ()); - Tcl_SetStringObj (result_ptr->obj_ptr, addrstr, -1); - } - else - Tcl_SetStringObj (result_ptr->obj_ptr, "", -1); - - return TCL_OK; -} - -/* Covert hex to binary. Stolen from remote.c, - but added error handling */ -static int -fromhex (int a) -{ - if (a >= '0' && a <= '9') - return a - '0'; - else if (a >= 'a' && a <= 'f') - return a - 'a' + 10; - else if (a >= 'A' && a <= 'F') - return a - 'A' + 10; - - return -1; -} - -static int -hex2bin (const char *hex, char *bin, int count) -{ - int i, m, n; - int incr = 2; - - - if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE) - { - /* need to read string in reverse */ - hex += count - 2; - incr = -2; - } - - for (i = 0; i < count; i += 2) - { - if (hex[0] == 0 || hex[1] == 0) - { - /* Hex string is short, or of uneven length. - Return the count that has been converted so far. */ - return i; - } - m = fromhex (hex[0]); - n = fromhex (hex[1]); - if (m == -1 || n == -1) - return -1; - *bin++ = m * 16 + n; - hex += incr; - } - - return i; -} - -/* This implements the Tcl command 'gdb_set_mem', which - * sets some chunk of memory. - * - * Arguments: - * gdb_set_mem addr hexstr len - * - * addr: address of data to set - * hexstr: ascii string of data to set - * len: number of bytes of data to set - */ -static int -gdb_set_mem (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - CORE_ADDR addr; - char buf[128]; - char *hexstr; - int len, size; - - if (objc != 4) - { - Tcl_WrongNumArgs (interp, 1, objv, "addr hex_data len"); - return TCL_ERROR; - } - - /* Address to write */ - addr = string_to_core_addr (Tcl_GetStringFromObj (objv[1], NULL)); - - /* String value to write: it's in hex */ - hexstr = Tcl_GetStringFromObj (objv[2], NULL); - if (hexstr == NULL) - return TCL_ERROR; - - /* Length of buf */ - if (Tcl_GetIntFromObj (interp, objv[3], &len) != TCL_OK) - return TCL_ERROR; - - /* Convert hexstr to binary and write */ - if (hexstr[0] == '0' && hexstr[1] == 'x') - hexstr += 2; - size = hex2bin (hexstr, buf, strlen (hexstr)); - if (size < 0) - { - /* Error in input */ - gdbtk_set_result (interp, "Invalid hexadecimal input: \"0x%s\"", hexstr); - return TCL_ERROR; - } - - target_write_memory (addr, buf, len); - return TCL_OK; -} - -/* This implements the Tcl command 'gdb_update_mem', which - * updates a block of memory in the memory window - * - * Arguments: - * gdb_update_mem data addr form size nbytes bpr aschar - * - * 1 data: variable that holds table's data - * 2 addr: address of data to dump - * 3 mform: a char indicating format - * 4 size: size of each element; 1,2,4, or 8 bytes - * 5 nbytes: the number of bytes to read - * 6 bpr: bytes per row - * 7 aschar: if present, an ASCII dump of the row is included. ASCHAR - * used for unprintable characters. - * - * Return: - * a list of three integers: {border_col_width data_col_width ascii_col_width} - * which can be used to set the table's column widths. */ - -static int -gdb_update_mem (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - long dummy; - char index[20]; - CORE_ADDR addr; - int nbytes, rnum, bpr; - int size, asize, i, j, bc; - int max_ascii_len, max_val_len, max_label_len; - char format, aschar; - char *data, *tmp; - char buff[128], *mbuf, *mptr, *cptr, *bptr; - struct ui_file *stb; - struct type *val_type; - struct cleanup *old_chain; - - if (objc < 7 || objc > 8) - { - Tcl_WrongNumArgs (interp, 1, objv, "data addr format size bytes bytes_per_row ?ascii_char?"); - return TCL_ERROR; - } - - /* Get table data and link to a local variable */ - data = Tcl_GetStringFromObj (objv[1], NULL); - if (data == NULL) - { - gdbtk_set_result (interp, "could not get data variable"); - return TCL_ERROR; - } - - if (Tcl_UpVar (interp, "1", data, "data", 0) != TCL_OK) - { - gdbtk_set_result (interp, "could not link table data"); - return TCL_ERROR; - } - - if (Tcl_GetIntFromObj (interp, objv[4], &size) != TCL_OK) - return TCL_ERROR; - else if (size <= 0) - { - gdbtk_set_result (interp, "Invalid size, must be > 0"); - return TCL_ERROR; - } - - if (Tcl_GetIntFromObj (interp, objv[5], &nbytes) != TCL_OK) - return TCL_ERROR; - else if (nbytes <= 0) - { - gdbtk_set_result (interp, "Invalid number of bytes, must be > 0"); - return TCL_ERROR; - } - - if (Tcl_GetIntFromObj (interp, objv[6], &bpr) != TCL_OK) - return TCL_ERROR; - else if (bpr <= 0) - { - gdbtk_set_result (interp, "Invalid bytes per row, must be > 0"); - return TCL_ERROR; - } - - tmp = Tcl_GetStringFromObj (objv[2], NULL); - if (tmp == NULL) - { - gdbtk_set_result (interp, "could not get address"); - return TCL_ERROR; - } - addr = string_to_core_addr (tmp); - - format = *(Tcl_GetStringFromObj (objv[3], NULL)); - mbuf = (char *) xmalloc (nbytes + 32); - if (!mbuf) - { - gdbtk_set_result (interp, "Out of memory."); - return TCL_ERROR; - } - - memset (mbuf, 0, nbytes + 32); - mptr = cptr = mbuf; - - rnum = 0; - while (rnum < nbytes) - { - int error; - int num = target_read_memory_partial (addr + rnum, mbuf + rnum, - nbytes - rnum, &error); - if (num <= 0) - break; - rnum += num; - } - - if (objc == 8) - aschar = *(Tcl_GetStringFromObj (objv[7], NULL)); - else - aschar = 0; - - switch (size) - { - case 1: - val_type = builtin_type_int8; - asize = 'b'; - break; - case 2: - val_type = builtin_type_int16; - asize = 'h'; - break; - case 4: - val_type = builtin_type_int32; - asize = 'w'; - break; - case 8: - val_type = builtin_type_int64; - asize = 'g'; - break; - default: - val_type = builtin_type_int8; - asize = 'b'; - } - - bc = 0; /* count of bytes in a row */ - bptr = &buff[0]; /* pointer for ascii dump */ - - /* Open a memory ui_file that we can use to print memory values */ - stb = mem_fileopen (); - old_chain = make_cleanup_ui_file_delete (stb); - - /* A little macro to do column indices. As a rule, given the current - byte, i, of a total nbytes and the bytes per row, bpr, and the size of - each cell, size, the row and column will be given by: - - row = i/bpr - col = (i%bpr)/size - */ -#define INDEX(row,col) sprintf (index, "%d,%d",(row),(col)) - - /* Fill in address labels */ - max_label_len = 0; - for (i = 0; i < nbytes; i += bpr) - { - char s[130]; - sprintf (s, "%s", core_addr_to_string (addr + i)); - INDEX ((int) i/bpr, -1); - Tcl_SetVar2 (interp, "data", index, s, 0); - - /* The tcl code in MemWin::update_addr used to track the size - of each cell. I don't see how these could change for any given - update, so we don't loop over all cells. We just note the first - size. */ - if (max_label_len == 0) - max_label_len = strlen (s); - } - - /* Fill in memory */ - max_val_len = 0; /* Ditto the above comments about max_label_len */ - max_ascii_len = 0; - for (i = 0; i < nbytes; i += size) - { - INDEX ((int) i/bpr, (int) (i%bpr)/size); - - if (i >= rnum) - { - /* Read fewer bytes than requested */ - tmp = "N/A"; - - if (aschar) - { - for (j = 0; j < size; j++) - *bptr++ = 'X'; - } - } - else - { - /* print memory to our uiout file and set the table's variable */ - ui_file_rewind (stb); - print_scalar_formatted (mptr, val_type, format, asize, stb); - tmp = ui_file_xstrdup (stb, &dummy); - - /* See comments above on max_*_len */ - if (max_val_len == 0) - max_val_len = strlen (tmp); - - if (aschar) - { - for (j = 0; j < size; j++) - { - if (isprint (*cptr)) - *bptr++ = *cptr++; - else - { - *bptr++ = aschar; - cptr++;; - } - } - } - } - Tcl_SetVar2 (interp, "data", index, tmp, 0); - - mptr += size; - bc += size; - - if (aschar && (bc >= bpr)) - { - /* end of row. Add it to the result and reset variables */ - *bptr = '\000'; - INDEX (i/bpr, bpr/size); - Tcl_SetVar2 (interp, "data", index, buff, 0); - - /* See comments above on max_*_len */ - if (max_ascii_len == 0) - max_ascii_len = strlen (buff); - - bc = 0; - bptr = &buff[0]; - } - } - - /* return max_*_len so that column widths can be set */ - Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, Tcl_NewIntObj (max_label_len + 1)); - Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, Tcl_NewIntObj (max_val_len + 1)); - Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, Tcl_NewIntObj (max_ascii_len + 1)); - do_cleanups (old_chain); - xfree (mbuf); - return TCL_OK; -#undef INDEX -} - - -/* This implements the tcl command "gdb_loadfile" - * It loads a c source file into a text widget. - * - * Tcl Arguments: - * widget: the name of the text widget to fill - * filename: the name of the file to load - * linenumbers: A boolean indicating whether or not to display line numbers. - * Tcl Result: - * - */ - -/* In this routine, we will build up a "line table", i.e. a - * table of bits showing which lines in the source file are executible. - * LTABLE_SIZE is the number of bytes to allocate for the line table. - * - * Its size limits the maximum number of lines - * in a file to 8 * LTABLE_SIZE. This memory is freed after - * the file is loaded, so it is OK to make this very large. - * Additional memory will be allocated if needed. */ -#define LTABLE_SIZE 20000 -static int -gdb_loadfile (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) -{ - char *file, *widget; - int linenumbers, ln, lnum, ltable_size; - FILE *fp; - char *ltable; - struct symtab *symtab; - struct linetable_entry *le; - long mtime = 0; - struct stat st; - char line[10000], line_num_buf[18]; - const char *text_argv[9]; - Tcl_CmdInfo text_cmd; - - - if (objc != 4) - { - Tcl_WrongNumArgs(interp, 1, objv, "widget filename linenumbers"); - return TCL_ERROR; - } - - widget = Tcl_GetStringFromObj (objv[1], NULL); - if ( Tk_NameToWindow (interp, widget, Tk_MainWindow (interp)) == NULL) - { - return TCL_ERROR; - } - - if (!Tcl_GetCommandInfo (interp, widget, &text_cmd)) - { - gdbtk_set_result (interp, "Can't get widget command info"); - return TCL_ERROR; - } - - file = Tcl_GetStringFromObj (objv[2], NULL); - Tcl_GetBooleanFromObj (interp, objv[3], &linenumbers); - - symtab = lookup_symtab (file); - if (!symtab) - { - gdbtk_set_result (interp, "File not found in symtab"); - return TCL_ERROR; - } - - file = symtab_to_filename ( symtab ); - if ((fp = fopen ( file, "r" )) == NULL) - { - gdbtk_set_result (interp, "Can't open file for reading"); - return TCL_ERROR; - } - - if (stat (file, &st) < 0) - { - catch_errors (perror_with_name_wrapper, "gdbtk: get time stamp", "", - RETURN_MASK_ALL); - return TCL_ERROR; - } - - if (symtab && symtab->objfile && symtab->objfile->obfd) - mtime = bfd_get_mtime(symtab->objfile->obfd); - else if (exec_bfd) - mtime = bfd_get_mtime(exec_bfd); - - if (mtime && mtime < st.st_mtime) - { - gdbtk_ignorable_warning("file_times",\ - "Source file is more recent than executable.\n"); - } - - - /* Source linenumbers don't appear to be in order, and a sort is */ - /* too slow so the fastest solution is just to allocate a huge */ - /* array and set the array entry for each linenumber */ - - ltable_size = LTABLE_SIZE; - ltable = (char *)malloc (LTABLE_SIZE); - if (ltable == NULL) - { - fclose (fp); - gdbtk_set_result (interp, "Out of memory."); - return TCL_ERROR; - } - - memset (ltable, 0, LTABLE_SIZE); - - if (symtab->linetable && symtab->linetable->nitems) - { - le = symtab->linetable->item; - for (ln = symtab->linetable->nitems ;ln > 0; ln--, le++) - { - lnum = le->line >> 3; - if (lnum >= ltable_size) - { - char *new_ltable; - new_ltable = (char *)realloc (ltable, ltable_size*2); - memset (new_ltable + ltable_size, 0, ltable_size); - ltable_size *= 2; - if (new_ltable == NULL) - { - free (ltable); - fclose (fp); - gdbtk_set_result (interp, "Out of memory."); - return TCL_ERROR; - } - ltable = new_ltable; - } - ltable[lnum] |= 1 << (le->line % 8); - } - } - - ln = 1; - - line[0] = '\t'; - text_argv[0] = widget; - text_argv[1] = "insert"; - text_argv[2] = "end"; - text_argv[5] = line; - text_argv[6] = "source_tag"; - text_argv[8] = NULL; - - if (linenumbers) - { - int found_carriage_return = 1; - - line_num_buf[1] = '\t'; - - text_argv[3] = line_num_buf; - - while (fgets (line + 1, 9980, fp)) - { - /* Look for DOS style \r\n endings, and if found, - * strip off the \r. We assume (for the sake of - * speed) that ALL lines in the file have DOS endings, - * or none do. - */ - - if (found_carriage_return) - { - char *p = strrchr(line, '\0') - 2; - if (*p == '\r') - { - *p = '\n'; - *(p + 1) = '\0'; - } - else - found_carriage_return = 0; - } - - sprintf (line_num_buf+2, "%d", ln); - if (ltable[ln >> 3] & (1 << (ln % 8))) - { - line_num_buf[0] = '-'; - text_argv[4] = "break_rgn_tag"; - } - else - { - line_num_buf[0] = ' '; - text_argv[4] = ""; - } - - text_cmd.proc(text_cmd.clientData, interp, 7, text_argv); - ln++; - } - } - else - { - int found_carriage_return = 1; - - while (fgets (line + 1, 9980, fp)) - { - if (found_carriage_return) - { - char *p = strrchr(line, '\0') - 2; - if (*p == '\r') - { - *p = '\n'; - *(p + 1) = '\0'; - } - else - found_carriage_return = 0; - } - - if (ltable[ln >> 3] & (1 << (ln % 8))) - { - text_argv[3] = "- "; - text_argv[4] = "break_rgn_tag"; - } - else - { - text_argv[3] = " "; - text_argv[4] = ""; - } - - text_cmd.proc(text_cmd.clientData, interp, 7, text_argv); - ln++; - } - } - - free (ltable); - fclose (fp); - return TCL_OK; -} - -/* - * This section contains a bunch of miscellaneous utility commands - */ - -/* This implements the tcl command gdb_path_conv - -* On Windows, it canonicalizes the pathname, -* On Unix, it is a no op. -* -* Arguments: -* path -* Tcl Result: -* The canonicalized path. -*/ - -static int -gdb_path_conv (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - if (objc != 2) - { - Tcl_WrongNumArgs (interp, 1, objv, NULL); - return TCL_ERROR; - } - -#ifdef __CYGWIN__ - { - char pathname[256], *ptr; - - cygwin32_conv_to_full_win32_path (Tcl_GetStringFromObj (objv[1], NULL), - pathname); - for (ptr = pathname; *ptr; ptr++) - { - if (*ptr == '\\') - *ptr = '/'; - } - Tcl_SetStringObj (result_ptr->obj_ptr, pathname, -1); - } -#else - Tcl_SetStringObj (result_ptr->obj_ptr, Tcl_GetStringFromObj (objv[1], NULL), - -1); -#endif - - return TCL_OK; -} - -/* - * This section has utility routines that are not Tcl commands. - */ - -static int -perror_with_name_wrapper (PTR args) -{ - perror_with_name (args); - return 1; -} - -/* Look for the function that contains PC and return the source - (demangled) name for this function. - - If no symbol is found, it returns an empty string. In either - case, memory is owned by gdb. Do not attempt to free it. */ -char * -pc_function_name (CORE_ADDR pc) -{ - struct symbol *sym; - char *funcname = NULL; - - /* First lookup the address in the symbol table... */ - sym = find_pc_function (pc); - if (sym != NULL) - funcname = GDBTK_SYMBOL_SOURCE_NAME (sym); - else - { - /* ... if that fails, look it up in the minimal symbols. */ - struct minimal_symbol *msym = NULL; - - msym = lookup_minimal_symbol_by_pc (pc); - if (msym != NULL) - funcname = GDBTK_SYMBOL_SOURCE_NAME (msym); - } - - if (funcname == NULL) - funcname = ""; - - return funcname; -} - -void -gdbtk_set_result (Tcl_Interp *interp, const char *fmt,...) -{ - va_list args; - char *buf; - - va_start (args, fmt); - xvasprintf (&buf, fmt, args); - va_end (args); - Tcl_SetObjResult (interp, Tcl_NewStringObj (buf, -1)); - xfree(buf); -} - - -/* This implements the tcl command 'gdb_incr_addr'. - * It does address arithmetic and outputs a proper - * hex string. This was originally implemented - * when tcl did not support 64-bit values, but we keep - * it because it saves us from having to call incr - * followed by format to get the result in hex. - * Also, it may be true in the future that CORE_ADDRs - * will have their own ALU to deal properly with - * architecture-specific address arithmetic. - * - * Tcl Arguments: - * addr - CORE_ADDR - * number - optional number to add to the address - * default is 1. - * - * Tcl Result: - * hex string containing the result of addr + number - */ - -static int -gdb_incr_addr (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - CORE_ADDR address; - int number = 1; - - if (objc != 2 && objc != 3) - { - Tcl_WrongNumArgs (interp, 1, objv, "CORE_ADDR [number]"); - return TCL_ERROR; - } - - address = string_to_core_addr (Tcl_GetStringFromObj (objv[1], NULL)); - - if (objc == 3) - { - if (Tcl_GetIntFromObj (interp, objv[2], &number) != TCL_OK) - return TCL_ERROR; - } - - address += number; - - Tcl_SetStringObj (result_ptr->obj_ptr, (char *)core_addr_to_string (address), -1); - - return TCL_OK; -} - -/* This implements the tcl command 'gdb_CAS_to_TAS'. - * It takes a CORE_ADDR and outputs a string suitable - * for displaying as the target address. - * - * Note that CORE_ADDRs are internal addresses which map - * to target addresses in different ways depending on the - * architecture. The target address string is a user-readable - * string may be quite different than the CORE_ADDR. For example, - * a CORE_ADDR of 0x02001234 might indicate a data address of - * 0x1234 which this function might someday output as something - * like "D:1234". - * - * Tcl Arguments: - * address - CORE_ADDR - * - * Tcl Result: - * string - */ - -static int -gdb_CA_to_TAS (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - CORE_ADDR address; - Tcl_WideInt wide_addr; - - if (objc != 2) - { - Tcl_WrongNumArgs (interp, 1, objv, "CORE_ADDR"); - return TCL_ERROR; - } - - /* Read address into a wideint, which is the largest tcl supports - then convert to a CORE_ADDR */ - if (Tcl_GetWideIntFromObj (interp, objv[1], &wide_addr) != TCL_OK) - return TCL_ERROR; - address = wide_addr; - - /* This is not really correct. Using paddr_nz() will convert to hex and truncate - to 32-bits when required but will otherwise not do what we really want. */ - Tcl_SetStringObj (result_ptr->obj_ptr, paddr_nz (address), -1); - - return TCL_OK; -} diff --git a/gdb/gdbtk/generic/gdbtk-cmds.h b/gdb/gdbtk/generic/gdbtk-cmds.h deleted file mode 100644 index 8193dae9801..00000000000 --- a/gdb/gdbtk/generic/gdbtk-cmds.h +++ /dev/null @@ -1,57 +0,0 @@ -/* Tcl/Tk command interface for Insight - Copyright 2001 Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - -#if !defined(GDBTK_CMDS_H) -#define GDBTK_CMDS_H 1 - -/* This structure filled in gdbtk_call_wrapper and passed to - the wrapped call function. - It stores the command pointer and arguments - run in the wrapper function. */ -struct wrapped_call_args - { - Tcl_Interp *interp; - Tcl_ObjCmdProc *func; - int objc; - Tcl_Obj *CONST * objv; - int val; - }; - -/* A generic call-wrapper to catch longjmps when calling C commands from - tcl. ALL tcl commands should be wrapped in this call. */ -extern int gdbtk_call_wrapper (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]); - -/* Returns the source (demangled) name for a function at PC. Returns empty string - if not found. Memory is owned by gdb. Do not free it. */ -extern char *pc_function_name (CORE_ADDR pc); - -/* Convenience function to sprintf something(s) into a new element in - a Tcl list object. */ -extern void sprintf_append_element_to_obj (Tcl_Obj * objp, char *format, ...); - -/* printf-like function to return error messages */ -extern void gdbtk_set_result (Tcl_Interp *interp, const char *fmt,...); - -/* Module init routines: Each module of commands should be declared here. */ -extern int Gdbtk_Breakpoint_Init (Tcl_Interp *interp); -extern int Gdbtk_Stack_Init (Tcl_Interp *interp); -extern int Gdbtk_Register_Init (Tcl_Interp *interp); - -#endif /* GDBTK_CMDS_H */ diff --git a/gdb/gdbtk/generic/gdbtk-hooks.c b/gdb/gdbtk/generic/gdbtk-hooks.c deleted file mode 100644 index 39c6348e78a..00000000000 --- a/gdb/gdbtk/generic/gdbtk-hooks.c +++ /dev/null @@ -1,795 +0,0 @@ -/* Startup code for Insight. - - Copyright 1994, 1995, 1996, 1997, 1998, 2000, 200, 2002, 2003 Free - Software Foundation, Inc. - - Written by Stu Grossman <grossman@cygnus.com> of Cygnus Support. - - This file is part of GDB. - - 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. */ - -#include "defs.h" -#include "inferior.h" -#include "symfile.h" -#include "objfiles.h" -#include "gdbcore.h" -#include "tracepoint.h" -#include "demangle.h" -#include "gdb-events.h" -#include "top.h" -#include "annotate.h" -#include "cli/cli-decode.h" - -#ifdef _WIN32 -#define WIN32_LEAN_AND_MEAN -#include <windows.h> -#endif - -/* tcl header files includes varargs.h unless HAS_STDARG is defined, - but gdb uses stdarg.h, so make sure HAS_STDARG is defined. */ -#define HAS_STDARG 1 - -#include <itcl.h> -#include <tcl.h> -#include <tk.h> -#include "guitcl.h" -#include "gdbtk.h" - -#include <signal.h> -#include <fcntl.h> -#include <sys/ioctl.h> -#include <sys/time.h> - -#include "gdb_string.h" -#include "dis-asm.h" -#include "gdbcmd.h" - - -volatile int in_fputs = 0; - -/* Set by gdb_stop, this flag informs x_event to tell its caller - that it should forcibly detach from the target. */ -int gdbtk_force_detach = 0; - -/* From gdbtk-bp.c */ -extern void gdbtk_create_breakpoint (int); -extern void gdbtk_delete_breakpoint (int); -extern void gdbtk_modify_breakpoint (int); -extern void gdbtk_create_tracepoint (int); -extern void gdbtk_delete_tracepoint (int); -extern void gdbtk_modify_tracepoint (int); - -extern void (*pre_add_symbol_hook) (char *); -extern void (*post_add_symbol_hook) (void); -extern void (*selected_frame_level_changed_hook) (int); -extern int (*ui_loop_hook) (int); - -static void gdbtk_architecture_changed (void); -static void gdbtk_trace_find (char *arg, int from_tty); -static void gdbtk_trace_start_stop (int, int); -static void gdbtk_attach (void); -static void gdbtk_detach (void); -static void gdbtk_file_changed (char *); -static void gdbtk_exec_file_display (char *); -static void gdbtk_call_command (struct cmd_list_element *, char *, int); -static ptid_t gdbtk_wait (ptid_t, struct target_waitstatus *); -int x_event (int); -static int gdbtk_query (const char *, va_list); -static void gdbtk_warning (const char *, va_list); -static char *gdbtk_readline (char *); -static void gdbtk_readline_begin (char *format,...); -static void gdbtk_readline_end (void); -static void gdbtk_pre_add_symbol (char *); -static void gdbtk_print_frame_info (struct symtab *, int, int, int); -static void gdbtk_post_add_symbol (void); -static void gdbtk_register_changed (int regno); -static void gdbtk_memory_changed (CORE_ADDR addr, int len); -static void gdbtk_selected_frame_changed (int); -static void gdbtk_context_change (int); -static void gdbtk_error_begin (void); -void report_error (void); -static void gdbtk_annotate_signal (void); -static void gdbtk_set_hook (struct cmd_list_element *cmdblk); - -/* - * gdbtk_fputs can't be static, because we need to call it in gdbtk.c. - * See note there for details. - */ - -void gdbtk_fputs (const char *, struct ui_file *); -static int gdbtk_load_hash (const char *, unsigned long); - -/* - * gdbtk_add_hooks - add all the hooks to gdb. This will get called by the - * startup code to fill in the hooks needed by core gdb. - */ - -void -gdbtk_add_hooks (void) -{ - static struct gdb_events handlers; - - /* Gdb event handlers */ - handlers.breakpoint_create = gdbtk_create_breakpoint; - handlers.breakpoint_modify = gdbtk_modify_breakpoint; - handlers.breakpoint_delete = gdbtk_delete_breakpoint; - handlers.tracepoint_create = gdbtk_create_tracepoint; - handlers.tracepoint_modify = gdbtk_modify_tracepoint; - handlers.tracepoint_delete = gdbtk_delete_tracepoint; - handlers.architecture_changed = gdbtk_architecture_changed; - set_gdb_event_hooks (&handlers); - - /* Hooks */ - call_command_hook = gdbtk_call_command; - set_hook = gdbtk_set_hook; - readline_begin_hook = gdbtk_readline_begin; - readline_hook = gdbtk_readline; - readline_end_hook = gdbtk_readline_end; - - print_frame_info_listing_hook = gdbtk_print_frame_info; - query_hook = gdbtk_query; - warning_hook = gdbtk_warning; - - interactive_hook = gdbtk_interactive; - target_wait_hook = gdbtk_wait; - ui_load_progress_hook = gdbtk_load_hash; - - ui_loop_hook = x_event; - pre_add_symbol_hook = gdbtk_pre_add_symbol; - post_add_symbol_hook = gdbtk_post_add_symbol; - file_changed_hook = gdbtk_file_changed; - specify_exec_file_hook (gdbtk_exec_file_display); - - trace_find_hook = gdbtk_trace_find; - trace_start_stop_hook = gdbtk_trace_start_stop; - - attach_hook = gdbtk_attach; - detach_hook = gdbtk_detach; - - register_changed_hook = gdbtk_register_changed; - memory_changed_hook = gdbtk_memory_changed; - selected_frame_level_changed_hook = gdbtk_selected_frame_changed; - context_hook = gdbtk_context_change; - - error_begin_hook = gdbtk_error_begin; - - annotate_signal_hook = gdbtk_annotate_signal; - annotate_signalled_hook = gdbtk_annotate_signal; -} - -/* These control where to put the gdb output which is created by - {f}printf_{un}filtered and friends. gdbtk_fputs is the lowest - level of these routines and capture all output from the rest of - GDB. - - The reason to use the result_ptr rather than the gdbtk_interp's result - directly is so that a call_wrapper invoked function can preserve its result - across calls into Tcl which might be made in the course of the function's - execution. - - * result_ptr->obj_ptr is where to accumulate the result. - * GDBTK_TO_RESULT flag means the output goes to the gdbtk_tcl_fputs proc - instead of to the result_ptr. - * GDBTK_MAKES_LIST flag means add to the result as a list element. - -*/ - -gdbtk_result *result_ptr = NULL; - -/* If you want to restore an old value of result_ptr whenever cleanups - are run, pass this function to make_cleanup, along with the value - of result_ptr you'd like to reinstate. */ -void -gdbtk_restore_result_ptr (void *old_result_ptr) -{ - result_ptr = (gdbtk_result *) old_result_ptr; -} - -/* This allows you to Tcl_Eval a tcl command which takes - a command word, and then a single argument. */ -int -gdbtk_two_elem_cmd (cmd_name, argv1) - char *cmd_name; - char *argv1; -{ - char *command; - int result, flags_ptr, arg_len, cmd_len; - - arg_len = Tcl_ScanElement (argv1, &flags_ptr); - cmd_len = strlen (cmd_name); - command = malloc (arg_len + cmd_len + 2); - strcpy (command, cmd_name); - strcat (command, " "); - - Tcl_ConvertElement (argv1, command + cmd_len + 1, flags_ptr); - - result = Tcl_Eval (gdbtk_interp, command); - if (result != TCL_OK) - report_error (); - free (command); - return result; -} - -struct ui_file * -gdbtk_fileopen (void) -{ - struct ui_file *file = ui_file_new (); - set_ui_file_fputs (file, gdbtk_fputs); - return file; -} - -/* This handles all the output from gdb. All the gdb printf_xxx functions - * eventually end up here. The output is either passed to the result_ptr - * where it will go to the result of some gdbtk command, or passed to the - * Tcl proc gdbtk_tcl_fputs (where it is usually just dumped to the console - * window. - * - * The cases are: - * - * 1) result_ptr == NULL - This happens when some output comes from gdb which - * is not generated by a command in gdbtk-cmds, usually startup stuff. - * In this case we just route the data to gdbtk_tcl_fputs. - * 2) The GDBTK_TO_RESULT flag is set - The result is supposed to go to Tcl. - * We place the data into the result_ptr, either as a string, - * or a list, depending whether the GDBTK_MAKES_LIST bit is set. - * 3) The GDBTK_TO_RESULT flag is unset - We route the data to gdbtk_tcl_fputs - * UNLESS it was coming to gdb_stderr. Then we place it in the result_ptr - * anyway, so it can be dealt with. - * - */ - -void -gdbtk_fputs (const char *ptr, struct ui_file *stream) -{ - if (gdbtk_disable_fputs) - return; - - in_fputs = 1; - - if (stream == gdb_stdlog) - gdbtk_two_elem_cmd ("gdbtk_tcl_fputs_log", (char *) ptr); - else if (stream == gdb_stdtarg) - gdbtk_two_elem_cmd ("gdbtk_tcl_fputs_target", (char *) ptr); - else if (result_ptr != NULL) - { - if (result_ptr->flags & GDBTK_TO_RESULT) - { - if (result_ptr->flags & GDBTK_MAKES_LIST) - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewStringObj ((char *) ptr, -1)); - else - Tcl_AppendToObj (result_ptr->obj_ptr, (char *) ptr, -1); - } - else if (stream == gdb_stderr || result_ptr->flags & GDBTK_ERROR_ONLY) - { - if (result_ptr->flags & GDBTK_ERROR_STARTED) - Tcl_AppendToObj (result_ptr->obj_ptr, (char *) ptr, -1); - else - { - Tcl_SetStringObj (result_ptr->obj_ptr, (char *) ptr, -1); - result_ptr->flags |= GDBTK_ERROR_STARTED; - } - } - else - { - gdbtk_two_elem_cmd ("gdbtk_tcl_fputs", (char *) ptr); - if (result_ptr->flags & GDBTK_MAKES_LIST) - gdbtk_two_elem_cmd ("gdbtk_tcl_fputs", " "); - } - } - else - { - gdbtk_two_elem_cmd ("gdbtk_tcl_fputs", (char *) ptr); - } - - in_fputs = 0; -} - -/* - * This routes all warnings to the Tcl function "gdbtk_tcl_warning". - */ - -static void -gdbtk_warning (const char *warning, va_list args) -{ - char *buf; - xvasprintf (&buf, warning, args); - gdbtk_two_elem_cmd ("gdbtk_tcl_warning", buf); - free(buf); -} - - -/* Error-handling function for all hooks */ -/* Hooks are not like tcl functions, they do not simply return */ -/* TCL_OK or TCL_ERROR. Also, the calling function typically */ -/* doesn't care about errors in the hook functions. Therefore */ -/* after every hook function, report_error should be called. */ -/* report_error can just call Tcl_BackgroundError() which will */ -/* pop up a messagebox, or it can silently log the errors through */ -/* the gdbtk dbug command. */ - -void -report_error () -{ - TclDebug ('E', Tcl_GetVar (gdbtk_interp, "errorInfo", TCL_GLOBAL_ONLY)); - /* Tcl_BackgroundError(gdbtk_interp); */ -} - -/* - * This routes all ignorable warnings to the Tcl function - * "gdbtk_tcl_ignorable_warning". - */ - -void -gdbtk_ignorable_warning (const char *class, const char *warning) -{ - char *buf; - xasprintf (&buf, "gdbtk_tcl_ignorable_warning {%s} {%s}", class, warning); - if (Tcl_Eval (gdbtk_interp, buf) != TCL_OK) - report_error (); - free(buf); -} - -static void -gdbtk_register_changed (int regno) -{ - if (Tcl_Eval (gdbtk_interp, "gdbtk_register_changed") != TCL_OK) - report_error (); -} - -static void -gdbtk_memory_changed (CORE_ADDR addr, int len) -{ - if (Tcl_Eval (gdbtk_interp, "gdbtk_memory_changed") != TCL_OK) - report_error (); -} - - -/* This hook is installed as the ui_loop_hook, which is used in several - * places to keep the gui alive (x_event runs gdbtk's event loop). Users - * include: - * - ser-tcp.c in socket reading code - * - ser-unix.c in serial port reading code - * - built-in simulators while executing - * - * x_event used to be called on SIGIO on the socket to the X server - * for unix. Unfortunately, Linux does not deliver SIGIO, so we resort - * to an elaborate scheme to keep the gui alive. - * - * For simulators and socket or serial connections on all hosts, we - * rely on ui_loop_hook (x_event) to keep us going. If the user - * requests a detach (as a result of pressing the stop button -- see - * comments before gdb_stop in gdbtk-cmds.c), it sets the global - * GDBTK_FORCE_DETACH, which is the value that x_event returns to - * it's caller. It is up to the caller of x_event to act on this - * information. - * - * For native unix, we simply set an interval timer which calls - * x_event to allow the debugger to run through the Tcl event - * loop. See comments before gdbtk_start_timer and gdb_stop_timer - * in gdbtk.c. - * - * For native windows (and a few other targets, like the v850 ICE), - * we rely on the target_wait loops to call ui_loop_hook to keep us alive. */ -int -x_event (int signo) -{ - static volatile int in_x_event = 0; - static Tcl_Obj *varname = NULL; - - /* Do nor re-enter this code or enter it while collecting gdb output. */ - if (in_x_event || in_fputs) - return 0; - - /* Also, only do things while the target is running (stops and redraws). - FIXME: We wold like to at least redraw at other times but this is bundled - together in the TCL_WINDOW_EVENTS group and we would also process user - input. We will have to prevent (unwanted) user input to be generated - in order to be able to redraw (removing this test here). */ - if (!running_now) - return 0; - - in_x_event = 1; - gdbtk_force_detach = 0; - - /* Process pending events */ - while (Tcl_DoOneEvent (TCL_DONT_WAIT | TCL_ALL_EVENTS) != 0) - ; - - if (load_in_progress) - { - int val; - if (varname == NULL) - { -#if TCL_MAJOR_VERSION == 8 && (TCL_MINOR_VERSION < 1 || TCL_MINOR_VERSION > 2) - Tcl_Obj *varnamestrobj = Tcl_NewStringObj ("download_cancel_ok", -1); - varname = Tcl_ObjGetVar2 (gdbtk_interp, varnamestrobj, NULL, TCL_GLOBAL_ONLY); -#else - varname = Tcl_GetObjVar2 (gdbtk_interp, "download_cancel_ok", NULL, TCL_GLOBAL_ONLY); -#endif - } - if ((Tcl_GetIntFromObj (gdbtk_interp, varname, &val) == TCL_OK) && val) - { - quit_flag = 1; -#ifdef REQUEST_QUIT - REQUEST_QUIT; -#else - if (immediate_quit) - quit (); -#endif - } - } - in_x_event = 0; - - return gdbtk_force_detach; -} - -/* VARARGS */ -static void -gdbtk_readline_begin (char *format,...) -{ - va_list args; - char *buf; - - va_start (args, format); - xvasprintf (&buf, format, args); - gdbtk_two_elem_cmd ("gdbtk_tcl_readline_begin", buf); - free(buf); -} - -static char * -gdbtk_readline (char *prompt) -{ - int result; - -#ifdef _WIN32 - close_bfds (); -#endif - - result = gdbtk_two_elem_cmd ("gdbtk_tcl_readline", prompt); - - if (result == TCL_OK) - { - return (xstrdup (gdbtk_interp->result)); - } - else - { - gdbtk_fputs (gdbtk_interp->result, gdb_stdout); - gdbtk_fputs ("\n", gdb_stdout); - return (NULL); - } -} - -static void -gdbtk_readline_end () -{ - if (Tcl_Eval (gdbtk_interp, "gdbtk_tcl_readline_end") != TCL_OK) - report_error (); -} - -static void -gdbtk_call_command (struct cmd_list_element *cmdblk, - char *arg, int from_tty) -{ - struct cleanup *old_chain; - - old_chain = make_cleanup (null_cleanup, 0); - running_now = 0; - if (cmdblk->class == class_run || cmdblk->class == class_trace) - { - - running_now = 1; - if (!No_Update) - Tcl_Eval (gdbtk_interp, "gdbtk_tcl_busy"); - cmd_func (cmdblk, arg, from_tty); - running_now = 0; - if (!No_Update) - Tcl_Eval (gdbtk_interp, "gdbtk_tcl_idle"); - } - else - cmd_func (cmdblk, arg, from_tty); - - do_cleanups (old_chain); -} - -/* Called after a `set' command succeeds. Runs the Tcl hook - `gdb_set_hook' with the full name of the variable (a Tcl list) as - the first argument and the new value as the second argument. */ - -static void -gdbtk_set_hook (struct cmd_list_element *cmdblk) -{ - Tcl_DString cmd; - char *p; - char *buffer = NULL; - - Tcl_DStringInit (&cmd); - Tcl_DStringAppendElement (&cmd, "gdbtk_tcl_set_variable"); - - /* Append variable name as sublist. */ - Tcl_DStringStartSublist (&cmd); - p = cmdblk->prefixname; - while (p && *p) - { - char *q = strchr (p, ' '); - char save = '\0'; - if (q) - { - save = *q; - *q = '\0'; - } - Tcl_DStringAppendElement (&cmd, p); - if (q) - *q = save; - p = q + 1; - } - Tcl_DStringAppendElement (&cmd, cmdblk->name); - Tcl_DStringEndSublist (&cmd); - - switch (cmdblk->var_type) - { - case var_string_noescape: - case var_filename: - case var_enum: - case var_string: - Tcl_DStringAppendElement (&cmd, (*(char **) cmdblk->var - ? *(char **) cmdblk->var - : "(null)")); - break; - - case var_boolean: - Tcl_DStringAppendElement (&cmd, (*(int *) cmdblk->var ? "1" : "0")); - break; - - case var_uinteger: - case var_zinteger: - xasprintf (&buffer, "%u", *(unsigned int *) cmdblk->var); - Tcl_DStringAppendElement (&cmd, buffer); - break; - - case var_integer: - xasprintf (&buffer, "%d", *(int *) cmdblk->var); - Tcl_DStringAppendElement (&cmd, buffer); - break; - - default: - /* This case should already be trapped by the hook caller. */ - Tcl_DStringAppendElement (&cmd, "error"); - break; - } - - if (Tcl_Eval (gdbtk_interp, Tcl_DStringValue (&cmd)) != TCL_OK) - report_error (); - - Tcl_DStringFree (&cmd); - - if (buffer != NULL) - { - free(buffer); - } -} - -int -gdbtk_load_hash (const char *section, unsigned long num) -{ - char *buf; - xasprintf (&buf, "Download::download_hash %s %ld", section, num); - if (Tcl_Eval (gdbtk_interp, buf) != TCL_OK) - report_error (); - free(buf); - - return atoi (gdbtk_interp->result); -} - - -/* This hook is called whenever we are ready to load a symbol file so that - the UI can notify the user... */ -static void -gdbtk_pre_add_symbol (char *name) -{ - gdbtk_two_elem_cmd ("gdbtk_tcl_pre_add_symbol", name); -} - -/* This hook is called whenever we finish loading a symbol file. */ -static void -gdbtk_post_add_symbol () -{ - if (Tcl_Eval (gdbtk_interp, "gdbtk_tcl_post_add_symbol") != TCL_OK) - report_error (); -} - -/* This hook function is called whenever we want to wait for the - target. */ - -static ptid_t -gdbtk_wait (ptid_t ptid, struct target_waitstatus *ourstatus) -{ - gdbtk_force_detach = 0; - gdbtk_start_timer (); - ptid = target_wait (ptid, ourstatus); - gdbtk_stop_timer (); - - return ptid; -} - -/* - * This handles all queries from gdb. - * The first argument is a printf style format statement, the rest are its - * arguments. The resultant formatted string is passed to the Tcl function - * "gdbtk_tcl_query". - * It returns the users response to the query, as well as putting the value - * in the result field of the Tcl interpreter. - */ - -static int -gdbtk_query (const char *query, va_list args) -{ - char *buf; - long val; - - xvasprintf (&buf, query, args); - gdbtk_two_elem_cmd ("gdbtk_tcl_query", buf); - free(buf); - - val = atol (gdbtk_interp->result); - return val; -} - - -static void -gdbtk_print_frame_info (struct symtab *s, int line, - int stopline, int noerror) -{ -} - -/* - * gdbtk_trace_find - * - * This is run by the trace_find_command. arg is the argument that was passed - * to that command, from_tty is 1 if the command was run from a tty, 0 if it - * was run from a script. It runs gdbtk_tcl_tfind_hook passing on these two - * arguments. - * - */ - -static void -gdbtk_trace_find (char *arg, int from_tty) -{ - Tcl_Obj *cmdObj; - - cmdObj = Tcl_NewListObj (0, NULL); - Tcl_ListObjAppendElement (gdbtk_interp, cmdObj, - Tcl_NewStringObj ("gdbtk_tcl_trace_find_hook", -1)); - Tcl_ListObjAppendElement (gdbtk_interp, cmdObj, Tcl_NewStringObj (arg, -1)); - Tcl_ListObjAppendElement (gdbtk_interp, cmdObj, Tcl_NewIntObj (from_tty)); -#if TCL_MAJOR_VERSION == 8 && (TCL_MINOR_VERSION < 1 || TCL_MINOR_VERSION > 2) - if (Tcl_GlobalEvalObj (gdbtk_interp, cmdObj) != TCL_OK) - report_error (); -#else - if (Tcl_EvalObj (gdbtk_interp, cmdObj, TCL_EVAL_GLOBAL) != TCL_OK) - report_error (); -#endif -} - -/* - * gdbtk_trace_start_stop - * - * This is run by the trace_start_command and trace_stop_command. - * The START variable determines which, 1 meaning trace_start was run, - * 0 meaning trace_stop was run. - * - */ - -static void -gdbtk_trace_start_stop (int start, int from_tty) -{ - - if (start) - Tcl_GlobalEval (gdbtk_interp, "gdbtk_tcl_tstart"); - else - Tcl_GlobalEval (gdbtk_interp, "gdbtk_tcl_tstop"); - -} - -static void -gdbtk_selected_frame_changed (int level) -{ -#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 1 - char *a; - xasprintf (&a, "%d", level); - Tcl_SetVar (gdbtk_interp, "gdb_selected_frame_level", a, TCL_GLOBAL_ONLY); - xfree (a); -#else - Tcl_SetVar2Ex (gdbtk_interp, "gdb_selected_frame_level", NULL, - Tcl_NewIntObj (level), TCL_GLOBAL_ONLY); -#endif -} - -/* Called when the current thread changes. */ -/* gdb_context is linked to the tcl variable "gdb_context_id" */ -static void -gdbtk_context_change (int num) -{ - gdb_context = num; -} - -/* Called from file_command */ -static void -gdbtk_file_changed (char *filename) -{ - gdbtk_two_elem_cmd ("gdbtk_tcl_file_changed", filename); -} - -/* Called from exec_file_command */ -static void -gdbtk_exec_file_display (char *filename) -{ - gdbtk_two_elem_cmd ("gdbtk_tcl_exec_file_display", filename); -} - -/* Called from error_begin, this hook is used to warn the gui - about multi-line error messages */ -static void -gdbtk_error_begin () -{ - if (result_ptr != NULL) - result_ptr->flags |= GDBTK_ERROR_ONLY; -} - -/* notify GDBtk when a signal occurs */ -static void -gdbtk_annotate_signal () -{ - char *buf; - - /* Inform gui that the target has stopped. This is - a necessary stop button evil. We don't want signal notification - to interfere with the elaborate and painful stop button detach - timeout. */ - Tcl_Eval (gdbtk_interp, "gdbtk_stop_idle_callback"); - - xasprintf (&buf, "gdbtk_signal %s {%s}", target_signal_to_name (stop_signal), - target_signal_to_string (stop_signal)); - if (Tcl_Eval (gdbtk_interp, buf) != TCL_OK) - report_error (); - free(buf); -} - -static void -gdbtk_attach () -{ - if (Tcl_Eval (gdbtk_interp, "after idle \"update idletasks;gdbtk_attached\"") != TCL_OK) - { - report_error (); - } -} - -static void -gdbtk_detach () -{ - if (Tcl_Eval (gdbtk_interp, "gdbtk_detached") != TCL_OK) - { - report_error (); - } -} - -/* Called from gdbarch_update_p whenever the architecture changes. */ -static void -gdbtk_architecture_changed (void) -{ - Tcl_Eval (gdbtk_interp, "gdbtk_tcl_architecture_changed"); -} diff --git a/gdb/gdbtk/generic/gdbtk-interp.c b/gdb/gdbtk/generic/gdbtk-interp.c deleted file mode 100644 index 1fc1b64a1ff..00000000000 --- a/gdb/gdbtk/generic/gdbtk-interp.c +++ /dev/null @@ -1,177 +0,0 @@ -/* Insight Definitions for GDB, the GNU debugger. - Written by Keith Seitz <kseitz@uglyboxes.com> - - Copyright 2003 Free Software Foundation, Inc. - - This file is part of Insight. - - 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. */ - -#include "defs.h" -#include "interps.h" -#include "ui-file.h" -#include "ui-out.h" -#include "cli-out.h" -#include "gdb_string.h" -#include "cli/cli-cmds.h" -#include "cli/cli-decode.h" - -#include "tcl.h" -#include "tk.h" -#include "gdbtk.h" - -static void gdbtk_command_loop (void); -static void hack_disable_interpreter_exec (char *, int); - -struct gdbtk_interp_data -{ - struct ui_file *_stdout; - struct ui_file *_stderr; - struct ui_file *_stdlog; - struct ui_file *_stdtarg; -}; - -static struct gdbtk_interp_data *gdbtk_data; - -/* See note in gdbtk_interpreter_init */ -static void -hack_disable_interpreter_exec (char *args, int from_tty) -{ - error ("interpreter-exec not available when running Insight"); -} - -static void * -gdbtk_interpreter_init (void) -{ - /* Disable interpreter-exec. It causes us big trouble right now. */ - struct cmd_list_element *cmd = NULL; - struct cmd_list_element *alias = NULL; - struct cmd_list_element *prefix = NULL; - - gdbtk_init (); - - if (lookup_cmd_composition ("interpreter-exec", &alias, &prefix, &cmd)) - { - set_cmd_cfunc (cmd, hack_disable_interpreter_exec); - } - - return gdbtk_data; -} - -static int -gdbtk_interpreter_resume (void *data) -{ - static int started = 0; - struct gdbtk_interp_data *d = (struct gdbtk_interp_data *) data; - gdbtk_add_hooks (); - - gdb_stdout = d->_stdout; - gdb_stderr = d->_stderr; - gdb_stdlog = d->_stdlog; - gdb_stdtarg = d->_stdtarg; - - command_loop_hook = gdbtk_command_loop; - - /* 2003-02-11 keiths: We cannot actually source our main Tcl file in - our interpreter's init function because any errors that may - get generated will go to the wrong gdb_stderr. Instead of hacking - our interpreter init function to force gdb_stderr to our ui_file, - we defer sourcing the startup file until now, when gdb is ready - to let our interpreter run. */ - if (!started) - { - started = 1; - gdbtk_source_start_file (); - } - - return 1; -} - -static int -gdbtk_interpreter_suspend (void *data) -{ - return 1; -} - -static int -gdbtk_interpreter_display_prompt_p (void *data) -{ - return 1; -} - -static int -gdbtk_interpreter_exec (void *data, const char *command_str) -{ - return 1; -} - -/* This function is called instead of gdb's internal command loop. This is the - last chance to do anything before entering the main Tk event loop. - At the end of the command, we enter the main loop. */ - -static void -gdbtk_command_loop (void) -{ - extern FILE *instream; - - /* We no longer want to use stdin as the command input stream */ - instream = NULL; - - if (Tcl_Eval (gdbtk_interp, "gdbtk_tcl_preloop") != TCL_OK) - { - const char *msg; - - /* Force errorInfo to be set up propertly. */ - Tcl_AddErrorInfo (gdbtk_interp, ""); - - msg = Tcl_GetVar (gdbtk_interp, "errorInfo", TCL_GLOBAL_ONLY); -#ifdef _WIN32 - MessageBox (NULL, msg, NULL, MB_OK | MB_ICONERROR | MB_TASKMODAL); -#else - fputs_unfiltered (msg, gdb_stderr); -#endif - } - -#ifdef _WIN32 - close_bfds (); -#endif - - Tk_MainLoop (); -} - -void -_initialize_gdbtk_interp (void) -{ - static const struct interp_procs procs = { - gdbtk_interpreter_init, /* init_proc */ - gdbtk_interpreter_resume, /* resume_proc */ - gdbtk_interpreter_suspend, /* suspend_proc */ - gdbtk_interpreter_exec, /* exec_proc */ - gdbtk_interpreter_display_prompt_p /* prompt_proc_p */ - }; - struct interp *gdbtk_interp; - - gdbtk_data = - (struct gdbtk_interp_data *) xmalloc (sizeof (struct gdbtk_interp_data)); - memset (gdbtk_data, 0, sizeof (struct gdbtk_interp_data)); - gdbtk_data->_stdout = gdbtk_fileopen (); - gdbtk_data->_stderr = gdbtk_fileopen (); - gdbtk_data->_stdlog = gdbtk_fileopen (); - gdbtk_data->_stdtarg = gdbtk_fileopen (); - gdbtk_interp = interp_new ("insight", gdbtk_data, cli_out_new (gdbtk_data->_stdout), - &procs); - interp_add (gdbtk_interp); -} diff --git a/gdb/gdbtk/generic/gdbtk-main.c b/gdb/gdbtk/generic/gdbtk-main.c deleted file mode 100644 index 32e54249d8c..00000000000 --- a/gdb/gdbtk/generic/gdbtk-main.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Main function for gdb with insight. - - Copyright 2002 Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - - -#include "defs.h" -#include "main.h" -#include "gdb_string.h" - -int -main (int argc, char **argv) -{ - struct captured_main_args args; - memset (&args, 0, sizeof args); - args.argc = argc; - args.argv = argv; - args.use_windows = 1; - args.interpreter_p = "insight"; - return gdb_main (&args); -} diff --git a/gdb/gdbtk/generic/gdbtk-register.c b/gdb/gdbtk/generic/gdbtk-register.c deleted file mode 100644 index 56bb135644a..00000000000 --- a/gdb/gdbtk/generic/gdbtk-register.c +++ /dev/null @@ -1,581 +0,0 @@ -/* Tcl/Tk command definitions for Insight - Registers - Copyright 2001, 2002 Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - -#include "defs.h" -#include "frame.h" -#include "regcache.h" -#include "reggroups.h" -#include "value.h" -#include "target.h" -#include "gdb_string.h" - -#include <tcl.h> -#include "gdbtk.h" -#include "gdbtk-cmds.h" - -/* This contains the previous values of the registers, since the last call to - gdb_changed_register_list. - - It is an array of (NUM_REGS+NUM_PSEUDO_REGS)*MAX_REGISTER_RAW_SIZE bytes. */ - -static int gdb_register_info (ClientData, Tcl_Interp *, int, Tcl_Obj **); -static void get_register (int, void *); -static void get_register_name (int, void *); -static void get_register_size (int regnum, void *arg); -static int map_arg_registers (Tcl_Interp *, int, Tcl_Obj **, - void (*)(int, void *), void *); -static void register_changed_p (int, void *); -static void setup_architecture_data (void); -static int gdb_regformat (ClientData, Tcl_Interp *, int, Tcl_Obj **); -static int gdb_reggroup (ClientData, Tcl_Interp *, int, Tcl_Obj **); -static int gdb_reggrouplist (ClientData, Tcl_Interp *, int, Tcl_Obj **); - -static void get_register_types (int regnum, void *arg); - -static char *old_regs = NULL; -static int *regformat = (int *)NULL; -static struct type **regtype = (struct type **)NULL; - -int -Gdbtk_Register_Init (Tcl_Interp *interp) -{ - Tcl_CreateObjCommand (interp, "gdb_reginfo", gdbtk_call_wrapper, - gdb_register_info, NULL); - - /* Register/initialize any architecture specific data */ - setup_architecture_data (); - - deprecated_register_gdbarch_swap (&old_regs, sizeof (old_regs), NULL); - deprecated_register_gdbarch_swap (®format, sizeof (regformat), NULL); - deprecated_register_gdbarch_swap (®type, sizeof (regtype), NULL); - deprecated_register_gdbarch_swap (NULL, 0, setup_architecture_data); - - return TCL_OK; -} - -/* This implements the tcl command "gdb_reginfo". - * It returns the requested information about registers. - * - * Tcl Arguments: - * OPTION - "changed", "name", "size", "value" (see below) - * REGNUM(S) - the register(s) for which info is requested - * - * Tcl Result: - * The requested information - * - * Options: - * changed - * Returns a list of registers whose values have changed since the - * last time the proc was called. - * - * usage: gdb_reginfo changed [regnum0, ..., regnumN] - * - * name - * Return a list containing the names of the registers whose numbers - * are given by REGNUM ... . If no register numbers are given, return - * all the registers' names. - * - * usage: gdb_reginfo name [-numbers] [regnum0, ..., regnumN] - * - * Note that some processors have gaps in the register numberings: - * even if there is no register numbered N, there may still be a - * register numbered N+1. So if you call gdb_regnames with no - * arguments, you can't assume that the N'th element of the result is - * register number N. - * - * Given the -numbers option, gdb_regnames returns, not a list of names, - * but a list of pairs {NAME NUMBER}, where NAME is the register name, - * and NUMBER is its number. - * - * size - * Returns the raw size of the register(s) in bytes. - * - * usage: gdb_reginfo size [regnum0, ..., regnumN] - * - * value - * Returns a list of register values. - * - * usage: gdb_reginfo value [regnum0, ..., regnumN] - */ -static int -gdb_register_info (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj **objv) -{ - int index; - void *argp; - void (*func)(int, void *); - static const char *commands[] = {"changed", "name", "size", "value", "type", - "format", "group", "grouplist", NULL}; - enum commands_enum { REGINFO_CHANGED, REGINFO_NAME, REGINFO_SIZE, REGINFO_VALUE, - REGINFO_TYPE, REGINFO_FORMAT, REGINFO_GROUP, REGINFO_GROUPLIST }; - - if (objc < 2) - { - Tcl_WrongNumArgs (interp, 1, objv, "name|size|value|type|format|groups [regnum1 ... regnumN]"); - return TCL_ERROR; - } - - if (Tcl_GetIndexFromObj (interp, objv[1], commands, "options", 0, - &index) != TCL_OK) - { - result_ptr->flags |= GDBTK_IN_TCL_RESULT; - return TCL_ERROR; - } - - /* Skip the option */ - objc -= 2; - objv += 2; - - switch ((enum commands_enum) index) - { - case REGINFO_CHANGED: - func = register_changed_p; - argp = NULL; - break; - - case REGINFO_NAME: - { - int len; - char *s = Tcl_GetStringFromObj (objv[0], &len); - if (objc != 0 && strncmp (s, "-numbers", len) == 0) - { - argp = (void *) 1; - objc--; - objv++; - } - else - argp = NULL; - - func = get_register_name; - } - break; - - case REGINFO_SIZE: - func = get_register_size; - argp = NULL; - break; - - case REGINFO_VALUE: - func = get_register; - argp = NULL; - break; - - case REGINFO_TYPE: - func = get_register_types; - argp = NULL; - break; - - case REGINFO_FORMAT: - return gdb_regformat (clientData, interp, objc, objv); - - case REGINFO_GROUP: - return gdb_reggroup (clientData, interp, objc, objv); - - case REGINFO_GROUPLIST: - return gdb_reggrouplist (clientData, interp, objc, objv); - - default: - return TCL_ERROR; - } - - return map_arg_registers (interp, objc, objv, func, argp); -} - -static void -get_register_size (int regnum, void *arg) -{ - Tcl_ListObjAppendElement (gdbtk_interp, result_ptr->obj_ptr, - Tcl_NewIntObj (DEPRECATED_REGISTER_RAW_SIZE - (regnum))); -} - -/* returns a list of valid types for a register */ -/* Normally this will be only one type, except for SIMD and other */ -/* special registers. */ - -static void -get_register_types (int regnum, void *arg) -{ - struct type *reg_vtype; - int i,n; - - reg_vtype = register_type (current_gdbarch, regnum); - - if (TYPE_CODE (reg_vtype) == TYPE_CODE_UNION) - { - n = TYPE_NFIELDS (reg_vtype); - /* limit to 16 types */ - if (n > 16) - n = 16; - - for (i = 0; i < n; i++) - { - Tcl_Obj *ar[3], *list; - char *buff; - xasprintf (&buff, "%lx", (long)TYPE_FIELD_TYPE (reg_vtype, i)); - ar[0] = Tcl_NewStringObj (TYPE_FIELD_NAME (reg_vtype, i), -1); - ar[1] = Tcl_NewStringObj (buff, -1); - if (TYPE_CODE (TYPE_FIELD_TYPE (reg_vtype, i)) == TYPE_CODE_FLT) - ar[2] = Tcl_NewStringObj ("float", -1); - else - ar[2] = Tcl_NewStringObj ("int", -1); - list = Tcl_NewListObj (3, ar); - Tcl_ListObjAppendElement (gdbtk_interp, result_ptr->obj_ptr, list); - xfree (buff); - } - } - else - { - Tcl_Obj *ar[3], *list; - char *buff; - xasprintf (&buff, "%lx", (long)reg_vtype); - ar[0] = Tcl_NewStringObj (TYPE_NAME(reg_vtype), -1); - ar[1] = Tcl_NewStringObj (buff, -1); - if (TYPE_CODE (reg_vtype) == TYPE_CODE_FLT) - ar[2] = Tcl_NewStringObj ("float", -1); - else - ar[2] = Tcl_NewStringObj ("int", -1); - list = Tcl_NewListObj (3, ar); - xfree (buff); - Tcl_ListObjAppendElement (gdbtk_interp, result_ptr->obj_ptr, list); - } -} - - -static void -get_register (int regnum, void *arg) -{ - int realnum; - CORE_ADDR addr; - enum lval_type lval; - struct type *reg_vtype; - char raw_buffer[MAX_REGISTER_SIZE]; - char virtual_buffer[MAX_REGISTER_SIZE]; - int optim, format; - struct cleanup *old_chain = NULL; - struct ui_file *stb; - long dummy; - char *res; - - format = regformat[regnum]; - if (format == 0) - format = 'x'; - - reg_vtype = regtype[regnum]; - if (reg_vtype == NULL) - reg_vtype = register_type (current_gdbarch, regnum); - - if (!target_has_registers) - { - if (result_ptr->flags & GDBTK_MAKES_LIST) - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, Tcl_NewStringObj ("", -1)); - else - Tcl_SetStringObj (result_ptr->obj_ptr, "", -1); - return; - } - - frame_register (get_selected_frame (), regnum, &optim, &lval, - &addr, &realnum, raw_buffer); - - if (optim) - { - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, - Tcl_NewStringObj ("Optimized out", -1)); - return; - } - - /* Convert raw data to virtual format if necessary. */ - if (DEPRECATED_REGISTER_CONVERTIBLE (regnum)) - { - DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (regnum, reg_vtype, - raw_buffer, virtual_buffer); - } - else - memcpy (virtual_buffer, raw_buffer, - DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum)); - - stb = mem_fileopen (); - old_chain = make_cleanup_ui_file_delete (stb); - - if (format == 'r') - { - /* shouldn't happen. raw format is deprecated */ - int j; - char *ptr, buf[1024]; - - strcpy (buf, "0x"); - ptr = buf + 2; - for (j = 0; j < DEPRECATED_REGISTER_RAW_SIZE (regnum); j++) - { - int idx = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? j - : DEPRECATED_REGISTER_RAW_SIZE (regnum) - 1 - j; - sprintf (ptr, "%02x", (unsigned char) raw_buffer[idx]); - ptr += 2; - } - fputs_unfiltered (buf, stb); - } - else - { - if ((TYPE_CODE (reg_vtype) == TYPE_CODE_UNION) - && (strcmp (FIELD_NAME (TYPE_FIELD (reg_vtype, 0)), - REGISTER_NAME (regnum)) == 0)) - { - val_print (FIELD_TYPE (TYPE_FIELD (reg_vtype, 0)), virtual_buffer, 0, 0, - stb, format, 1, 0, Val_pretty_default); - } - else - val_print (reg_vtype, virtual_buffer, 0, 0, - stb, format, 1, 0, Val_pretty_default); - } - - res = ui_file_xstrdup (stb, &dummy); - - if (result_ptr->flags & GDBTK_MAKES_LIST) - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, Tcl_NewStringObj (res, -1)); - else - Tcl_SetStringObj (result_ptr->obj_ptr, res, -1); - - xfree (res); - do_cleanups (old_chain); -} - -static void -get_register_name (int regnum, void *argp) -{ - /* Non-zero if the caller wants the register numbers, too. */ - int numbers = (int) argp; - Tcl_Obj *name = Tcl_NewStringObj (REGISTER_NAME (regnum), -1); - Tcl_Obj *elt; - - if (numbers) - { - /* Build a tuple of the form "{REGNAME NUMBER}", and append it to - our result. */ - Tcl_Obj *array[2]; - - array[0] = name; - array[1] = Tcl_NewIntObj (regnum); - elt = Tcl_NewListObj (2, array); - } - else - elt = name; - - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, elt); -} - -/* This is a sort of mapcar function for operations on registers */ - -static int -map_arg_registers (Tcl_Interp *interp, int objc, Tcl_Obj **objv, - void (*func) (int regnum, void *argp), void *argp) -{ - int regnum, numregs; - - /* Note that the test for a valid register must include checking the - REGISTER_NAME because NUM_REGS may be allocated for the union of - the register sets within a family of related processors. In this - case, some entries of REGISTER_NAME will change depending upon - the particular processor being debugged. */ - - numregs = NUM_REGS + NUM_PSEUDO_REGS; - - if (objc == 0) /* No args, just do all the regs */ - { - result_ptr->flags |= GDBTK_MAKES_LIST; - for (regnum = 0; regnum < numregs; regnum++) - { - if (REGISTER_NAME (regnum) == NULL - || *(REGISTER_NAME (regnum)) == '\0') - continue; - func (regnum, argp); - } - return TCL_OK; - } - - if (objc == 1) - if (Tcl_ListObjGetElements (interp, *objv, &objc, &objv ) != TCL_OK) - return TCL_ERROR; - - if (objc > 1) - result_ptr->flags |= GDBTK_MAKES_LIST; - - /* Else, list of register #s, just do listed regs */ - for (; objc > 0; objc--, objv++) - { - if (Tcl_GetIntFromObj (NULL, *objv, ®num) != TCL_OK) - { - result_ptr->flags |= GDBTK_IN_TCL_RESULT; - return TCL_ERROR; - } - - if (regnum >= 0 && regnum < numregs - && REGISTER_NAME (regnum) != NULL - && *REGISTER_NAME (regnum) != '\000') - func (regnum, argp); - else - { - Tcl_SetStringObj (result_ptr->obj_ptr, "bad register number", -1); - return TCL_ERROR; - } - } - return TCL_OK; -} - -static void -register_changed_p (int regnum, void *argp) -{ - char raw_buffer[MAX_REGISTER_SIZE]; - - if (deprecated_selected_frame == NULL - || !frame_register_read (deprecated_selected_frame, regnum, raw_buffer)) - return; - - if (memcmp (&old_regs[regnum * MAX_REGISTER_SIZE], raw_buffer, - DEPRECATED_REGISTER_RAW_SIZE (regnum)) == 0) - return; - - /* Found a changed register. Save new value and return its number. */ - - memcpy (&old_regs[regnum * MAX_REGISTER_SIZE], raw_buffer, - DEPRECATED_REGISTER_RAW_SIZE (regnum)); - - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, Tcl_NewIntObj (regnum)); -} - -static void -setup_architecture_data () -{ - xfree (old_regs); - xfree (regformat); - xfree (regtype); - - old_regs = xcalloc (1, (NUM_REGS + NUM_PSEUDO_REGS) * MAX_REGISTER_SIZE + 1); - regformat = (int *)xcalloc ((NUM_REGS + NUM_PSEUDO_REGS) , sizeof(int)); - regtype = (struct type **)xcalloc ((NUM_REGS + NUM_PSEUDO_REGS), sizeof(struct type **)); -} - -/* gdb_regformat sets the format for a register */ -/* This is necessary to allow "gdb_reginfo value" to return a list */ -/* of registers and values. */ -/* Usage: gdb_reginfo format regno typeaddr format */ - -static int -gdb_regformat (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj **objv) -{ - int fm, regno; - struct type *type; - - if (objc != 3) - { - Tcl_WrongNumArgs (interp, 0, objv, "gdb_reginfo regno type format"); - return TCL_ERROR; - } - - if (Tcl_GetIntFromObj (interp, objv[0], ®no) != TCL_OK) - return TCL_ERROR; - - type = (struct type *)strtol (Tcl_GetStringFromObj (objv[1], NULL), NULL, 16); - fm = (int)*(Tcl_GetStringFromObj (objv[2], NULL)); - - if (regno >= NUM_REGS + NUM_PSEUDO_REGS) - { - gdbtk_set_result (interp, "Register number %d too large", regno); - return TCL_ERROR; - } - - regformat[regno] = fm; - regtype[regno] = type; - - return TCL_OK; -} - - -/* gdb_reggrouplist returns the names of the register groups */ -/* for the current architecture. */ -/* Usage: gdb_reginfo groups */ - -static int -gdb_reggrouplist (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj **objv) -{ - struct reggroup *group; - int i = 0; - - if (objc != 0) - { - Tcl_WrongNumArgs (interp, 0, objv, "gdb_reginfo grouplist"); - return TCL_ERROR; - } - - for (group = reggroup_next (current_gdbarch, NULL); - group != NULL; - group = reggroup_next (current_gdbarch, group)) - { - if (reggroup_type (group) == USER_REGGROUP) - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, Tcl_NewStringObj (reggroup_name (group), -1)); - } - return TCL_OK; -} - - -/* gdb_reggroup returns the names of the registers in a group. */ -/* Usage: gdb_reginfo group groupname */ - -static int -gdb_reggroup (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj **objv) -{ - struct reggroup *group; - char *groupname; - int regnum; - - if (objc != 1) - { - Tcl_WrongNumArgs (interp, 0, objv, "gdb_reginfo group groupname"); - return TCL_ERROR; - } - - groupname = Tcl_GetStringFromObj (objv[0], NULL); - if (groupname == NULL) - { - gdbtk_set_result (interp, "could not read groupname"); - return TCL_ERROR; - } - - for (group = reggroup_next (current_gdbarch, NULL); - group != NULL; - group = reggroup_next (current_gdbarch, group)) - { - if (strcmp (groupname, reggroup_name (group)) == 0) - break; - } - - if (group == NULL) - return TCL_ERROR; - - for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++) - { - if (gdbarch_register_reggroup_p (current_gdbarch, regnum, group)) - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, Tcl_NewIntObj (regnum)); - } - return TCL_OK; -} - diff --git a/gdb/gdbtk/generic/gdbtk-stack.c b/gdb/gdbtk/generic/gdbtk-stack.c deleted file mode 100644 index 0838d5cf489..00000000000 --- a/gdb/gdbtk/generic/gdbtk-stack.c +++ /dev/null @@ -1,623 +0,0 @@ -/* Tcl/Tk command definitions for Insight - Stack. - Copyright 2001, 2002, 2003 Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - -#include "defs.h" -#include "target.h" -#include "breakpoint.h" -#include "linespec.h" -#include "block.h" -#include "dictionary.h" - -#include <tcl.h> -#include "gdbtk.h" -#include "gdbtk-cmds.h" -#include "gdbtk-wrapper.h" - -static int gdb_block_vars (ClientData clientData, - Tcl_Interp * interp, int objc, - Tcl_Obj * CONST objv[]); -static int gdb_get_args_command (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST objv[]); -static int gdb_get_blocks (ClientData clientData, - Tcl_Interp * interp, int objc, - Tcl_Obj * CONST objv[]); -static int gdb_get_locals_command (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST objv[]); -static int gdb_get_vars_command (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST objv[]); -static int gdb_selected_block (ClientData clientData, - Tcl_Interp * interp, int argc, - Tcl_Obj * CONST objv[]); -static int gdb_selected_frame (ClientData clientData, - Tcl_Interp * interp, int argc, - Tcl_Obj * CONST objv[]); -static int gdb_stack (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]); -static void get_frame_name (Tcl_Interp *interp, Tcl_Obj *list, - struct frame_info *fi); - -int -Gdbtk_Stack_Init (Tcl_Interp *interp) -{ - Tcl_CreateObjCommand (interp, "gdb_block_variables", gdbtk_call_wrapper, - gdb_block_vars, NULL); - Tcl_CreateObjCommand (interp, "gdb_get_blocks", gdbtk_call_wrapper, - gdb_get_blocks, NULL); - Tcl_CreateObjCommand (interp, "gdb_get_args", gdbtk_call_wrapper, - gdb_get_args_command, NULL); - Tcl_CreateObjCommand (interp, "gdb_get_locals", gdbtk_call_wrapper, - gdb_get_locals_command, NULL); - Tcl_CreateObjCommand (interp, "gdb_selected_block", gdbtk_call_wrapper, - gdb_selected_block, NULL); - Tcl_CreateObjCommand (interp, "gdb_selected_frame", gdbtk_call_wrapper, - gdb_selected_frame, NULL); - Tcl_CreateObjCommand (interp, "gdb_stack", gdbtk_call_wrapper, gdb_stack, NULL); - - return TCL_OK; -} - -/* This implements the tcl command gdb_block_vars. - * - * Returns all variables valid in the specified block. - * - * Arguments: - * The start and end addresses which identify the block. - * Tcl Result: - * All variables defined in the given block. - */ -static int -gdb_block_vars (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - struct block *block; - struct dict_iterator iter; - struct symbol *sym; - CORE_ADDR start, end; - - if (objc < 3) - { - Tcl_WrongNumArgs (interp, 1, objv, "startAddr endAddr"); - return TCL_ERROR; - } - - Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL); - if (deprecated_selected_frame == NULL) - return TCL_OK; - - start = string_to_core_addr (Tcl_GetStringFromObj (objv[1], NULL)); - end = string_to_core_addr (Tcl_GetStringFromObj (objv[2], NULL)); - - block = get_frame_block (deprecated_selected_frame, 0); - - while (block != 0) - { - if (BLOCK_START (block) == start && BLOCK_END (block) == end) - { - ALL_BLOCK_SYMBOLS (block, iter, sym) - { - switch (SYMBOL_CLASS (sym)) - { - case LOC_ARG: /* argument */ - case LOC_REF_ARG: /* reference arg */ - case LOC_REGPARM: /* register arg */ - case LOC_REGPARM_ADDR: /* indirect register arg */ - case LOC_LOCAL_ARG: /* stack arg */ - case LOC_BASEREG_ARG: /* basereg arg */ - case LOC_LOCAL: /* stack local */ - case LOC_BASEREG: /* basereg local */ - case LOC_STATIC: /* static */ - case LOC_REGISTER: /* register */ - case LOC_COMPUTED: /* computed location */ - case LOC_COMPUTED_ARG: /* computed location arg */ - Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, - Tcl_NewStringObj (DEPRECATED_SYMBOL_NAME (sym), - -1)); - break; - - default: - break; - } - } - - return TCL_OK; - } - else if (BLOCK_FUNCTION (block)) - break; - else - block = BLOCK_SUPERBLOCK (block); - } - - return TCL_OK; -} - -/* This implements the tcl command gdb_get_blocks - * - * Returns the start and end addresses for all blocks in - * the selected frame. - * - * Arguments: - * None - * Tcl Result: - * A list of all valid blocks in the selected_frame. - */ -static int -gdb_get_blocks (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - struct block *block; - struct dict_iterator iter; - int junk; - struct symbol *sym; - CORE_ADDR pc; - - Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL); - - if (deprecated_selected_frame != NULL) - { - block = get_frame_block (deprecated_selected_frame, 0); - pc = get_frame_pc (deprecated_selected_frame); - while (block != 0) - { - junk = 0; - ALL_BLOCK_SYMBOLS (block, iter, sym) - { - switch (SYMBOL_CLASS (sym)) - { - default: - case LOC_UNDEF: /* catches errors */ - case LOC_CONST: /* constant */ - case LOC_TYPEDEF: /* local typedef */ - case LOC_LABEL: /* local label */ - case LOC_BLOCK: /* local function */ - case LOC_CONST_BYTES: /* loc. byte seq. */ - case LOC_UNRESOLVED: /* unresolved static */ - case LOC_OPTIMIZED_OUT: /* optimized out */ - junk = 1; - break; - - case LOC_ARG: /* argument */ - case LOC_REF_ARG: /* reference arg */ - case LOC_REGPARM: /* register arg */ - case LOC_REGPARM_ADDR: /* indirect register arg */ - case LOC_LOCAL_ARG: /* stack arg */ - case LOC_BASEREG_ARG: /* basereg arg */ - case LOC_COMPUTED_ARG: /* computed location arg */ - - case LOC_LOCAL: /* stack local */ - case LOC_BASEREG: /* basereg local */ - case LOC_STATIC: /* static */ - case LOC_REGISTER: /* register */ - case LOC_COMPUTED: /* computed location */ - junk = 0; - break; - } - } - - /* If we found a block with locals in it, add it to the list. - Note that the ranges of start and end address for blocks - are exclusive, so double-check against the PC */ - - if (!junk && pc < BLOCK_END (block)) - { - char *addr; - - Tcl_Obj *elt = Tcl_NewListObj (0, NULL); - xasprintf (&addr, "0x%s", paddr_nz (BLOCK_START (block))); - Tcl_ListObjAppendElement (interp, elt, - Tcl_NewStringObj (addr, -1)); - free(addr); - xasprintf (&addr, "0x%s", paddr_nz (BLOCK_END (block))); - Tcl_ListObjAppendElement (interp, elt, - Tcl_NewStringObj (addr, -1)); - Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, elt); - free(addr); - } - - if (BLOCK_FUNCTION (block)) - break; - else - block = BLOCK_SUPERBLOCK (block); - } - } - - return TCL_OK; -} - -/* gdb_get_args - - * This and gdb_get_locals just call gdb_get_vars_command with the right - * value of clientData. We can't use the client data in the definition - * of the command, because the call wrapper uses this instead... - */ -static int -gdb_get_args_command (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - return gdb_get_vars_command ((ClientData) 1, interp, objc, objv); -} - - -static int -gdb_get_locals_command (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - return gdb_get_vars_command ((ClientData) 0, interp, objc, objv); -} - -/* This implements the tcl commands "gdb_get_locals" and "gdb_get_args" - -* This function sets the Tcl interpreter's result to a list of variable names -* depending on clientData. If clientData is one, the result is a list of -* arguments; zero returns a list of locals -- all relative to the block -* specified as an argument to the command. Valid commands include -* anything decode_line_1 can handle (like "main.c:2", "*0x02020202", -* and "main"). -* -* Tcl Arguments: -* linespec - the linespec defining the scope of the lookup. Empty string -* to use the current block in the innermost frame. -* Tcl Result: -* A list of the locals or args -*/ -static int -gdb_get_vars_command (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - struct symtabs_and_lines sals; - struct symbol *sym; - struct block *block; - char **canonical, *args; - struct dict_iterator iter; - int i, arguments; - - if (objc > 2) - { - Tcl_WrongNumArgs (interp, 1, objv, - "[function:line|function|line|*addr]"); - return TCL_ERROR; - } - - arguments = (int) clientData; - - /* Initialize the result pointer to an empty list. */ - - Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL); - - if (objc == 2) - { - args = Tcl_GetStringFromObj (objv[1], NULL); - sals = decode_line_1 (&args, 1, NULL, 0, &canonical, NULL); - if (sals.nelts == 0) - { - gdbtk_set_result (interp, "error decoding line"); - return TCL_ERROR; - } - - /* Resolve all line numbers to PC's */ - for (i = 0; i < sals.nelts; i++) - resolve_sal_pc (&sals.sals[i]); - - block = block_for_pc (sals.sals[0].pc); - } - else - { - /* Specified currently selected frame */ - if (deprecated_selected_frame == NULL) - return TCL_OK; - - block = get_frame_block (deprecated_selected_frame, 0); - } - - while (block != 0) - { - ALL_BLOCK_SYMBOLS (block, iter, sym) - { - switch (SYMBOL_CLASS (sym)) - { - default: - case LOC_UNDEF: /* catches errors */ - case LOC_CONST: /* constant */ - case LOC_TYPEDEF: /* local typedef */ - case LOC_LABEL: /* local label */ - case LOC_BLOCK: /* local function */ - case LOC_CONST_BYTES: /* loc. byte seq. */ - case LOC_UNRESOLVED: /* unresolved static */ - case LOC_OPTIMIZED_OUT: /* optimized out */ - break; - case LOC_ARG: /* argument */ - case LOC_REF_ARG: /* reference arg */ - case LOC_REGPARM: /* register arg */ - case LOC_REGPARM_ADDR: /* indirect register arg */ - case LOC_LOCAL_ARG: /* stack arg */ - case LOC_BASEREG_ARG: /* basereg arg */ - case LOC_COMPUTED_ARG: /* computed location arg */ - if (arguments) - Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, - Tcl_NewStringObj (DEPRECATED_SYMBOL_NAME (sym), -1)); - break; - case LOC_LOCAL: /* stack local */ - case LOC_BASEREG: /* basereg local */ - case LOC_STATIC: /* static */ - case LOC_REGISTER: /* register */ - case LOC_COMPUTED: /* computed location */ - if (!arguments) - Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, - Tcl_NewStringObj (DEPRECATED_SYMBOL_NAME (sym), -1)); - break; - } - } - if (BLOCK_FUNCTION (block)) - break; - else - block = BLOCK_SUPERBLOCK (block); - } - - return TCL_OK; -} - -/* This implements the tcl command gdb_selected_block - * - * Returns the start and end addresses of the innermost - * block in the selected frame. - * - * Arguments: - * None - * Tcl Result: - * The currently selected block's start and end addresses - */ -static int -gdb_selected_block (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - char *start = NULL; - char *end = NULL; - - if (deprecated_selected_frame == NULL) - { - xasprintf (&start, "%s", ""); - xasprintf (&end, "%s", ""); - } - else - { - struct block *block; - block = get_frame_block (deprecated_selected_frame, 0); - xasprintf (&start, "0x%s", paddr_nz (BLOCK_START (block))); - xasprintf (&end, "0x%s", paddr_nz (BLOCK_END (block))); - } - - Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL); - Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, - Tcl_NewStringObj (start, -1)); - Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, - Tcl_NewStringObj (end, -1)); - - free(start); - free(end); - return TCL_OK; -} - -/* This implements the tcl command gdb_selected_frame - -* Returns the address of the selected frame -* frame. -* -* Arguments: -* None -* Tcl Result: -* The currently selected frame's address -*/ -static int -gdb_selected_frame (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - char *frame; - - if (deprecated_selected_frame == NULL) - xasprintf (&frame, "%s",""); - else - /* FIXME: cagney/2002-11-19: This should be using get_frame_id() - to identify the frame and *NOT* get_frame_base(). */ - xasprintf (&frame, "0x%s", - paddr_nz (get_frame_base (deprecated_selected_frame))); - - Tcl_SetStringObj (result_ptr->obj_ptr, frame, -1); - - free(frame); - return TCL_OK; -} - -/* This implements the tcl command gdb_stack. - * It builds up a list of stack frames. - * - * Tcl Arguments: - * start - starting stack frame - * count - number of frames to inspect - * Tcl Result: - * A list of function names - */ -static int -gdb_stack (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - int start, count; - - if (objc < 3) - { - Tcl_WrongNumArgs (interp, 1, objv, "start count"); - return TCL_ERROR; - } - - if (Tcl_GetIntFromObj (NULL, objv[1], &start)) - { - result_ptr->flags |= GDBTK_IN_TCL_RESULT; - return TCL_ERROR; - } - if (Tcl_GetIntFromObj (NULL, objv[2], &count)) - { - result_ptr->flags |= GDBTK_IN_TCL_RESULT; - return TCL_ERROR; - } - - if (target_has_stack) - { - gdb_result r; - struct frame_info *top; - struct frame_info *fi; - - /* Find the outermost frame */ - r = GDB_get_current_frame (&fi); - if (r != GDB_OK) - return TCL_ERROR; - - while (fi != NULL) - { - top = fi; - r = GDB_get_prev_frame (fi, &fi); - if (r != GDB_OK) - fi = NULL; - } - - /* top now points to the top (outermost frame) of the - stack, so point it to the requested start */ - start = -start; - r = GDB_find_relative_frame (top, &start, &top); - - result_ptr->obj_ptr = Tcl_NewListObj (0, NULL); - if (r != GDB_OK) - return TCL_OK; - - /* If start != 0, then we have asked to start outputting - frames beyond the innermost stack frame */ - if (start == 0) - { - fi = top; - while (fi && count--) - { - get_frame_name (interp, result_ptr->obj_ptr, fi); - r = GDB_get_next_frame (fi, &fi); - if (r != GDB_OK) - break; - } - } - } - - return TCL_OK; -} - -/* A helper function for get_stack which adds information about - * the stack frame FI to the caller's LIST. - * - * This is stolen from print_frame_info in stack.c. - */ -static void -get_frame_name (Tcl_Interp *interp, Tcl_Obj *list, struct frame_info *fi) -{ - struct symtab_and_line sal; - struct symbol *func = NULL; - register char *funname = 0; - enum language funlang = language_unknown; - Tcl_Obj *objv[1]; - - if (get_frame_type (fi) == DUMMY_FRAME) - { - objv[0] = Tcl_NewStringObj ("<function called from gdb>\n", -1); - Tcl_ListObjAppendElement (interp, list, objv[0]); - return; - } - if ((get_frame_type (fi) == SIGTRAMP_FRAME)) - { - objv[0] = Tcl_NewStringObj ("<signal handler called>\n", -1); - Tcl_ListObjAppendElement (interp, list, objv[0]); - return; - } - - sal = - find_pc_line (get_frame_pc (fi), - get_next_frame (fi) != NULL - && !(get_frame_type (fi) == SIGTRAMP_FRAME) - && !(get_frame_type (fi) == DUMMY_FRAME)); - - func = find_pc_function (get_frame_pc (fi)); - if (func) - { - struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (get_frame_pc (fi)); - if (msymbol != NULL - && (SYMBOL_VALUE_ADDRESS (msymbol) - > BLOCK_START (SYMBOL_BLOCK_VALUE (func)))) - { - func = 0; - funname = GDBTK_SYMBOL_SOURCE_NAME (msymbol); - funlang = SYMBOL_LANGUAGE (msymbol); - } - else - { - funname = GDBTK_SYMBOL_SOURCE_NAME (func); - funlang = SYMBOL_LANGUAGE (func); - } - } - else - { - struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (get_frame_pc (fi)); - if (msymbol != NULL) - { - funname = GDBTK_SYMBOL_SOURCE_NAME (msymbol); - funlang = SYMBOL_LANGUAGE (msymbol); - } - } - - if (sal.symtab) - { - objv[0] = Tcl_NewStringObj (funname, -1); - Tcl_ListObjAppendElement (interp, list, objv[0]); - } - else - { -#if 0 - /* we have no convenient way to deal with this yet... */ - if (fi->pc != sal.pc || !sal.symtab) - { - print_address_numeric (fi->pc, 1, gdb_stdout); - printf_filtered (" in "); - } - printf_symbol_filtered (gdb_stdout, funname ? funname : "??", funlang, - DMGL_ANSI); -#endif - objv[0] = Tcl_NewStringObj (funname != NULL ? funname : "??", -1); -#ifdef PC_LOAD_SEGMENT - /* If we couldn't print out function name but if can figure out what - load segment this pc value is from, at least print out some info - about its load segment. */ - if (!funname) - { - Tcl_AppendStringsToObj (objv[0], " from ", PC_LOAD_SEGMENT (fi->pc), - (char *) NULL); - } -#endif -#ifdef PC_SOLIB - if (!funname) - { - char *lib = PC_SOLIB (get_frame_pc (fi)); - if (lib) - { - Tcl_AppendStringsToObj (objv[0], " from ", lib, (char *) NULL); - } - } -#endif - Tcl_ListObjAppendElement (interp, list, objv[0]); - } -} diff --git a/gdb/gdbtk/generic/gdbtk-varobj.c b/gdb/gdbtk/generic/gdbtk-varobj.c deleted file mode 100644 index 3496d229116..00000000000 --- a/gdb/gdbtk/generic/gdbtk-varobj.c +++ /dev/null @@ -1,615 +0,0 @@ -/* Variable user interface layer for GDB, the GNU debugger. - Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - -#include "defs.h" -#include "value.h" -#include "gdb_string.h" -#include "varobj.h" - -#include <tcl.h> -#include "gdbtk.h" -#include "gdbtk-cmds.h" - -/* - * Public functions defined in this file - */ - -int gdb_variable_init (Tcl_Interp *); - -/* - * Private functions defined in this file - */ - -/* Entries into this file */ - -static int gdb_variable_command (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST[]); - -static int variable_obj_command (ClientData, Tcl_Interp *, int, - Tcl_Obj * CONST[]); - -/* Variable object subcommands */ - -static int variable_create (Tcl_Interp *, int, Tcl_Obj * CONST[]); - -static void variable_delete (Tcl_Interp *, struct varobj *, int); - -static Tcl_Obj *variable_children (Tcl_Interp *, struct varobj *); - -static int variable_format (Tcl_Interp *, int, Tcl_Obj * CONST[], - struct varobj *); - -static int variable_type (Tcl_Interp *, int, Tcl_Obj * CONST[], - struct varobj *); - -static int variable_value (Tcl_Interp *, int, Tcl_Obj * CONST[], - struct varobj *); - -static Tcl_Obj *variable_update (Tcl_Interp * interp, struct varobj **var); - -/* Helper functions for the above subcommands. */ - -static void install_variable (Tcl_Interp *, char *); - -static void uninstall_variable (Tcl_Interp *, char *); - -/* String representations of gdb's format codes */ -static char *format_string[] = - {"natural", "binary", "decimal", "hexadecimal", "octal"}; - - -/* Initialize the variable code. This function should be called once - to install and initialize the variable code into the interpreter. */ -int -gdb_variable_init (Tcl_Interp *interp) -{ - Tcl_Command result; - static int initialized = 0; - - if (!initialized) - { - result = Tcl_CreateObjCommand (interp, "gdb_variable", gdbtk_call_wrapper, - (ClientData) gdb_variable_command, NULL); - if (result == NULL) - return TCL_ERROR; - - initialized = 1; - } - - return TCL_OK; -} - -/* This function defines the "gdb_variable" command which is used to - create variable objects. Its syntax includes: - - gdb_variable create - gdb_variable create NAME - gdb_variable create -expr EXPR - gdb_variable create -frame FRAME - (it will also include permutations of the above options) - - NAME = name of object to create. If no NAME, then automatically create - a name - EXPR = the gdb expression for which to create a variable. This will - be the most common usage. - FRAME = the frame defining the scope of the variable. -*/ -static int -gdb_variable_command (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - static const char *commands[] = - {"create", "list", NULL}; - enum commands_enum - { - VARIABLE_CREATE, VARIABLE_LIST - }; - int index, result; - - if (objc < 2) - { - Tcl_WrongNumArgs (interp, 1, objv, "option ?arg...?"); - return TCL_ERROR; - } - - if (Tcl_GetIndexFromObj (interp, objv[1], commands, "options", 0, - &index) != TCL_OK) - { - return TCL_ERROR; - } - - switch ((enum commands_enum) index) - { - case VARIABLE_CREATE: - result = variable_create (interp, objc - 2, objv + 2); - break; - - default: - return TCL_ERROR; - } - - return result; -} - -/* This function implements the actual object command for each - variable object that is created (and each of its children). - - Currently the following commands are implemented: - - delete delete this object and its children - - update update the variable and its children (root vars only) - - numChildren how many children does this object have - - children create the children and return a list of their objects - - name print out the name of this variable - - format query/set the display format of this variable - - type get the type of this variable - - value get/set the value of this variable - - editable is this variable editable? -*/ -static int -variable_obj_command (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) -{ - enum commands_enum - { - VARIABLE_DELETE, - VARIABLE_NUM_CHILDREN, - VARIABLE_CHILDREN, - VARIABLE_FORMAT, - VARIABLE_TYPE, - VARIABLE_VALUE, - VARIABLE_NAME, - VARIABLE_EDITABLE, - VARIABLE_UPDATE - }; - static const char *commands[] = - { - "delete", - "numChildren", - "children", - "format", - "type", - "value", - "name", - "editable", - "update", - NULL - }; - struct varobj *var; - char *varobj_name; - int index, result; - - /* Get the current handle for this variable token (name). */ - varobj_name = Tcl_GetStringFromObj (objv[0], NULL); - if (varobj_name == NULL) - return TCL_ERROR; - var = varobj_get_handle (varobj_name); - - - if (objc < 2) - { - Tcl_WrongNumArgs (interp, 1, objv, "option ?arg...?"); - return TCL_ERROR; - } - - if (Tcl_GetIndexFromObj (interp, objv[1], commands, "options", 0, - &index) != TCL_OK) - return TCL_ERROR; - - result = TCL_OK; - switch ((enum commands_enum) index) - { - case VARIABLE_DELETE: - if (objc > 2) - { - int len; - char *s = Tcl_GetStringFromObj (objv[2], &len); - if (*s == 'c' && strncmp (s, "children", len) == 0) - { - variable_delete (interp, var, 1 /* only children */ ); - break; - } - } - variable_delete (interp, var, 0 /* var and children */ ); - break; - - case VARIABLE_NUM_CHILDREN: - Tcl_SetObjResult (interp, Tcl_NewIntObj (varobj_get_num_children (var))); - break; - - case VARIABLE_CHILDREN: - { - Tcl_Obj *children = variable_children (interp, var); - Tcl_SetObjResult (interp, children); - } - break; - - case VARIABLE_FORMAT: - result = variable_format (interp, objc, objv, var); - break; - - case VARIABLE_TYPE: - result = variable_type (interp, objc, objv, var); - break; - - case VARIABLE_VALUE: - result = variable_value (interp, objc, objv, var); - break; - - case VARIABLE_NAME: - { - char *name = varobj_get_expression (var); - Tcl_SetObjResult (interp, Tcl_NewStringObj (name, -1)); - xfree (name); - } - break; - - case VARIABLE_EDITABLE: - Tcl_SetObjResult (interp, - Tcl_NewIntObj (varobj_get_attributes (var) & 0x00000001 /* Editable? */ )); - break; - - case VARIABLE_UPDATE: - /* Only root variables can be updated */ - { - Tcl_Obj *obj = variable_update (interp, &var); - Tcl_SetObjResult (interp, obj); - } - break; - - default: - return TCL_ERROR; - } - - return result; -} - -/* - * Variable object construction/destruction - */ - -/* This function is responsible for processing the user's specifications - and constructing a variable object. */ -static int -variable_create (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) -{ - enum create_opts - { - CREATE_EXPR, CREATE_FRAME - }; - static const char *create_options[] = - {"-expr", "-frame", NULL}; - struct varobj *var; - char *name; - char *obj_name; - int index; - CORE_ADDR frame = (CORE_ADDR) -1; - int how_specified = USE_SELECTED_FRAME; - - /* REMINDER: This command may be invoked in the following ways: - gdb_variable create [NAME] [-expr EXPR] [-frame FRAME] - - NAME = name of object to create. If no NAME, then automatically create - a name - EXPR = the gdb expression for which to create a variable. This will - be the most common usage. - FRAME = the address of the frame defining the variable's scope - */ - name = NULL; - if (objc) - name = Tcl_GetStringFromObj (objv[0], NULL); - if (name == NULL || *name == '-') - { - /* generate a name for this object */ - obj_name = varobj_gen_name (); - } - else - { - /* specified name for object */ - obj_name = strdup (name); - objv++; - objc--; - } - - /* Run through all the possible options for this command */ - name = NULL; - while (objc > 0) - { - if (Tcl_GetIndexFromObj (interp, objv[0], create_options, "options", - 0, &index) != TCL_OK) - { - xfree (obj_name); - result_ptr->flags |= GDBTK_IN_TCL_RESULT; - return TCL_ERROR; - } - - switch ((enum create_opts) index) - { - case CREATE_EXPR: - name = Tcl_GetStringFromObj (objv[1], NULL); - objc--; - objv++; - break; - - case CREATE_FRAME: - { - char *str; - str = Tcl_GetStringFromObj (objv[1], NULL); - frame = string_to_core_addr (str); - how_specified = USE_SPECIFIED_FRAME; - objc--; - objv++; - } - break; - - default: - break; - } - - objc--; - objv++; - } - - /* Create the variable */ - var = varobj_create (obj_name, name, frame, how_specified); - - if (var != NULL) - { - /* Install a command into the interpreter that represents this - object */ - install_variable (interp, obj_name); - Tcl_SetObjResult (interp, Tcl_NewStringObj (obj_name, -1)); - result_ptr->flags |= GDBTK_IN_TCL_RESULT; - - xfree (obj_name); - return TCL_OK; - } - - xfree (obj_name); - return TCL_ERROR; -} - -/* Delete the variable object VAR and its children */ -/* If only_children_p, Delete only the children associated with the object. */ -static void -variable_delete (Tcl_Interp *interp, struct varobj *var, - int only_children_p) -{ - char **dellist; - char **vc; - - varobj_delete (var, &dellist, only_children_p); - - vc = dellist; - while (*vc != NULL) - { - uninstall_variable (interp, *vc); - xfree (*vc); - vc++; - } - - xfree (dellist); -} - -/* Return a list of all the children of VAR, creating them if necessary. */ -static Tcl_Obj * -variable_children (Tcl_Interp *interp, struct varobj *var) -{ - Tcl_Obj *list; - struct varobj **childlist; - struct varobj **vc; - char *childname; - - list = Tcl_NewListObj (0, NULL); - - varobj_list_children (var, &childlist); - - vc = childlist; - while (*vc != NULL) - { - childname = varobj_get_objname (*vc); - /* Add child to result list and install the Tcl command for it. */ - Tcl_ListObjAppendElement (NULL, list, - Tcl_NewStringObj (childname, -1)); - install_variable (interp, childname); - vc++; - } - - xfree (childlist); - return list; -} - -/* Update the values for a variable and its children. */ -/* NOTE: Only root variables can be updated... */ - -static Tcl_Obj * -variable_update (Tcl_Interp *interp, struct varobj **var) -{ - Tcl_Obj *changed; - struct varobj **changelist; - struct varobj **vc; - - /* varobj_update() can return -1 if the variable is no longer around, - i.e. we stepped out of the frame in which a local existed. */ - if (varobj_update (var, &changelist) == -1) - return Tcl_NewStringObj ("-1", -1); - - changed = Tcl_NewListObj (0, NULL); - vc = changelist; - while (*vc != NULL) - { - /* Add changed variable object to result list */ - Tcl_ListObjAppendElement (NULL, changed, - Tcl_NewStringObj (varobj_get_objname (*vc), -1)); - vc++; - } - - xfree (changelist); - return changed; -} - -/* This implements the format object command allowing - the querying or setting of the object's display format. */ -static int -variable_format (Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[], struct varobj *var) -{ - if (objc > 2) - { - /* Set the format of VAR to given format */ - int len; - char *fmt = Tcl_GetStringFromObj (objv[2], &len); - if (strncmp (fmt, "natural", len) == 0) - varobj_set_display_format (var, FORMAT_NATURAL); - else if (strncmp (fmt, "binary", len) == 0) - varobj_set_display_format (var, FORMAT_BINARY); - else if (strncmp (fmt, "decimal", len) == 0) - varobj_set_display_format (var, FORMAT_DECIMAL); - else if (strncmp (fmt, "hexadecimal", len) == 0) - varobj_set_display_format (var, FORMAT_HEXADECIMAL); - else if (strncmp (fmt, "octal", len) == 0) - varobj_set_display_format (var, FORMAT_OCTAL); - else - { - gdbtk_set_result (interp, "unknown display format \"", - fmt, "\": must be: \"natural\", \"binary\"" - ", \"decimal\", \"hexadecimal\", or \"octal\""); - return TCL_ERROR; - } - } - else - { - /* Report the current format */ - Tcl_Obj *fmt; - - /* FIXME: Use varobj_format_string[] instead */ - fmt = Tcl_NewStringObj ( - format_string[(int) varobj_get_display_format (var)], -1); - Tcl_SetObjResult (interp, fmt); - } - - return TCL_OK; -} - -/* This function implements the type object command, which returns the type of a - variable in the interpreter (or an error). */ -static int -variable_type (Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[], struct varobj *var) -{ - const char *first; - const char *last; - char *string; - Tcl_RegExp regexp; - - /* For the "fake" variables, do not return a type. - Their type is NULL anyway */ - /* FIXME: varobj_get_type() calls type_print(), so we may have to wrap - its call here and return TCL_ERROR in the case it errors out */ - if ((string = varobj_get_type (var)) == NULL) - { - Tcl_ResetResult (interp); - return TCL_OK; - } - - first = string; - - /* gdb will print things out like "struct {...}" for anonymous structs. - In gui-land, we don't want the {...}, so we strip it here. */ - regexp = Tcl_RegExpCompile (interp, "{...}"); - if (Tcl_RegExpExec (interp, regexp, string, first)) - { - /* We have an anonymous struct/union/class/enum */ - Tcl_RegExpRange (regexp, 0, &first, &last); - if (*(first - 1) == ' ') - first--; - string[first - string] = '\0'; - } - - Tcl_SetObjResult (interp, Tcl_NewStringObj (string, -1)); - xfree (string); - return TCL_OK; -} - -/* This function implements the value object command, which allows an object's - value to be queried or set. */ -static int -variable_value (Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[], struct varobj *var) -{ - char *r; - - /* If we're setting the value of the variable, objv[2] will contain the - variable's new value. */ - if (objc > 2) - { - /* FIXME: Do we need to test if val->error is set here? - If so, make it an attribute. */ - if (varobj_get_attributes (var) & 0x00000001 /* Editable? */ ) - { - char *s; - - s = Tcl_GetStringFromObj (objv[2], NULL); - if (!varobj_set_value (var, s)) - { - r = error_last_message(); - gdbtk_set_result (interp, "%s", r); - xfree (r); - return TCL_ERROR; - } - } - - Tcl_ResetResult (interp); - return TCL_OK; - } - - r = varobj_get_value (var); - - if (r == NULL) - { - char *err = error_last_message (); - gdbtk_set_result (interp, "%s", err); - xfree (err); - return TCL_ERROR; - } - else - { - Tcl_SetObjResult (interp, Tcl_NewStringObj (r, -1)); - xfree (r); - return TCL_OK; - } -} - -/* Helper functions for the above */ - -/* Install the given variable VAR into the tcl interpreter with - the object name NAME. */ -static void -install_variable (Tcl_Interp *interp, char *name) -{ - Tcl_CreateObjCommand (interp, name, variable_obj_command, - NULL, NULL); -} - -/* Unistall the object VAR in the tcl interpreter. */ -static void -uninstall_variable (Tcl_Interp *interp, char *varname) -{ - Tcl_DeleteCommand (interp, varname); -} - diff --git a/gdb/gdbtk/generic/gdbtk-wrapper.c b/gdb/gdbtk/generic/gdbtk-wrapper.c deleted file mode 100644 index bdbf6e7c2a0..00000000000 --- a/gdb/gdbtk/generic/gdbtk-wrapper.c +++ /dev/null @@ -1,721 +0,0 @@ -/* longjmp-free interface between gdb and gdbtk. - Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. - - This file is part of GDB. - - 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. */ - -#include "defs.h" -#include "frame.h" -#include "value.h" -#include "block.h" -#include "gdbtk-wrapper.h" - -/* - * Wrapper functions exported to the world - */ - -gdb_result GDB_value_fetch_lazy (value_ptr); - -gdb_result GDB_evaluate_expression (struct expression *, value_ptr *); - -gdb_result GDB_type_print (value_ptr, char *, struct ui_file *, int); - -gdb_result GDB_val_print (struct type *type, char *valaddr, - CORE_ADDR address, struct ui_file *stream, - int format, int deref_ref, int recurse, - enum val_prettyprint pretty); - -gdb_result GDB_value_equal (value_ptr, value_ptr, int *); - -gdb_result GDB_parse_exp_1 (char **stringptr, struct block *block, int comma, - struct expression **result); - -gdb_result GDB_evaluate_type (struct expression *exp, value_ptr * result); - -gdb_result GDB_block_for_pc (CORE_ADDR pc, struct block **result); - -gdb_result GDB_block_innermost_frame (struct block *block, - struct frame_info **result); - -gdb_result GDB_reinit_frame_cache (void); - -gdb_result GDB_value_ind (value_ptr val, value_ptr * rval); - -gdb_result GDB_value_slice (value_ptr val, int low, int num, - value_ptr * rval); - -gdb_result GDB_value_coerce_array (value_ptr val, value_ptr * rval); - -gdb_result GDB_value_struct_elt (value_ptr * argp, value_ptr * args, - char *name, int *static_memfunc, - char *err, value_ptr * rval); - -gdb_result GDB_value_cast (struct type *type, value_ptr val, - value_ptr * rval); - -gdb_result GDB_get_frame_block (struct frame_info *fi, struct block **rval); - -gdb_result GDB_get_prev_frame (struct frame_info *fi, - struct frame_info **result); - -gdb_result GDB_get_next_frame (struct frame_info *fi, - struct frame_info **result); - -gdb_result GDB_find_relative_frame (struct frame_info *fi, - int *start, struct frame_info **result); - -gdb_result GDB_get_current_frame (struct frame_info **result); - -/* - * Private functions for this file - */ -static gdb_result call_wrapped_function (catch_errors_ftype *, - struct gdb_wrapper_arguments *); - -static int wrap_type_print (char *); - -static int wrap_evaluate_expression (char *); - -static int wrap_value_fetch_lazy (char *); - -static int wrap_val_print (char *); - -static int wrap_value_equal (char *); - -static int wrap_parse_exp_1 (char *opaque_arg); - -static int wrap_evaluate_type (char *opaque_arg); - -static int wrap_block_for_pc (char *opaque_arg); - -static int wrap_block_innermost_frame (char *opaque_arg); - -static int wrap_reinit_frame_cache (char *opaque_arg); - -static int wrap_value_ind (char *opaque_arg); - -static int wrap_value_slice (char *opaque_arg); - -static int wrap_value_coerce_array (char *opaque_arg); - -static int wrap_value_struct_elt (char *opaque_arg); - -static int wrap_value_cast (char *opaque_arg); - -static int wrap_get_frame_block (char *opaque_arg); - -static int wrap_get_prev_frame (char *opaque_arg); - -static int wrap_get_next_frame (char *opaque_arg); - -static int wrap_find_relative_frame (char *opaque_arg); - -static int wrap_get_current_frame (char *opaque_arg); - -static gdb_result -call_wrapped_function (catch_errors_ftype *fn, struct gdb_wrapper_arguments *arg) -{ - if (!catch_errors (fn, (char *) &arg, "", RETURN_MASK_ERROR)) - { - /* An error occurred */ - return GDB_ERROR; - } - - return GDB_OK; -} - -gdb_result -GDB_type_print (value_ptr val, char *varstring, - struct ui_file *stream, int show) -{ - struct gdb_wrapper_arguments args; - - args.args[0] = (char *) val; - args.args[1] = varstring; - args.args[2] = (char *) stream; - args.args[3] = (char *) show; - return call_wrapped_function ((catch_errors_ftype *) wrap_type_print, &args); -} - -static int -wrap_type_print (char *a) -{ - struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) a; - value_ptr val = (value_ptr) (*args)->args[0]; - char *varstring = (*args)->args[1]; - struct ui_file *stream = (struct ui_file *) (*args)->args[2]; - int show = (int) (*args)->args[3]; - type_print (VALUE_TYPE (val), varstring, stream, show); - return 1; -} - -gdb_result -GDB_val_print (struct type *type, - char *valaddr, - CORE_ADDR address, - struct ui_file *stream, - int format, - int deref_ref, - int recurse, - enum val_prettyprint pretty) -{ - struct gdb_wrapper_arguments args; - - args.args[0] = (char *) type; - args.args[1] = (char *) valaddr; - args.args[2] = (char *) &address; - args.args[3] = (char *) stream; - args.args[4] = (char *) format; - args.args[5] = (char *) deref_ref; - args.args[6] = (char *) recurse; - args.args[7] = (char *) pretty; - - return call_wrapped_function ((catch_errors_ftype *) wrap_val_print, &args); -} - -static int -wrap_val_print (char *a) -{ - struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) a; - struct type *type; - char *valaddr; - CORE_ADDR address; - struct ui_file *stream; - int format; - int deref_ref; - int recurse; - enum val_prettyprint pretty; - - type = (struct type *) (*args)->args[0]; - valaddr = (char *) (*args)->args[1]; - address = *(CORE_ADDR *) (*args)->args[2]; - stream = (struct ui_file *) (*args)->args[3]; - format = (int) (*args)->args[4]; - deref_ref = (int) (*args)->args[5]; - recurse = (int) (*args)->args[6]; - pretty = (enum val_prettyprint) (*args)->args[7]; - - val_print (type, valaddr, 0, address, stream, format, deref_ref, - recurse, pretty); - return 1; -} - -gdb_result -GDB_value_fetch_lazy (value_ptr value) -{ - struct gdb_wrapper_arguments args; - - args.args[0] = (char *) value; - return call_wrapped_function ((catch_errors_ftype *) wrap_value_fetch_lazy, &args); -} - -static int -wrap_value_fetch_lazy (char *a) -{ - struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) a; - - value_fetch_lazy ((value_ptr) (*args)->args[0]); - return 1; -} - -gdb_result -GDB_evaluate_expression (struct expression *exp, value_ptr *value) -{ - struct gdb_wrapper_arguments args; - gdb_result result; - args.args[0] = (char *) exp; - - result = call_wrapped_function ((catch_errors_ftype *) wrap_evaluate_expression, &args); - if (result != GDB_OK) - return result; - - *value = (value_ptr) args.result; - return GDB_OK; -} - -static int -wrap_evaluate_expression (char *a) -{ - struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) a; - - (*args)->result = - (char *) evaluate_expression ((struct expression *) (*args)->args[0]); - return 1; -} - -gdb_result -GDB_value_equal (val1, val2, result) - value_ptr val1; - value_ptr val2; - int *result; -{ - struct gdb_wrapper_arguments args; - gdb_result r; - - args.args[0] = (char *) val1; - args.args[1] = (char *) val2; - - r = call_wrapped_function ((catch_errors_ftype *) wrap_value_equal, &args); - if (r != GDB_OK) - return r; - - *result = (int) args.result; - return GDB_OK; -} - -static int -wrap_value_equal (char *a) -{ - struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) a; - value_ptr val1, val2; - - val1 = (value_ptr) (*args)->args[0]; - val2 = (value_ptr) (*args)->args[1]; - - (*args)->result = (char *) value_equal (val1, val2); - return 1; -} - -gdb_result -GDB_parse_exp_1 (char **stringptr, struct block *block, - int comma, struct expression **result) -{ - struct gdb_wrapper_arguments args; - gdb_result r; - - args.args[0] = (char *) stringptr; - args.args[1] = (char *) block; - args.args[2] = (char *) comma; - - r = call_wrapped_function ((catch_errors_ftype *) wrap_parse_exp_1, &args); - if (r != GDB_OK) - return r; - - *result = (struct expression *) args.result; - return GDB_OK; -} - -static int -wrap_parse_exp_1 (char *opaque_arg) -{ - struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; - struct block *block; - char **stringptr; - int comma; - - stringptr = (char **) (*args)->args[0]; - block = (struct block *) (*args)->args[1]; - comma = (int) (*args)->args[2]; - - (*args)->result = (char *) parse_exp_1 (stringptr, block, comma); - return 1; -} - -gdb_result -GDB_evaluate_type (struct expression *exp, value_ptr *result) -{ - struct gdb_wrapper_arguments args; - gdb_result r; - - args.args[0] = (char *) exp; - - r = call_wrapped_function ((catch_errors_ftype *) wrap_evaluate_type, &args); - if (r != GDB_OK) - return r; - - *result = (value_ptr) args.result; - return GDB_OK; -} - -static int -wrap_evaluate_type (char *opaque_arg) -{ - struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; - struct expression *exp; - - exp = (struct expression *) (*args)->args[0]; - (*args)->result = (char *) evaluate_type (exp); - return 1; -} - -gdb_result -GDB_block_for_pc (CORE_ADDR pc, struct block **result) -{ - struct gdb_wrapper_arguments args; - gdb_result r; - - args.args[0] = (char *) &pc; - - r = call_wrapped_function ((catch_errors_ftype *) wrap_block_for_pc, &args); - if (r != GDB_OK) - return r; - - *result = (struct block *) args.result; - return GDB_OK; -} - -static int -wrap_block_for_pc (char *opaque_arg) -{ - struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; - CORE_ADDR pc; - - pc = *(CORE_ADDR *) (*args)->args[0]; - (*args)->result = (char *) block_for_pc (pc); - return 1; -} - -gdb_result -GDB_block_innermost_frame (struct block *block, struct frame_info **result) -{ - struct gdb_wrapper_arguments args; - gdb_result r; - - args.args[0] = (char *) block; - - r = call_wrapped_function ((catch_errors_ftype *) wrap_block_innermost_frame, &args); - if (r != GDB_OK) - return r; - - *result = (struct frame_info *) args.result; - return GDB_OK; -} - -static int -wrap_block_innermost_frame (char *opaque_arg) -{ - struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; - struct block *block; - - block = (struct block *) (*args)->args[0]; - (*args)->result = (char *) block_innermost_frame (block); - return 1; -} - -gdb_result -GDB_reinit_frame_cache () -{ - gdb_result r; - - r = call_wrapped_function ((catch_errors_ftype *) wrap_reinit_frame_cache, NULL); - if (r != GDB_OK) - return r; - - return GDB_OK; -} - -static int -wrap_reinit_frame_cache (char *opaque_arg) -{ - reinit_frame_cache (); - return 1; -} - -gdb_result -GDB_value_ind (value_ptr val, value_ptr *rval) -{ - struct gdb_wrapper_arguments args; - gdb_result r; - - args.args[0] = (char *) val; - - r = call_wrapped_function ((catch_errors_ftype *) wrap_value_ind, &args); - if (r != GDB_OK) - return r; - - *rval = (value_ptr) args.result; - return GDB_OK; -} - -static int -wrap_value_ind (char *opaque_arg) -{ - struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; - value_ptr val; - - val = (value_ptr) (*args)->args[0]; - (*args)->result = (char *) value_ind (val); - return 1; -} - -gdb_result -GDB_value_slice (value_ptr val, int low, int num, value_ptr *rval) -{ - struct gdb_wrapper_arguments args; - gdb_result r; - - args.args[0] = (char *) val; - args.args[1] = (char *) &low; - args.args[2] = (char *) # - - r = call_wrapped_function ((catch_errors_ftype *) wrap_value_slice, &args); - if (r != GDB_OK) - return r; - - *rval = (value_ptr) args.result; - return GDB_OK; -} - -static int -wrap_value_slice (char *opaque_arg) -{ - struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; - value_ptr val; - int low, num; - - val = (value_ptr) (*args)->args[0]; - low = *(int *) (*args)->args[1]; - num = *(int *) (*args)->args[2]; - (*args)->result = (char *) value_slice (val, low, num); - return 1; -} - -gdb_result -GDB_value_coerce_array (val, rval) - value_ptr val; - value_ptr *rval; -{ - struct gdb_wrapper_arguments args; - gdb_result r; - - args.args[0] = (char *) val; - - r = call_wrapped_function ((catch_errors_ftype *) wrap_value_coerce_array, - &args); - if (r != GDB_OK) - return r; - - *rval = (value_ptr) args.result; - return GDB_OK; -} - -static int -wrap_value_coerce_array (char *opaque_arg) -{ - struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; - value_ptr val; - - val = (value_ptr) (*args)->args[0]; - (*args)->result = (char *) value_coerce_array (val); - return 1; -} - -gdb_result -GDB_value_struct_elt (value_ptr *argp, - value_ptr *args, - char *name, - int *static_memfunc, - char *err, - value_ptr *rval) -{ - struct gdb_wrapper_arguments argss; - gdb_result r; - - argss.args[0] = (char *) argp; - argss.args[1] = (char *) args; - argss.args[2] = name; - argss.args[3] = (char *) static_memfunc; - argss.args[4] = err; - r = call_wrapped_function ((catch_errors_ftype *) wrap_value_struct_elt, &argss); - if (r != GDB_OK) - return r; - - *rval = (value_ptr) argss.result; - return GDB_OK; -} - -static int -wrap_value_struct_elt (char *opaque_arg) -{ - struct gdb_wrapper_arguments **argss = (struct gdb_wrapper_arguments **) opaque_arg; - value_ptr *argp, *args; - char *name; - int *static_memfunc; - char *err; - - argp = (value_ptr *) (*argss)->args[0]; - args = (value_ptr *) (*argss)->args[1]; - name = (*argss)->args[2]; - static_memfunc = (int *) (*argss)->args[3]; - err = (*argss)->args[4]; - - (*argss)->result = (char *) value_struct_elt (argp, args, name, static_memfunc, err); - return 1; -} - -gdb_result -GDB_value_cast (struct type *type, value_ptr val, value_ptr *rval) -{ - struct gdb_wrapper_arguments args; - gdb_result r; - - args.args[0] = (char *) type; - args.args[1] = (char *) val; - - r = call_wrapped_function ((catch_errors_ftype *) wrap_value_cast, &args); - if (r != GDB_OK) - return r; - - *rval = (value_ptr) args.result; - return GDB_OK; -} - -static int -wrap_value_cast (char *opaque_arg) -{ - struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; - value_ptr val; - struct type *type; - - type = (struct type *) (*args)->args[0]; - val = (value_ptr) (*args)->args[1]; - (*args)->result = (char *) value_cast (type, val); - - return 1; -} - -gdb_result -GDB_get_frame_block (struct frame_info *fi, struct block **rval) -{ - struct gdb_wrapper_arguments args; - gdb_result r; - - args.args[0] = (char *) fi; - - r = call_wrapped_function ((catch_errors_ftype *) wrap_get_frame_block, &args); - if (r != GDB_OK) - return r; - - *rval = (struct block *) args.result; - return GDB_OK; -} - -static int -wrap_get_frame_block (char *opaque_arg) -{ - struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; - struct frame_info *fi; - - fi = (struct frame_info *) (*args)->args[0]; - (*args)->result = (char *) get_frame_block (fi, NULL); - - return 1; -} - -gdb_result -GDB_get_prev_frame (struct frame_info *fi, struct frame_info **result) -{ - struct gdb_wrapper_arguments args; - gdb_result r; - - args.args[0] = (char *) fi; - r = call_wrapped_function ((catch_errors_ftype *) wrap_get_prev_frame, &args); - if (r != GDB_OK) - return r; - - *result = (struct frame_info *) args.result; - return GDB_OK; -} - -static int -wrap_get_prev_frame (char *opaque_arg) -{ - struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; - struct frame_info *fi = (struct frame_info *) (*args)->args[0]; - - (*args)->result = (char *) get_prev_frame (fi); - return 1; -} - -gdb_result -GDB_get_next_frame (struct frame_info *fi, struct frame_info **result) -{ - struct gdb_wrapper_arguments args; - gdb_result r; - - args.args[0] = (char *) fi; - r = call_wrapped_function ((catch_errors_ftype *) wrap_get_next_frame, &args); - if (r != GDB_OK) - return r; - - *result = (struct frame_info *) args.result; - return GDB_OK; -} - -static int -wrap_get_next_frame (char *opaque_arg) -{ - struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; - struct frame_info *fi = (struct frame_info *) (*args)->args[0]; - - (*args)->result = (char *) get_next_frame (fi); - return 1; -} - -gdb_result -GDB_find_relative_frame (struct frame_info *fi, int *start, - struct frame_info **result) -{ - struct gdb_wrapper_arguments args; - gdb_result r; - - args.args[0] = (char *) fi; - args.args[1] = (char *) start; - - r = call_wrapped_function ((catch_errors_ftype *) wrap_find_relative_frame, - &args); - if (r != GDB_OK) - return r; - - *result = (struct frame_info *) args.result; - return GDB_OK; -} - -static int -wrap_find_relative_frame (char *opaque_arg) -{ - struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; - struct frame_info *fi = (struct frame_info *) (*args)->args[0]; - int *start = (int *) (*args)->args[1]; - - (*args)->result = (char *) find_relative_frame (fi, start); - return 1; -} - -gdb_result -GDB_get_current_frame (struct frame_info **result) -{ - struct gdb_wrapper_arguments args; - gdb_result r; - - r = call_wrapped_function ((catch_errors_ftype *) wrap_get_current_frame, - &args); - if (r != GDB_OK) - return r; - - *result = (struct frame_info *) args.result; - return GDB_OK; -} - -static int -wrap_get_current_frame (char *opaque_arg) -{ - struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg; - - (*args)->result = (char *) get_current_frame (); - return 1; -} - diff --git a/gdb/gdbtk/generic/gdbtk-wrapper.h b/gdb/gdbtk/generic/gdbtk-wrapper.h deleted file mode 100644 index d02dc0d84e8..00000000000 --- a/gdb/gdbtk/generic/gdbtk-wrapper.h +++ /dev/null @@ -1,83 +0,0 @@ -/* longjmp-free interface between gdb and gdbtk. - Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. - -This file is part of GDB. It contains routines to safely call common gdb -functions without the fear of longjmp'ing. - -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. */ - -#ifndef GDBTK_WRAPPER_H -#define GDBTK_WRAPPER_H -/* Use this struct used to pass arguments to wrapper routines. We assume - (arbitrarily) that no gdb function takes more than ten arguments. */ -struct gdb_wrapper_arguments { - - /* Pointer to some result from the gdb function call, if any */ - char *result; - - /* The list of arguments. */ - char *args[10]; -}; - -/* FIXME: cagney/2002-01-04: GDB no longer uses or supplies the - value_ptr typedef. Provide one here to keep the Insight code - immediatly happy. */ -typedef struct value *value_ptr; - -/* Whenever any gdb function wrapper is called, its return status is: */ -typedef enum gdb_wrapper_status { GDB_OK, GDB_ERROR } gdb_result; - -/* This list of functions which have been wrapped. Please keep this list - in alphabetical order, using "GDB_" to prefix the actual name of the - function. */ -extern gdb_result GDB_evaluate_expression (struct expression *expr, - value_ptr * val); -extern gdb_result GDB_type_print (value_ptr val, char *varstring, - struct ui_file *stream, int show); -extern gdb_result GDB_val_print (struct type *type, char *valaddr, - CORE_ADDR address, struct ui_file *stream, - int format, int deref_ref, int recurse, - enum val_prettyprint pretty); -extern gdb_result GDB_value_fetch_lazy (value_ptr value); -extern gdb_result GDB_value_equal (value_ptr val1, value_ptr val2, - int *result); -extern gdb_result GDB_parse_exp_1 (char **stringptr, struct block *block, - int comma, struct expression **result); -extern gdb_result GDB_evaluate_type (struct expression *exp, - value_ptr * result); -extern gdb_result GDB_block_for_pc (CORE_ADDR pc, struct block **result); -extern gdb_result GDB_block_innermost_frame (struct block *block, - struct frame_info **result); -extern gdb_result GDB_reinit_frame_cache (void); -extern gdb_result GDB_value_ind (value_ptr val, value_ptr * rval); -extern gdb_result GDB_value_slice (value_ptr val, int low, int num, - value_ptr * rval); -extern gdb_result GDB_value_coerce_array (value_ptr val, value_ptr * rval); -extern gdb_result GDB_value_struct_elt (value_ptr * argp, value_ptr * args, - char *name, int *static_memfunc, - char *err, value_ptr * rval); -extern gdb_result GDB_value_cast (struct type *type, value_ptr val, - value_ptr * rval); -gdb_result GDB_get_frame_block (struct frame_info *fi, struct block **rval); -extern gdb_result GDB_get_prev_frame (struct frame_info *fi, - struct frame_info **result); -extern gdb_result GDB_get_next_frame (struct frame_info *fi, - struct frame_info **result); -extern gdb_result GDB_find_relative_frame (struct frame_info *fi, - int *start, - struct frame_info **result); -extern gdb_result GDB_get_current_frame (struct frame_info **result); -#endif /* GDBTK_WRAPPER_H */ - diff --git a/gdb/gdbtk/generic/gdbtk.c b/gdb/gdbtk/generic/gdbtk.c deleted file mode 100644 index 2b6decffb02..00000000000 --- a/gdb/gdbtk/generic/gdbtk.c +++ /dev/null @@ -1,764 +0,0 @@ -/* Startup code for Insight - Copyright 1994, 1995, 1996, 1997, 1998, 2001, 2002, 2003 - Free Software Foundation, Inc. - - Written by Stu Grossman <grossman@cygnus.com> of Cygnus Support. - - This file is part of GDB. - - 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. */ - -#include "defs.h" -#include "inferior.h" -#include "symfile.h" -#include "objfiles.h" -#include "gdbcore.h" -#include "tracepoint.h" -#include "demangle.h" -#include "version.h" -#include "top.h" -#include "annotate.h" - -#if defined(_WIN32) || defined(__CYGWIN__) -#define WIN32_LEAN_AND_MEAN -#include <windows.h> -#endif - -/* tcl header files includes varargs.h unless HAS_STDARG is defined, - but gdb uses stdarg.h, so make sure HAS_STDARG is defined. */ -#define HAS_STDARG 1 - -#include <itcl.h> -#include <itk.h> -#include "guitcl.h" -#include "gdbtk.h" - -#include <fcntl.h> -#include <sys/stat.h> -#include <sys/ioctl.h> -#include <sys/time.h> -#include <signal.h> - -#include "gdb_string.h" -#include "dis-asm.h" -#include "gdbcmd.h" - -#ifdef __CYGWIN32__ -#include <sys/cygwin.h> /* for cygwin32_attach_handle_to_fd */ -#endif - -extern void _initialize_gdbtk (void); - -/* For unix natives, we use a timer to periodically keep the gui alive. - See comments before x_event. */ -static sigset_t nullsigmask; -static struct sigaction act1, act2; -static struct itimerval it_on, it_off; - -static void -x_event_wrapper (int signo) -{ - x_event (signo); -} - -/* - * This variable controls the interaction with an external editor. - */ - -char *external_editor_command = NULL; - -extern int Tktable_Init (Tcl_Interp * interp); - -void gdbtk_init (void); - -static void gdbtk_init_1 (char *argv0); - -void gdbtk_interactive (void); - -static void cleanup_init (void *ignore); - -static void tk_command (char *, int); - -static int target_should_use_timer (struct target_ops *t); - -int target_is_native (struct target_ops *t); - -int gdbtk_test (char *); - -static void view_command (char *, int); - -/* Handle for TCL interpreter */ -Tcl_Interp *gdbtk_interp = NULL; - -static int gdbtk_timer_going = 0; - -/* linked variable used to tell tcl what the current thread is */ -int gdb_context = 0; - -/* This variable is true when the inferior is running. See note in - * gdbtk.h for details. - */ -int running_now; - -/* This variable holds the name of a Tcl file which should be sourced by the - interpreter when it goes idle at startup. Used with the testsuite. */ -static char *gdbtk_source_filename = NULL; - -int gdbtk_disable_fputs = 1; - -static const char *argv0; - -#ifndef _WIN32 - -/* Supply malloc calls for tcl/tk. We do not want to do this on - Windows, because Tcl_Alloc is probably in a DLL which will not call - the mmalloc routines. - We also don't need to do it for Tcl/Tk8.1, since we locally changed the - allocator to use malloc & free. */ - -#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0 -char * -TclpAlloc (unsigned int size) -{ - return xmalloc (size); -} - -char * -TclpRealloc (char *ptr, unsigned int size) -{ - return xrealloc (ptr, size); -} - -void -TclpFree (char *ptr) -{ - free (ptr); -} -#endif /* TCL_VERSION == 8.0 */ - -#endif /* ! _WIN32 */ - -#ifdef _WIN32 - -/* On Windows, if we hold a file open, other programs can't write to - * it. In particular, we don't want to hold the executable open, - * because it will mean that people have to get out of the debugging - * session in order to remake their program. So we close it, although - * this will cost us if and when we need to reopen it. - */ - -void -close_bfds () -{ - struct objfile *o; - - ALL_OBJFILES (o) - { - if (o->obfd != NULL) - bfd_cache_close (o->obfd); - } - - if (exec_bfd != NULL) - bfd_cache_close (exec_bfd); -} - -#endif /* _WIN32 */ - - -/* TclDebug (const char *fmt, ...) works just like printf() but - * sends the output to the GDB TK debug window. - * Not for normal use; just a convenient tool for debugging - */ - -void -TclDebug (char level, const char *fmt,...) -{ - va_list args; - char *buf; - const char *v[3]; - char *merge; - char *priority; - - switch (level) - { - case 'W': - priority = "W"; - break; - case 'E': - priority = "E"; - break; - case 'X': - priority = "X"; - break; - default: - priority = "I"; - } - - va_start (args, fmt); - - - xvasprintf (&buf, fmt, args); - va_end (args); - - v[0] = "dbug"; - v[1] = priority; - v[2] = buf; - - merge = Tcl_Merge (3, v); - if (Tcl_Eval (gdbtk_interp, merge) != TCL_OK) - Tcl_BackgroundError (gdbtk_interp); - Tcl_Free (merge); - free(buf); -} - - -/* - * The rest of this file contains the start-up, and event handling code for gdbtk. - */ - -/* - * This cleanup function is added to the cleanup list that surrounds the Tk - * main in gdbtk_init. It deletes the Tcl interpreter. - */ - -static void -cleanup_init (void *ignore) -{ - if (gdbtk_interp != NULL) - Tcl_DeleteInterp (gdbtk_interp); - gdbtk_interp = NULL; -} - -/* Come here during long calculations to check for GUI events. Usually invoked - via the QUIT macro. */ - -void -gdbtk_interactive () -{ - /* Tk_DoOneEvent (TK_DONT_WAIT|TK_IDLE_EVENTS); */ -} - -/* Start a timer which will keep the GUI alive while in target_wait. */ -void -gdbtk_start_timer () -{ - static int first = 1; - - if (first) - { - /* first time called, set up all the structs */ - first = 0; - sigemptyset (&nullsigmask); - - act1.sa_handler = x_event_wrapper; - act1.sa_mask = nullsigmask; - act1.sa_flags = 0; - - act2.sa_handler = SIG_IGN; - act2.sa_mask = nullsigmask; - act2.sa_flags = 0; - - it_on.it_interval.tv_sec = 0; - it_on.it_interval.tv_usec = 250000; /* .25 sec */ - it_on.it_value.tv_sec = 0; - it_on.it_value.tv_usec = 250000; - - it_off.it_interval.tv_sec = 0; - it_off.it_interval.tv_usec = 0; - it_off.it_value.tv_sec = 0; - it_off.it_value.tv_usec = 0; - } - - if (target_should_use_timer (¤t_target)) - { - if (!gdbtk_timer_going) - { - sigaction (SIGALRM, &act1, NULL); - setitimer (ITIMER_REAL, &it_on, NULL); - gdbtk_timer_going = 1; - } - } - return; -} - -/* Stop the timer if it is running. */ -void -gdbtk_stop_timer () -{ - if (gdbtk_timer_going) - { - gdbtk_timer_going = 0; - setitimer (ITIMER_REAL, &it_off, NULL); - sigaction (SIGALRM, &act2, NULL); - } - return; -} - -/* Should this target use the timer? See comments before - x_event for the logic behind all this. */ -static int -target_should_use_timer (struct target_ops *t) -{ - return target_is_native (t); -} - -/* Is T a native target? */ -int -target_is_native (struct target_ops *t) -{ - char *name = t->to_shortname; - - if (strcmp (name, "exec") == 0 || strcmp (name, "hpux-threads") == 0 - || strcmp (name, "child") == 0 || strcmp (name, "procfs") == 0 - || strcmp (name, "solaris-threads") == 0 - || strcmp (name, "linuxthreads") == 0 - || strcmp (name, "multi-thread") == 0) - return 1; - - return 0; -} - -/* gdbtk_init installs this function as a final cleanup. */ - -static void -gdbtk_cleanup (PTR dummy) -{ - Tcl_Eval (gdbtk_interp, "gdbtk_cleanup"); - Tcl_Finalize (); -} - - -/* Initialize gdbtk. This involves creating a Tcl interpreter, - * defining all the Tcl commands that the GUI will use, pointing - * all the gdb "hooks" to the correct functions, - * and setting the Tcl auto loading environment so that we can find all - * the Tcl based library files. - */ - -void -gdbtk_init (void) -{ - struct cleanup *old_chain; - char *s; - int element_count; - const char **exec_path; - CONST char *internal_exec_name; - - /* If there is no DISPLAY environment variable, Tk_Init below will fail, - causing gdb to abort. If instead we simply return here, gdb will - gracefully degrade to using the command line interface. */ - -#ifndef _WIN32 - if (getenv ("DISPLAY") == NULL) - { - return; - } -#endif - - old_chain = make_cleanup (cleanup_init, 0); - - /* First init tcl and tk. */ - Tcl_FindExecutable (argv0); - gdbtk_interp = Tcl_CreateInterp (); - -#ifdef TCL_MEM_DEBUG - Tcl_InitMemory (gdbtk_interp); -#endif - - if (!gdbtk_interp) - error ("Tcl_CreateInterp failed"); - - /* We need to check if we are being run from - a bin directory, if not then we may have to - set some environment variables. */ - - internal_exec_name = Tcl_GetNameOfExecutable (); - - Tcl_SplitPath ((char *) internal_exec_name, &element_count, &exec_path); - - if (strcmp (exec_path[element_count - 2], "bin") != 0) - { - /* We check to see if TCL_LIBRARY, TK_LIBRARY, - ITCL_LIBRARY, ITK_LIBRARY, TIX_LIBRARY and maybe - a couple other environment variables have been - set (we don't want to override the User's settings). - If the *_LIBRARY variable is not set, point it at - the source directory. */ - - static char set_libs_path_script[] = "\ - set srcDir [file dirname [file dirname $env(TCL_LIBRARY)]];\n\ -\ - if {![info exists env(TK_LIBRARY)]} {\n\ - set env(TK_LIBRARY) [file join $srcDir tk library]\n\ - }\n\ -\ - if {![info exists env(ITCL_LIBRARY)]} {\n\ - set env(ITCL_LIBRARY) [file join $srcDir itcl itcl library]\n\ - }\n\ -\ - if {![info exists env(ITK_LIBRARY)]} {\n\ - set env(ITK_LIBRARY) [file join $srcDir itcl itk library]\n\ - }\n\ -\ - if {![info exists env(IWIDGETS_LIBRARY)]} {\n\ - set env(IWIDGETS_LIBRARY)\ - [file join $srcDir itcl iwidgets generic]\n\ - }\n\ -\ - if {![info exists env(TIX_LIBRARY)]} {\n\ - set env(TIX_LIBRARY) [file join $srcDir tix library]\n\ - }\n\ -\ - if {![info exists env(GDBTK_LIBRARY)]} {\n\ - set env(GDBTK_LIBRARY) [file join $srcDir gdb gdbtk library]\n\ - }\n\ -\ - # Append the directory with the itcl pkg index\n\ - if {[info exists env(TCLLIBPATH)]} {\n\ - append env(TCLLIBPATH) :[file joing $srcDir itcl]\n\ - } else {\n\ - set env(TCLLIBPATH) [file join $srcDir itcl]\n\ - }\n\ -\ - # We also need to append the iwidgets library path.\n\ - # Unfortunately, there is no IWIDGETS_LIBRARY.\n\ - set IWIDGETS_LIBRARY [file join $srcDir itcl iwidgets generic]\n"; - - Tcl_Obj *commandObj; - - /* Before we can run our script we must set TCL_LIBRARY. */ - if (Tcl_GetVar2 (gdbtk_interp, "env", "TCL_LIBRARY", TCL_GLOBAL_ONLY) == NULL) - { - int i, count; - char *src_dir = SRC_DIR; - const char **src_path; - const char **lib_path; - Tcl_DString lib_dstring; - - Tcl_DStringInit (&lib_dstring); - -#ifdef __CYGWIN__ - /* SRC_DIR from configure is a posix path. Tcl really needs a - windows path. */ - src_dir = (char *) alloca (cygwin_posix_to_win32_path_list_buf_size (SRC_DIR)); - cygwin_posix_to_win32_path_list (SRC_DIR, src_dir); -#endif - Tcl_SplitPath (src_dir, &count, &src_path); - - /* Append tcl/library to src_dir (src_dir=/foo/bar/gdb) */ - lib_path = (const char **) alloca ((count + 2) * sizeof (char *)); - for (i = 0; i < count - 1; i++) - lib_path[i] = src_path[i]; - lib_path[i++] = "tcl"; - lib_path[i++] = "library"; - Tcl_JoinPath (i, lib_path, &lib_dstring); - - /* Set TCL_LIBRARY */ - Tcl_SetVar2 (gdbtk_interp, "env", "TCL_LIBRARY", - Tcl_DStringValue (&lib_dstring) , TCL_GLOBAL_ONLY); - Tcl_DStringFree (&lib_dstring); - Tcl_Free ((char *) src_path); - } - - commandObj = Tcl_NewStringObj (set_libs_path_script, -1); - Tcl_IncrRefCount (commandObj); - Tcl_EvalObj (gdbtk_interp, commandObj); - Tcl_DecrRefCount (commandObj); - } - - Tcl_Free ((char *) exec_path); - - if (Tcl_Init (gdbtk_interp) != TCL_OK) - error ("Tcl_Init failed: %s", gdbtk_interp->result); - - /* Set up some globals used by gdb to pass info to gdbtk - for start up options and the like */ - xasprintf (&s, "%d", inhibit_gdbinit); - Tcl_SetVar2 (gdbtk_interp, "GDBStartup", "inhibit_prefs", s, TCL_GLOBAL_ONLY); - free(s); - - /* Note: Tcl_SetVar2() treats the value as read-only (making a - copy). Unfortunately it does not mark the parameter as - ``const''. */ - Tcl_SetVar2 (gdbtk_interp, "GDBStartup", "host_name", (char*) host_name, TCL_GLOBAL_ONLY); - Tcl_SetVar2 (gdbtk_interp, "GDBStartup", "target_name", (char*) target_name, TCL_GLOBAL_ONLY); - - make_final_cleanup (gdbtk_cleanup, NULL); - - /* Initialize the Paths variable. */ - if (ide_initialize_paths (gdbtk_interp, "") != TCL_OK) - error ("ide_initialize_paths failed: %s", gdbtk_interp->result); - - if (Tk_Init (gdbtk_interp) != TCL_OK) - error ("Tk_Init failed: %s", gdbtk_interp->result); - - if (Itcl_Init (gdbtk_interp) == TCL_ERROR) - error ("Itcl_Init failed: %s", gdbtk_interp->result); - Tcl_StaticPackage (gdbtk_interp, "Itcl", Itcl_Init, - (Tcl_PackageInitProc *) NULL); - - if (Itk_Init (gdbtk_interp) == TCL_ERROR) - error ("Itk_Init failed: %s", gdbtk_interp->result); - Tcl_StaticPackage (gdbtk_interp, "Itk", Itk_Init, - (Tcl_PackageInitProc *) NULL); - - if (Tktable_Init (gdbtk_interp) != TCL_OK) - error ("Tktable_Init failed: %s", gdbtk_interp->result); - - Tcl_StaticPackage (gdbtk_interp, "Tktable", Tktable_Init, - (Tcl_PackageInitProc *) NULL); - /* - * These are the commands to do some Windows Specific stuff... - */ - -#ifdef __CYGWIN32__ - if (ide_create_messagebox_command (gdbtk_interp) != TCL_OK) - error ("messagebox command initialization failed"); - /* On Windows, create a sizebox widget command */ -#if 0 - if (ide_create_sizebox_command (gdbtk_interp) != TCL_OK) - error ("sizebox creation failed"); -#endif - if (ide_create_winprint_command (gdbtk_interp) != TCL_OK) - error ("windows print code initialization failed"); - if (ide_create_win_grab_command (gdbtk_interp) != TCL_OK) - error ("grab support command initialization failed"); - /* Path conversion functions. */ - if (ide_create_cygwin_path_command (gdbtk_interp) != TCL_OK) - error ("cygwin path command initialization failed"); - if (ide_create_shell_execute_command (gdbtk_interp) != TCL_OK) - error ("cygwin shell execute command initialization failed"); -#endif - - /* Only for testing -- and only when it can't be done any - other way. */ - if (cyg_create_warp_pointer_command (gdbtk_interp) != TCL_OK) - error ("warp_pointer command initialization failed"); - - /* - * This adds all the Gdbtk commands. - */ - - if (Gdbtk_Init (gdbtk_interp) != TCL_OK) - { - error ("Gdbtk_Init failed: %s", gdbtk_interp->result); - } - - Tcl_StaticPackage (gdbtk_interp, "Insight", Gdbtk_Init, NULL); - - /* Add a back door to Tk from the gdb console... */ - - add_com ("tk", class_obscure, tk_command, - "Send a command directly into tk."); - - add_com ("view", class_obscure, view_command, - "View a location in the source window."); - - /* - * Set the variable for external editor: - */ - - if (external_editor_command != NULL) - { - Tcl_SetVar (gdbtk_interp, "external_editor_command", - external_editor_command, 0); - xfree (external_editor_command); - external_editor_command = NULL; - } - -#ifdef __CYGWIN32__ - (void) FreeConsole (); -#endif - - discard_cleanups (old_chain); -} - -void -gdbtk_source_start_file (void) -{ - /* find the gdb tcl library and source main.tcl */ -#ifdef NO_TCLPRO_DEBUGGER - static char script[] = "\ -proc gdbtk_find_main {} {\n\ - global Paths GDBTK_LIBRARY\n\ - rename gdbtk_find_main {}\n\ - tcl_findLibrary insight 1.0 {} main.tcl GDBTK_LIBRARY GDBTKLIBRARY\n\ - set Paths(appdir) $GDBTK_LIBRARY\n\ -}\n\ -gdbtk_find_main"; -#else - static char script[] = "\ -proc gdbtk_find_main {} {\n\ - global Paths GDBTK_LIBRARY env\n\ - rename gdbtk_find_main {}\n\ - if {[info exists env(DEBUG_STUB)]} {\n\ - source $env(DEBUG_STUB)\n\ - debugger_init\n\ - set debug_startup 1\n\ - } else {\n\ - set debug_startup 0\n\ - }\n\ - tcl_findLibrary insight 1.0 {} main.tcl GDBTK_LIBRARY GDBTK_LIBRARY\n\ - set Paths(appdir) $GDBTK_LIBRARY\n\ -}\n\ -gdbtk_find_main"; -#endif /* NO_TCLPRO_DEBUGGER */ - - /* now enable gdbtk to parse the output from gdb */ - gdbtk_disable_fputs = 0; - - if (Tcl_GlobalEval (gdbtk_interp, (char *) script) != TCL_OK) - { - const char *msg; - - /* Force errorInfo to be set up propertly. */ - Tcl_AddErrorInfo (gdbtk_interp, ""); - msg = Tcl_GetVar (gdbtk_interp, "errorInfo", TCL_GLOBAL_ONLY); - -#ifdef _WIN32 - /* On windows, display the error using a pop-up message box. - If GDB wasn't started from the DOS prompt, the user won't - get to see the failure reason. */ - MessageBox (NULL, msg, NULL, MB_OK | MB_ICONERROR | MB_TASKMODAL); - throw_exception (RETURN_ERROR); -#else - /* FIXME: cagney/2002-04-17: Wonder what the lifetime of - ``msg'' is - does it need a cleanup? */ - error ("%s", msg); -#endif - } - - /* Now source in the filename provided by the --tclcommand option. - This is mostly used for the gdbtk testsuite... */ - - if (gdbtk_source_filename != NULL) - { - char *s = "after idle source "; - char *script = concat (s, gdbtk_source_filename, (char *) NULL); - Tcl_Eval (gdbtk_interp, script); - free (gdbtk_source_filename); - free (script); - } -} - -static void -gdbtk_init_1 (char *arg0) -{ - argv0 = arg0; - init_ui_hook = NULL; -} - -/* gdbtk_test is used in main.c to validate the -tclcommand option to - gdb, which sources in a file of tcl code after idle during the - startup procedure. */ - -int -gdbtk_test (char *filename) -{ - if (access (filename, R_OK) != 0) - return 0; - else - gdbtk_source_filename = xstrdup (filename); - return 1; -} - -/* Come here during initialize_all_files () */ - -void -_initialize_gdbtk () -{ - /* Current_interpreter not set yet, so we must check - if "interpreter_p" is set to "insight" to know if - insight is GOING to run. */ - if (strcmp (interpreter_p, "insight") == 0) - init_ui_hook = gdbtk_init_1; -#ifdef __CYGWIN__ - else - { - DWORD ft = GetFileType (GetStdHandle (STD_INPUT_HANDLE)); - - switch (ft) - { - case FILE_TYPE_DISK: - case FILE_TYPE_CHAR: - case FILE_TYPE_PIPE: - break; - default: - AllocConsole (); - cygwin32_attach_handle_to_fd ("/dev/conin", 0, - GetStdHandle (STD_INPUT_HANDLE), - 1, GENERIC_READ); - cygwin32_attach_handle_to_fd ("/dev/conout", 1, - GetStdHandle (STD_OUTPUT_HANDLE), - 0, GENERIC_WRITE); - cygwin32_attach_handle_to_fd ("/dev/conout", 2, - GetStdHandle (STD_ERROR_HANDLE), - 0, GENERIC_WRITE); - break; - } - } -#endif -} - -static void -tk_command (char *cmd, int from_tty) -{ - int retval; - char *result; - struct cleanup *old_chain; - - /* Catch case of no argument, since this will make the tcl interpreter - dump core. */ - if (cmd == NULL) - error_no_arg ("tcl command to interpret"); - - retval = Tcl_Eval (gdbtk_interp, cmd); - - result = xstrdup (gdbtk_interp->result); - - old_chain = make_cleanup (free, result); - - if (retval != TCL_OK) - error ("%s", result); - - printf_unfiltered ("%s\n", result); - - do_cleanups (old_chain); -} - -static void -view_command (char *args, int from_tty) -{ - char *script; - struct cleanup *old_chain; - - if (args != NULL) - { - xasprintf (&script, - "[lindex [ManagedWin::find SrcWin] 0] location BROWSE_TAG [gdb_loc %s]", - args); - old_chain = make_cleanup (xfree, script); - if (Tcl_Eval (gdbtk_interp, script) != TCL_OK) - { - Tcl_Obj *obj = Tcl_GetObjResult (gdbtk_interp); - error ("%s", Tcl_GetStringFromObj (obj, NULL)); - } - - do_cleanups (old_chain); - } - else - error ("Argument required (location to view)"); -} diff --git a/gdb/gdbtk/generic/gdbtk.h b/gdb/gdbtk/generic/gdbtk.h deleted file mode 100644 index aa4b4cb1064..00000000000 --- a/gdb/gdbtk/generic/gdbtk.h +++ /dev/null @@ -1,188 +0,0 @@ -/* Tcl/Tk interface routines header file. - Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2003 - 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. */ - -#ifndef _GDBTK_H -#define _GDBTK_H - -#ifdef _WIN32 -#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 - They are defined in gdbtk-cmds.c */ - -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; - -/* - * This structure controls how the gdb output is fed into gdbtk_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; - -struct target_ops; - -/* 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 - gdbtk_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. */ -#define GDBTK_ERROR_ONLY 16 /* Indicates that all incoming I/O is - to be treated as if it had arrived for gdb_stderr. This is - used to help error_begin in utils.c. */ - -/* 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 gdbtk_call_wrapper mechanism. See that function for more details. */ - -extern gdbtk_result *result_ptr; - -/* If you want to restore an old value of result_ptr whenever cleanups - are run, pass this function to make_cleanup, along with the value - of result_ptr you'd like to reinstate. */ -extern void gdbtk_restore_result_ptr (void *); - -/* GDB context identifier */ -extern int gdb_context; - -/* Internal flag used to tell callers of ui_loop_hook whether they should - detach from the target. See explanations before x_event and gdb_stop. */ -extern int gdbtk_force_detach; - -/* - * These functions are used in all the modules of Gdbtk. - * - */ - -extern int Gdbtk_Init (Tcl_Interp * interp); -extern void gdbtk_stop_timer (void); -extern void gdbtk_start_timer (void); -extern void gdbtk_ignorable_warning (const char *, const char *); -extern void gdbtk_interactive (void); -extern int x_event (int); -extern int gdbtk_two_elem_cmd (char *, char *); -extern int target_is_native (struct target_ops *t); -extern void gdbtk_fputs (const char *, struct ui_file *); -extern struct ui_file *gdbtk_fileopen (void); -extern int gdbtk_disable_fputs; - -#ifdef _WIN32 -extern void close_bfds (); -#endif /* _WIN32 */ - -extern void - TclDebug (char level, const char *fmt,...); - -/* A convenience macro for getting the demangled source names, - regardless of the user's mangling style. */ -#define GDBTK_SYMBOL_SOURCE_NAME(symbol) \ - (SYMBOL_DEMANGLED_NAME (symbol) != NULL \ - ? SYMBOL_DEMANGLED_NAME (symbol) \ - : DEPRECATED_SYMBOL_NAME (symbol)) - - -/* gdbtk_add_hooks - add all the hooks to gdb. This will get called - by the startup code to fill in the hooks needed by core gdb. */ -extern void gdbtk_add_hooks (void); - -/* Initialize Insight */ -extern void gdbtk_init (void); - -/* Start Insight. Insight must have already been initialized with a call - to gdbtk_init. */ -extern void gdbtk_source_start_file (void); -#endif /* !_GDBTK_H */ |