binutils-gdb/gdb/gdbtk.c

750 lines
19 KiB
C
Raw Normal View History

Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/* Startup code for gdbtk.
Copyright 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
Written by Stu Grossman <grossman@cygnus.com> of Cygnus Support.
This file is part of GDB.
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
1995-08-02 05:41:12 +02:00
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "symtab.h"
#include "inferior.h"
#include "command.h"
#include "bfd.h"
#include "symfile.h"
#include "objfiles.h"
#include "target.h"
* tracepoint.c (set_raw_tracepoint): make sure there's a trailing slash on the directory name * Merge (lots) with foundry-971118-build * Makefile.in (install-only): install the new gdbtk, not the old * top.h: add declaration of get_prompt * top.c (get_prompt): new function * 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 function (gdb_get_file_command): new function (gdb_get_function_command): new function (gdb_get_tracepoint_info): new function (gdbtk_create_tracepoint): new function (gdbtk_delete_tracepoint): new function (tracepoint_notify): new function (tracepoint_exists): new function (gdb_actions_command): new function (gdb_tracepoint_exists_command): new function (gdb_prompt_command): new function * main.tcl: initialize gdbtk_state(readline) * console.tcl (invoke): get realine working (activate): add prompt argument for readline (setprompt): add prompt argument for readline * interface.tcl (gdbtk_tcl_readline): hack to get readline working * lots: Merge with foundry-971118-build * console.tcl (setprompt): get prompt from gdb * prefs.tcl (pref_set_defaults): add tracepoint defaults * interface.tcl (gdbtk_tcl_tracepoint): new function * src.tcl (constructor): set default behavior of left click, make a tracepoint dot, too (fill_files): "new" function: ripped out of "location" (location): use fill_files instead (do_bp): add support for tracepoints (bp_line): add support for tracepoints (set_tracepoint): new function (config_win): add "Set tracepoint here" to right-click menu * actiondlg.tcl: new file to help with tracepoint data collection actions * tracedlg.tcl: new file to help with tracepoints
1997-11-26 23:38:10 +01:00
#include "gdbcore.h"
#include "tracepoint.h"
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
#include "demangle.h"
* tracepoint.c (set_raw_tracepoint): make sure there's a trailing slash on the directory name * Merge (lots) with foundry-971118-build * Makefile.in (install-only): install the new gdbtk, not the old * top.h: add declaration of get_prompt * top.c (get_prompt): new function * 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 function (gdb_get_file_command): new function (gdb_get_function_command): new function (gdb_get_tracepoint_info): new function (gdbtk_create_tracepoint): new function (gdbtk_delete_tracepoint): new function (tracepoint_notify): new function (tracepoint_exists): new function (gdb_actions_command): new function (gdb_tracepoint_exists_command): new function (gdb_prompt_command): new function * main.tcl: initialize gdbtk_state(readline) * console.tcl (invoke): get realine working (activate): add prompt argument for readline (setprompt): add prompt argument for readline * interface.tcl (gdbtk_tcl_readline): hack to get readline working * lots: Merge with foundry-971118-build * console.tcl (setprompt): get prompt from gdb * prefs.tcl (pref_set_defaults): add tracepoint defaults * interface.tcl (gdbtk_tcl_tracepoint): new function * src.tcl (constructor): set default behavior of left click, make a tracepoint dot, too (fill_files): "new" function: ripped out of "location" (location): use fill_files instead (do_bp): add support for tracepoints (bp_line): add support for tracepoints (set_tracepoint): new function (config_win): add "Set tracepoint here" to right-click menu * actiondlg.tcl: new file to help with tracepoint data collection actions * tracedlg.tcl: new file to help with tracepoints
1997-11-26 23:38:10 +01:00
#ifdef _WIN32
#include <winuser.h>
#endif
#include <sys/stat.h>
#include <tcl.h>
#include <tk.h>
#include <itcl.h>
#include <tix.h>
#include "guitcl.h"
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
#include "gdbtk.h"
#ifdef IDE
* tracepoint.c (set_raw_tracepoint): make sure there's a trailing slash on the directory name * Merge (lots) with foundry-971118-build * Makefile.in (install-only): install the new gdbtk, not the old * top.h: add declaration of get_prompt * top.c (get_prompt): new function * 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 function (gdb_get_file_command): new function (gdb_get_function_command): new function (gdb_get_tracepoint_info): new function (gdbtk_create_tracepoint): new function (gdbtk_delete_tracepoint): new function (tracepoint_notify): new function (tracepoint_exists): new function (gdb_actions_command): new function (gdb_tracepoint_exists_command): new function (gdb_prompt_command): new function * main.tcl: initialize gdbtk_state(readline) * console.tcl (invoke): get realine working (activate): add prompt argument for readline (setprompt): add prompt argument for readline * interface.tcl (gdbtk_tcl_readline): hack to get readline working * lots: Merge with foundry-971118-build * console.tcl (setprompt): get prompt from gdb * prefs.tcl (pref_set_defaults): add tracepoint defaults * interface.tcl (gdbtk_tcl_tracepoint): new function * src.tcl (constructor): set default behavior of left click, make a tracepoint dot, too (fill_files): "new" function: ripped out of "location" (location): use fill_files instead (do_bp): add support for tracepoints (bp_line): add support for tracepoints (set_tracepoint): new function (config_win): add "Set tracepoint here" to right-click menu * actiondlg.tcl: new file to help with tracepoint data collection actions * tracedlg.tcl: new file to help with tracepoints
1997-11-26 23:38:10 +01:00
/* start-sanitize-ide */
#include "event.h"
#include "idetcl.h"
* tracepoint.c (set_raw_tracepoint): make sure there's a trailing slash on the directory name * Merge (lots) with foundry-971118-build * Makefile.in (install-only): install the new gdbtk, not the old * top.h: add declaration of get_prompt * top.c (get_prompt): new function * 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 function (gdb_get_file_command): new function (gdb_get_function_command): new function (gdb_get_tracepoint_info): new function (gdbtk_create_tracepoint): new function (gdbtk_delete_tracepoint): new function (tracepoint_notify): new function (tracepoint_exists): new function (gdb_actions_command): new function (gdb_tracepoint_exists_command): new function (gdb_prompt_command): new function * main.tcl: initialize gdbtk_state(readline) * console.tcl (invoke): get realine working (activate): add prompt argument for readline (setprompt): add prompt argument for readline * interface.tcl (gdbtk_tcl_readline): hack to get readline working * lots: Merge with foundry-971118-build * console.tcl (setprompt): get prompt from gdb * prefs.tcl (pref_set_defaults): add tracepoint defaults * interface.tcl (gdbtk_tcl_tracepoint): new function * src.tcl (constructor): set default behavior of left click, make a tracepoint dot, too (fill_files): "new" function: ripped out of "location" (location): use fill_files instead (do_bp): add support for tracepoints (bp_line): add support for tracepoints (set_tracepoint): new function (config_win): add "Set tracepoint here" to right-click menu * actiondlg.tcl: new file to help with tracepoint data collection actions * tracedlg.tcl: new file to help with tracepoints
1997-11-26 23:38:10 +01:00
#include "ilutk.h"
/* end-sanitize-ide */
#endif
#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include <signal.h>
#include <fcntl.h>
#include <unistd.h>
#include <setjmp.h>
#include "top.h"
#include <sys/ioctl.h>
* configure.in: Check for working mmap, ansi headers, string.h, strings.h, and memory.h. * configure: Regenerated. * gdb_stat.h: New file, "portable" <sys/stat.h>. * gdb_string.h: New file, "portable" <string.h>. * altos-xdep.c, arm-tdep.c, arm-xdep.c, convex-tdep.c, convex-xdep.c, coredep.c, cxux-nat.c, dbxread.c, exec.c, gould-xdep.c, hppa-tdep.c, i386aix-nat.c, i386b-nat.c, i386mach-nat.c, i386v-nat.c, infptrace.c, m88k-nat.c, main.c, mdebugread.c, objfiles.c, os9kread.c, procfs.c, pyr-xdep.c, rs6000-nat.c, source.c, standalone.c, stuff.c, sun386-nat.c, symfile.c, symm-nat.c, symm-tdep.c, symtab.c, top.c, ultra3-nat.c, ultra3-xdep.c, umax-xdep.c, xcoffread.c: Include "gdb_stat.h" instead of <sys/stat.h>. * alpha-tdep.c, breakpoint.c, buildsym.c, c-typeprint.c, ch-typeprint.c, coffread.c, command.c, core-sol2.c, core-svr4.c, core.c, corelow.c, cp-valprint.c, dbxread.c, dcache.c, demangle.c, dpx2-nat.c, dstread.c, dwarfread.c, elfread.c, environ.c, eval.c, exec.c, f-lang.c, f-typeprint.c, f-valprint.c, findvar.c, fork-child.c, gdbtypes.c, hpread.c, i386-tdep.c, infcmd.c, inflow.c, infptrace.c, infrun.c, irix5-nat.c, language.c, m2-typeprint.c, main.c, mdebugread.c, minsyms.c, mipsread.c, monitor.c, nlmread.c, objfiles.c, os9kread.c, osfsolib.c, parse.c, printcmd.c, procfs.c, regex.c, remote-adapt.c, remote-arc.c, remote-array.c, remote-bug.c, remote-e7000.c, remote-eb.c, remote-es.c, remote-hms.c, remote-mm.c, remote-os9k.c, remote-pa.c, remote-sim.c, remote-st.c, remote-udi.c, remote-utils.c, remote-vx.c, remote-vx29k.c, remote-vx68.c, remote-vx960.c, remote-vxmips.c, remote-vxsparc.c, remote.c, solib.c, somread.c, source.c, stabsread.c, stack.c, symfile.c, symmisc.c, symtab.c, target.c, top.c, typeprint.c, utils.c, valarith.c, valops.c, valprint.c, values.c, xcoffread.c: Include "gdb_string.h" instead of <string.h>. * gdbtk.c: Likewise. * config/xm-sysv4.h, i386/xm-ptx.h, m68k/xm-sun3os4.h, sparc/xm-sun4os4.h (HAVE_MMAP): Removed. * config/xm-lynx.h, config/i386/xm-ptx.h, config/m68k/nm-apollo68b.h, config/m68k/xm-hp300hpux.h, config/mips/xm-irix3.h, config/mips/xm-mips.h, config/mips/xm-news-mips.h, config/mips/xm-riscos.h, config/pa/hppah.h, config/rs6000/xm-rs6000.h, config/sparc/xm-sun4os4.h, config/sparc/xm-sun4sol2.h, config/vax/xm-vaxbsd.h, config/vax/xm-vaxult.h, config/vax/xm-vaxult2.h (MEM_FNS_DECLARED): Removed. * config/mips/xm-irix3.h, config/mips/xm-mips.h, config/pa/xm-hppah.h (memcpy, memset): Removed declarations.
1995-08-01 22:14:27 +02:00
#include "gdb_string.h"
#include "dis-asm.h"
* annotate.c, breakpoint.c, defs.h, gdbtk.c, top.c: Replace enable/disable_breakpoint_hook with modify_breakpoint_hook. * 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.
1995-02-15 02:45:39 +01:00
#include <stdio.h>
#include "gdbcmd.h"
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
#include "annotate.h"
* tracepoint.c (set_raw_tracepoint): make sure there's a trailing slash on the directory name * Merge (lots) with foundry-971118-build * Makefile.in (install-only): install the new gdbtk, not the old * top.h: add declaration of get_prompt * top.c (get_prompt): new function * 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 function (gdb_get_file_command): new function (gdb_get_function_command): new function (gdb_get_tracepoint_info): new function (gdbtk_create_tracepoint): new function (gdbtk_delete_tracepoint): new function (tracepoint_notify): new function (tracepoint_exists): new function (gdb_actions_command): new function (gdb_tracepoint_exists_command): new function (gdb_prompt_command): new function * main.tcl: initialize gdbtk_state(readline) * console.tcl (invoke): get realine working (activate): add prompt argument for readline (setprompt): add prompt argument for readline * interface.tcl (gdbtk_tcl_readline): hack to get readline working * lots: Merge with foundry-971118-build * console.tcl (setprompt): get prompt from gdb * prefs.tcl (pref_set_defaults): add tracepoint defaults * interface.tcl (gdbtk_tcl_tracepoint): new function * src.tcl (constructor): set default behavior of left click, make a tracepoint dot, too (fill_files): "new" function: ripped out of "location" (location): use fill_files instead (do_bp): add support for tracepoints (bp_line): add support for tracepoints (set_tracepoint): new function (config_win): add "Set tracepoint here" to right-click menu * actiondlg.tcl: new file to help with tracepoint data collection actions * tracedlg.tcl: new file to help with tracepoints
1997-11-26 23:38:10 +01:00
#include <sys/time.h>
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/* For Cygwin32, we use a timer to periodically check for Windows
messages. FIXME: It would be better to not poll, but to instead
rewrite the target_wait routines to serve as input sources.
Unfortunately, that will be a lot of work. */
static sigset_t nullsigmask;
static struct sigaction act1, act2;
static struct itimerval it_on, it_off;
1996-04-05 20:27:08 +02:00
extern int Tktable_Init PARAMS ((Tcl_Interp *interp));
static void gdbtk_init PARAMS ((char *));
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
void gdbtk_interactive PARAMS ((void));
static void cleanup_init PARAMS ((int));
static void tk_command PARAMS ((char *, int));
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
void gdbtk_add_hooks PARAMS ((void));
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
int gdbtk_test PARAMS ((char *));
/*
* gdbtk_fputs is defined in the gdbtk_hooks.c, but we need it here
* because we delay adding this hook till all the setup is done. That
* way errors will go to stdout.
*/
extern void gdbtk_fputs PARAMS ((const char *, FILE *));
/* 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;
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/* This variable is true when the inferior is running. See note in
* gdbtk.h for details.
*/
int running_now;
/* This variable determines where memory used for disassembly is read from.
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
* See note in gdbtk.h for details.
*/
int disassemble_from_exec = -1;
/* 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. */
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
static char *gdbtk_source_filename = NULL;
#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. */
char *
Tcl_Alloc (size)
unsigned int size;
{
return xmalloc (size);
}
char *
Tcl_Realloc (ptr, size)
char *ptr;
unsigned int size;
{
return xrealloc (ptr, size);
}
void
Tcl_Free(ptr)
char *ptr;
{
free (ptr);
}
* tracepoint.c (set_raw_tracepoint): make sure there's a trailing slash on the directory name * Merge (lots) with foundry-971118-build * Makefile.in (install-only): install the new gdbtk, not the old * top.h: add declaration of get_prompt * top.c (get_prompt): new function * 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 function (gdb_get_file_command): new function (gdb_get_function_command): new function (gdb_get_tracepoint_info): new function (gdbtk_create_tracepoint): new function (gdbtk_delete_tracepoint): new function (tracepoint_notify): new function (tracepoint_exists): new function (gdb_actions_command): new function (gdb_tracepoint_exists_command): new function (gdb_prompt_command): new function * main.tcl: initialize gdbtk_state(readline) * console.tcl (invoke): get realine working (activate): add prompt argument for readline (setprompt): add prompt argument for readline * interface.tcl (gdbtk_tcl_readline): hack to get readline working * lots: Merge with foundry-971118-build * console.tcl (setprompt): get prompt from gdb * prefs.tcl (pref_set_defaults): add tracepoint defaults * interface.tcl (gdbtk_tcl_tracepoint): new function * src.tcl (constructor): set default behavior of left click, make a tracepoint dot, too (fill_files): "new" function: ripped out of "location" (location): use fill_files instead (do_bp): add support for tracepoints (bp_line): add support for tracepoints (set_tracepoint): new function (config_win): add "Set tracepoint here" to right-click menu * actiondlg.tcl: new file to help with tracepoint data collection actions * tracedlg.tcl: new file to help with tracepoints
1997-11-26 23:38:10 +01:00
#endif /* ! _WIN32 */
* tracepoint.c (set_raw_tracepoint): make sure there's a trailing slash on the directory name * Merge (lots) with foundry-971118-build * Makefile.in (install-only): install the new gdbtk, not the old * top.h: add declaration of get_prompt * top.c (get_prompt): new function * 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 function (gdb_get_file_command): new function (gdb_get_function_command): new function (gdb_get_tracepoint_info): new function (gdbtk_create_tracepoint): new function (gdbtk_delete_tracepoint): new function (tracepoint_notify): new function (tracepoint_exists): new function (gdb_actions_command): new function (gdb_tracepoint_exists_command): new function (gdb_prompt_command): new function * main.tcl: initialize gdbtk_state(readline) * console.tcl (invoke): get realine working (activate): add prompt argument for readline (setprompt): add prompt argument for readline * interface.tcl (gdbtk_tcl_readline): hack to get readline working * lots: Merge with foundry-971118-build * console.tcl (setprompt): get prompt from gdb * prefs.tcl (pref_set_defaults): add tracepoint defaults * interface.tcl (gdbtk_tcl_tracepoint): new function * src.tcl (constructor): set default behavior of left click, make a tracepoint dot, too (fill_files): "new" function: ripped out of "location" (location): use fill_files instead (do_bp): add support for tracepoints (bp_line): add support for tracepoints (set_tracepoint): new function (config_win): add "Set tracepoint here" to right-click menu * actiondlg.tcl: new file to help with tracepoint data collection actions * tracedlg.tcl: new file to help with tracepoints
1997-11-26 23:38:10 +01:00
#ifdef _WIN32
/* On Windows, if we hold a file open, other programs can't write to
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
* 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.
*/
* tracepoint.c (set_raw_tracepoint): make sure there's a trailing slash on the directory name * Merge (lots) with foundry-971118-build * Makefile.in (install-only): install the new gdbtk, not the old * top.h: add declaration of get_prompt * top.c (get_prompt): new function * 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 function (gdb_get_file_command): new function (gdb_get_function_command): new function (gdb_get_tracepoint_info): new function (gdbtk_create_tracepoint): new function (gdbtk_delete_tracepoint): new function (tracepoint_notify): new function (tracepoint_exists): new function (gdb_actions_command): new function (gdb_tracepoint_exists_command): new function (gdb_prompt_command): new function * main.tcl: initialize gdbtk_state(readline) * console.tcl (invoke): get realine working (activate): add prompt argument for readline (setprompt): add prompt argument for readline * interface.tcl (gdbtk_tcl_readline): hack to get readline working * lots: Merge with foundry-971118-build * console.tcl (setprompt): get prompt from gdb * prefs.tcl (pref_set_defaults): add tracepoint defaults * interface.tcl (gdbtk_tcl_tracepoint): new function * src.tcl (constructor): set default behavior of left click, make a tracepoint dot, too (fill_files): "new" function: ripped out of "location" (location): use fill_files instead (do_bp): add support for tracepoints (bp_line): add support for tracepoints (set_tracepoint): new function (config_win): add "Set tracepoint here" to right-click menu * actiondlg.tcl: new file to help with tracepoint data collection actions * tracedlg.tcl: new file to help with tracepoints
1997-11-26 23:38:10 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
void
* tracepoint.c (set_raw_tracepoint): make sure there's a trailing slash on the directory name * Merge (lots) with foundry-971118-build * Makefile.in (install-only): install the new gdbtk, not the old * top.h: add declaration of get_prompt * top.c (get_prompt): new function * 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 function (gdb_get_file_command): new function (gdb_get_function_command): new function (gdb_get_tracepoint_info): new function (gdbtk_create_tracepoint): new function (gdbtk_delete_tracepoint): new function (tracepoint_notify): new function (tracepoint_exists): new function (gdb_actions_command): new function (gdb_tracepoint_exists_command): new function (gdb_prompt_command): new function * main.tcl: initialize gdbtk_state(readline) * console.tcl (invoke): get realine working (activate): add prompt argument for readline (setprompt): add prompt argument for readline * interface.tcl (gdbtk_tcl_readline): hack to get readline working * lots: Merge with foundry-971118-build * console.tcl (setprompt): get prompt from gdb * prefs.tcl (pref_set_defaults): add tracepoint defaults * interface.tcl (gdbtk_tcl_tracepoint): new function * src.tcl (constructor): set default behavior of left click, make a tracepoint dot, too (fill_files): "new" function: ripped out of "location" (location): use fill_files instead (do_bp): add support for tracepoints (bp_line): add support for tracepoints (set_tracepoint): new function (config_win): add "Set tracepoint here" to right-click menu * actiondlg.tcl: new file to help with tracepoint data collection actions * tracedlg.tcl: new file to help with tracepoints
1997-11-26 23:38:10 +01:00
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 */
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/* 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
*/
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
void
#ifdef ANSI_PROTOTYPES
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
TclDebug (const char *fmt, ...)
#else
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
TclDebug (va_alist)
va_dcl
#endif
{
va_list args;
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
char buf[512], *v[2], *merge;
#ifdef ANSI_PROTOTYPES
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
va_start (args, fmt);
#else
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
char *fmt;
va_start (args);
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
fmt = va_arg (args, char *);
#endif
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
v[0] = "debug";
v[1] = buf;
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
vsprintf (buf, fmt, args);
va_end (args);
* tracepoint.c (set_raw_tracepoint): make sure there's a trailing slash on the directory name * Merge (lots) with foundry-971118-build * Makefile.in (install-only): install the new gdbtk, not the old * top.h: add declaration of get_prompt * top.c (get_prompt): new function * 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 function (gdb_get_file_command): new function (gdb_get_function_command): new function (gdb_get_tracepoint_info): new function (gdbtk_create_tracepoint): new function (gdbtk_delete_tracepoint): new function (tracepoint_notify): new function (tracepoint_exists): new function (gdb_actions_command): new function (gdb_tracepoint_exists_command): new function (gdb_prompt_command): new function * main.tcl: initialize gdbtk_state(readline) * console.tcl (invoke): get realine working (activate): add prompt argument for readline (setprompt): add prompt argument for readline * interface.tcl (gdbtk_tcl_readline): hack to get readline working * lots: Merge with foundry-971118-build * console.tcl (setprompt): get prompt from gdb * prefs.tcl (pref_set_defaults): add tracepoint defaults * interface.tcl (gdbtk_tcl_tracepoint): new function * src.tcl (constructor): set default behavior of left click, make a tracepoint dot, too (fill_files): "new" function: ripped out of "location" (location): use fill_files instead (do_bp): add support for tracepoints (bp_line): add support for tracepoints (set_tracepoint): new function (config_win): add "Set tracepoint here" to right-click menu * actiondlg.tcl: new file to help with tracepoint data collection actions * tracedlg.tcl: new file to help with tracepoints
1997-11-26 23:38:10 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
merge = Tcl_Merge (2, v);
Tcl_Eval (gdbtk_interp, merge);
Tcl_Free (merge);
}
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/*
* 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
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
cleanup_init (ignored)
int ignored;
{
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
if (gdbtk_interp != NULL)
Tcl_DeleteInterp (gdbtk_interp);
gdbtk_interp = NULL;
}
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/* Come here during long calculations to check for GUI events. Usually invoked
via the QUIT macro. */
void
gdbtk_interactive ()
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
{
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/* Tk_DoOneEvent (TK_DONT_WAIT|TK_IDLE_EVENTS); */
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
}
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
void
gdbtk_start_timer ()
* annotate.c, breakpoint.c, defs.h, gdbtk.c, top.c: Replace enable/disable_breakpoint_hook with modify_breakpoint_hook. * 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.
1995-02-15 02:45:39 +01:00
{
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
static int first = 1;
/*TclDebug ("Starting timer....");*/
if (first)
{
/* first time called, set up all the structs */
first = 0;
sigemptyset (&nullsigmask);
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
act1.sa_handler = x_event;
act1.sa_mask = nullsigmask;
act1.sa_flags = 0;
* annotate.c, breakpoint.c, defs.h, gdbtk.c, top.c: Replace enable/disable_breakpoint_hook with modify_breakpoint_hook. * 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.
1995-02-15 02:45:39 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
act2.sa_handler = SIG_IGN;
act2.sa_mask = nullsigmask;
act2.sa_flags = 0;
* annotate.c, breakpoint.c, defs.h, gdbtk.c, top.c: Replace enable/disable_breakpoint_hook with modify_breakpoint_hook. * 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.
1995-02-15 02:45:39 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
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;
* annotate.c, breakpoint.c, defs.h, gdbtk.c, top.c: Replace enable/disable_breakpoint_hook with modify_breakpoint_hook. * 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.
1995-02-15 02:45:39 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
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 (!gdbtk_timer_going)
{
sigaction (SIGALRM, &act1, NULL);
setitimer (ITIMER_REAL, &it_on, NULL);
gdbtk_timer_going = 1;
}
* annotate.c, breakpoint.c, defs.h, gdbtk.c, top.c: Replace enable/disable_breakpoint_hook with modify_breakpoint_hook. * 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.
1995-02-15 02:45:39 +01:00
}
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
void
gdbtk_stop_timer ()
{
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
if (gdbtk_timer_going)
{
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
gdbtk_timer_going = 0;
/*TclDebug ("Stopping timer.");*/
setitimer (ITIMER_REAL, &it_off, NULL);
sigaction (SIGALRM, &act2, NULL);
}
}
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/* gdbtk_init installs this function as a final cleanup. */
* annotate.c, breakpoint.c, defs.h, gdbtk.c, top.c: Replace enable/disable_breakpoint_hook with modify_breakpoint_hook. * 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.
1995-02-15 02:45:39 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
static void
gdbtk_cleanup (dummy)
PTR dummy;
{
Tcl_Eval (gdbtk_interp, "gdbtk_cleanup");
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
#ifdef IDE
{
struct ide_event_handle *h = (struct ide_event_handle *) dummy;
ide_interface_deregister_all (h);
}
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
#endif
Tcl_Finalize ();
* annotate.c, breakpoint.c, defs.h, gdbtk.c, top.c: Replace enable/disable_breakpoint_hook with modify_breakpoint_hook. * 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.
1995-02-15 02:45:39 +01:00
}
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/* 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.
*/
static void
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
gdbtk_init ( argv0 )
char *argv0;
{
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
struct cleanup *old_chain;
char *lib, *gdbtk_lib, *gdbtk_lib_tmp, *gdbtk_file;
int found_main;
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
Tcl_Obj *auto_path_elem, *auto_path_name;
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
#ifdef IDE
/* start-sanitize-ide */
struct ide_event_handle *h;
const char *errmsg;
char *libexecdir;
/* end-sanitize-ide */
#endif
/* 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. */
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
#ifndef WINNT
if (getenv ("DISPLAY") == NULL)
return;
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
#endif
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
old_chain = make_cleanup (cleanup_init, 0);
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/* First init tcl and tk. */
Tcl_FindExecutable (argv0);
gdbtk_interp = Tcl_CreateInterp ();
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
#ifdef TCL_MEM_DEBUG
Tcl_InitMemory (gdbtk_interp);
#endif
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
if (!gdbtk_interp)
error ("Tcl_CreateInterp failed");
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
if (Tcl_Init(gdbtk_interp) != TCL_OK)
error ("Tcl_Init failed: %s", gdbtk_interp->result);
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
#ifndef IDE
/* For the IDE we register the cleanup later, after we've
initialized events. */
make_final_cleanup (gdbtk_cleanup, NULL);
#endif
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/* Initialize the Paths variable. */
if (ide_initialize_paths (gdbtk_interp, "gdbtcl") != TCL_OK)
error ("ide_initialize_paths failed: %s", gdbtk_interp->result);
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
#ifdef IDE
/* start-sanitize-ide */
/* Find the directory where we expect to find idemanager. We ignore
errors since it doesn't really matter if this fails. */
libexecdir = Tcl_GetVar2 (gdbtk_interp, "Paths", "libexecdir", TCL_GLOBAL_ONLY);
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
IluTk_Init ();
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
h = ide_event_init_from_environment (&errmsg, libexecdir);
make_final_cleanup (gdbtk_cleanup, h);
if (h == NULL)
{
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
Tcl_AppendResult (gdbtk_interp, "can't initialize event system: ", errmsg,
(char *) NULL);
fprintf(stderr, "WARNING: ide_event_init_client failed: %s\n", gdbtk_interp->result);
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
Tcl_SetVar (gdbtk_interp, "IDE_ENABLED", "0", 0);
}
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
else
{
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
if (ide_create_tclevent_command (gdbtk_interp, h) != TCL_OK)
error ("ide_create_tclevent_command failed: %s", gdbtk_interp->result);
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
if (ide_create_edit_command (gdbtk_interp, h) != TCL_OK)
error ("ide_create_edit_command failed: %s", gdbtk_interp->result);
if (ide_create_property_command (gdbtk_interp, h) != TCL_OK)
error ("ide_create_property_command failed: %s", gdbtk_interp->result);
* tracepoint.c (set_raw_tracepoint): make sure there's a trailing slash on the directory name * Merge (lots) with foundry-971118-build * Makefile.in (install-only): install the new gdbtk, not the old * top.h: add declaration of get_prompt * top.c (get_prompt): new function * 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 function (gdb_get_file_command): new function (gdb_get_function_command): new function (gdb_get_tracepoint_info): new function (gdbtk_create_tracepoint): new function (gdbtk_delete_tracepoint): new function (tracepoint_notify): new function (tracepoint_exists): new function (gdb_actions_command): new function (gdb_tracepoint_exists_command): new function (gdb_prompt_command): new function * main.tcl: initialize gdbtk_state(readline) * console.tcl (invoke): get realine working (activate): add prompt argument for readline (setprompt): add prompt argument for readline * interface.tcl (gdbtk_tcl_readline): hack to get readline working * lots: Merge with foundry-971118-build * console.tcl (setprompt): get prompt from gdb * prefs.tcl (pref_set_defaults): add tracepoint defaults * interface.tcl (gdbtk_tcl_tracepoint): new function * src.tcl (constructor): set default behavior of left click, make a tracepoint dot, too (fill_files): "new" function: ripped out of "location" (location): use fill_files instead (do_bp): add support for tracepoints (bp_line): add support for tracepoints (set_tracepoint): new function (config_win): add "Set tracepoint here" to right-click menu * actiondlg.tcl: new file to help with tracepoint data collection actions * tracedlg.tcl: new file to help with tracepoints
1997-11-26 23:38:10 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
if (ide_create_build_command (gdbtk_interp, h) != TCL_OK)
error ("ide_create_build_command failed: %s", gdbtk_interp->result);
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
if (ide_create_window_register_command (gdbtk_interp, h, "gdb-restore")
!= TCL_OK)
error ("ide_create_window_register_command failed: %s",
gdbtk_interp->result);
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
if (ide_create_window_command (gdbtk_interp, h) != TCL_OK)
error ("ide_create_window_command failed: %s", gdbtk_interp->result);
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
if (ide_create_exit_command (gdbtk_interp, h) != TCL_OK)
error ("ide_create_exit_command failed: %s", gdbtk_interp->result);
* tracepoint.c (set_raw_tracepoint): make sure there's a trailing slash on the directory name * Merge (lots) with foundry-971118-build * Makefile.in (install-only): install the new gdbtk, not the old * top.h: add declaration of get_prompt * top.c (get_prompt): new function * 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 function (gdb_get_file_command): new function (gdb_get_function_command): new function (gdb_get_tracepoint_info): new function (gdbtk_create_tracepoint): new function (gdbtk_delete_tracepoint): new function (tracepoint_notify): new function (tracepoint_exists): new function (gdb_actions_command): new function (gdb_tracepoint_exists_command): new function (gdb_prompt_command): new function * main.tcl: initialize gdbtk_state(readline) * console.tcl (invoke): get realine working (activate): add prompt argument for readline (setprompt): add prompt argument for readline * interface.tcl (gdbtk_tcl_readline): hack to get readline working * lots: Merge with foundry-971118-build * console.tcl (setprompt): get prompt from gdb * prefs.tcl (pref_set_defaults): add tracepoint defaults * interface.tcl (gdbtk_tcl_tracepoint): new function * src.tcl (constructor): set default behavior of left click, make a tracepoint dot, too (fill_files): "new" function: ripped out of "location" (location): use fill_files instead (do_bp): add support for tracepoints (bp_line): add support for tracepoints (set_tracepoint): new function (config_win): add "Set tracepoint here" to right-click menu * actiondlg.tcl: new file to help with tracepoint data collection actions * tracedlg.tcl: new file to help with tracepoints
1997-11-26 23:38:10 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
if (ide_create_help_command (gdbtk_interp) != TCL_OK)
error ("ide_create_help_command failed: %s", gdbtk_interp->result);
* tracepoint.c (set_raw_tracepoint): make sure there's a trailing slash on the directory name * Merge (lots) with foundry-971118-build * Makefile.in (install-only): install the new gdbtk, not the old * top.h: add declaration of get_prompt * top.c (get_prompt): new function * 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 function (gdb_get_file_command): new function (gdb_get_function_command): new function (gdb_get_tracepoint_info): new function (gdbtk_create_tracepoint): new function (gdbtk_delete_tracepoint): new function (tracepoint_notify): new function (tracepoint_exists): new function (gdb_actions_command): new function (gdb_tracepoint_exists_command): new function (gdb_prompt_command): new function * main.tcl: initialize gdbtk_state(readline) * console.tcl (invoke): get realine working (activate): add prompt argument for readline (setprompt): add prompt argument for readline * interface.tcl (gdbtk_tcl_readline): hack to get readline working * lots: Merge with foundry-971118-build * console.tcl (setprompt): get prompt from gdb * prefs.tcl (pref_set_defaults): add tracepoint defaults * interface.tcl (gdbtk_tcl_tracepoint): new function * src.tcl (constructor): set default behavior of left click, make a tracepoint dot, too (fill_files): "new" function: ripped out of "location" (location): use fill_files instead (do_bp): add support for tracepoints (bp_line): add support for tracepoints (set_tracepoint): new function (config_win): add "Set tracepoint here" to right-click menu * actiondlg.tcl: new file to help with tracepoint data collection actions * tracedlg.tcl: new file to help with tracepoints
1997-11-26 23:38:10 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/*
if (ide_initialize (gdbtk_interp, "gdb") != TCL_OK)
error ("ide_initialize failed: %s", gdbtk_interp->result);
*/
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
Tcl_SetVar (gdbtk_interp, "IDE_ENABLED", "1", 0);
}
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/* end-sanitize-ide */
#else
Tcl_SetVar (gdbtk_interp, "IDE_ENABLED", "0", 0);
#endif /* IDE */
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/* We don't want to open the X connection until we've done all the
IDE initialization. Otherwise, goofy looking unfinished windows
pop up when ILU drops into the TCL event loop. */
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
if (Tk_Init(gdbtk_interp) != TCL_OK)
error ("Tk_Init failed: %s", gdbtk_interp->result);
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
if (Itcl_Init(gdbtk_interp) == TCL_ERROR)
error ("Itcl_Init failed: %s", gdbtk_interp->result);
Tcl_StaticPackage(gdbtk_interp, "Tktable", Tktable_Init,
(Tcl_PackageInitProc *) NULL);
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
if (Tix_Init(gdbtk_interp) != TCL_OK)
error ("Tix_Init failed: %s", gdbtk_interp->result);
Tcl_StaticPackage(gdbtk_interp, "Tktable", Tktable_Init,
(Tcl_PackageInitProc *) NULL);
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
if (Tktable_Init(gdbtk_interp) != TCL_OK)
error ("Tktable_Init failed: %s", gdbtk_interp->result);
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
Tcl_StaticPackage(gdbtk_interp, "Tktable", Tktable_Init,
(Tcl_PackageInitProc *) NULL);
/*
* These are the commands to do some Windows Specific stuff...
*/
* tracepoint.c (set_raw_tracepoint): make sure there's a trailing slash on the directory name * Merge (lots) with foundry-971118-build * Makefile.in (install-only): install the new gdbtk, not the old * top.h: add declaration of get_prompt * top.c (get_prompt): new function * 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 function (gdb_get_file_command): new function (gdb_get_function_command): new function (gdb_get_tracepoint_info): new function (gdbtk_create_tracepoint): new function (gdbtk_delete_tracepoint): new function (tracepoint_notify): new function (tracepoint_exists): new function (gdb_actions_command): new function (gdb_tracepoint_exists_command): new function (gdb_prompt_command): new function * main.tcl: initialize gdbtk_state(readline) * console.tcl (invoke): get realine working (activate): add prompt argument for readline (setprompt): add prompt argument for readline * interface.tcl (gdbtk_tcl_readline): hack to get readline working * lots: Merge with foundry-971118-build * console.tcl (setprompt): get prompt from gdb * prefs.tcl (pref_set_defaults): add tracepoint defaults * interface.tcl (gdbtk_tcl_tracepoint): new function * src.tcl (constructor): set default behavior of left click, make a tracepoint dot, too (fill_files): "new" function: ripped out of "location" (location): use fill_files instead (do_bp): add support for tracepoints (bp_line): add support for tracepoints (set_tracepoint): new function (config_win): add "Set tracepoint here" to right-click menu * actiondlg.tcl: new file to help with tracepoint data collection actions * tracedlg.tcl: new file to help with tracepoints
1997-11-26 23:38:10 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
#ifdef __CYGWIN32__
if (ide_create_messagebox_command (gdbtk_interp) != TCL_OK)
error ("messagebox command initialization failed");
/* On Windows, create a sizebox widget command */
if (ide_create_sizebox_command (gdbtk_interp) != TCL_OK)
error ("sizebox creation failed");
if (ide_create_winprint_command (gdbtk_interp) != TCL_OK)
error ("windows print code initialization failed");
* tracepoint.c (set_raw_tracepoint): make sure there's a trailing slash on the directory name * Merge (lots) with foundry-971118-build * Makefile.in (install-only): install the new gdbtk, not the old * top.h: add declaration of get_prompt * top.c (get_prompt): new function * 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 function (gdb_get_file_command): new function (gdb_get_function_command): new function (gdb_get_tracepoint_info): new function (gdbtk_create_tracepoint): new function (gdbtk_delete_tracepoint): new function (tracepoint_notify): new function (tracepoint_exists): new function (gdb_actions_command): new function (gdb_tracepoint_exists_command): new function (gdb_prompt_command): new function * main.tcl: initialize gdbtk_state(readline) * console.tcl (invoke): get realine working (activate): add prompt argument for readline (setprompt): add prompt argument for readline * interface.tcl (gdbtk_tcl_readline): hack to get readline working * lots: Merge with foundry-971118-build * console.tcl (setprompt): get prompt from gdb * prefs.tcl (pref_set_defaults): add tracepoint defaults * interface.tcl (gdbtk_tcl_tracepoint): new function * src.tcl (constructor): set default behavior of left click, make a tracepoint dot, too (fill_files): "new" function: ripped out of "location" (location): use fill_files instead (do_bp): add support for tracepoints (bp_line): add support for tracepoints (set_tracepoint): new function (config_win): add "Set tracepoint here" to right-click menu * actiondlg.tcl: new file to help with tracepoint data collection actions * tracedlg.tcl: new file to help with tracepoints
1997-11-26 23:38:10 +01:00
/* start-sanitize-ide */
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/* An interface to ShellExecute. */
if (ide_create_shell_execute_command (gdbtk_interp) != TCL_OK)
error ("shell execute command initialization failed");
* tracepoint.c (set_raw_tracepoint): make sure there's a trailing slash on the directory name * Merge (lots) with foundry-971118-build * Makefile.in (install-only): install the new gdbtk, not the old * top.h: add declaration of get_prompt * top.c (get_prompt): new function * 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 function (gdb_get_file_command): new function (gdb_get_function_command): new function (gdb_get_tracepoint_info): new function (gdbtk_create_tracepoint): new function (gdbtk_delete_tracepoint): new function (tracepoint_notify): new function (tracepoint_exists): new function (gdb_actions_command): new function (gdb_tracepoint_exists_command): new function (gdb_prompt_command): new function * main.tcl: initialize gdbtk_state(readline) * console.tcl (invoke): get realine working (activate): add prompt argument for readline (setprompt): add prompt argument for readline * interface.tcl (gdbtk_tcl_readline): hack to get readline working * lots: Merge with foundry-971118-build * console.tcl (setprompt): get prompt from gdb * prefs.tcl (pref_set_defaults): add tracepoint defaults * interface.tcl (gdbtk_tcl_tracepoint): new function * src.tcl (constructor): set default behavior of left click, make a tracepoint dot, too (fill_files): "new" function: ripped out of "location" (location): use fill_files instead (do_bp): add support for tracepoints (bp_line): add support for tracepoints (set_tracepoint): new function (config_win): add "Set tracepoint here" to right-click menu * actiondlg.tcl: new file to help with tracepoint data collection actions * tracedlg.tcl: new file to help with tracepoints
1997-11-26 23:38:10 +01:00
/* end-sanitize-ide */
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
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");
#endif
* tracepoint.c (set_raw_tracepoint): make sure there's a trailing slash on the directory name * Merge (lots) with foundry-971118-build * Makefile.in (install-only): install the new gdbtk, not the old * top.h: add declaration of get_prompt * top.c (get_prompt): new function * 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 function (gdb_get_file_command): new function (gdb_get_function_command): new function (gdb_get_tracepoint_info): new function (gdbtk_create_tracepoint): new function (gdbtk_delete_tracepoint): new function (tracepoint_notify): new function (tracepoint_exists): new function (gdb_actions_command): new function (gdb_tracepoint_exists_command): new function (gdb_prompt_command): new function * main.tcl: initialize gdbtk_state(readline) * console.tcl (invoke): get realine working (activate): add prompt argument for readline (setprompt): add prompt argument for readline * interface.tcl (gdbtk_tcl_readline): hack to get readline working * lots: Merge with foundry-971118-build * console.tcl (setprompt): get prompt from gdb * prefs.tcl (pref_set_defaults): add tracepoint defaults * interface.tcl (gdbtk_tcl_tracepoint): new function * src.tcl (constructor): set default behavior of left click, make a tracepoint dot, too (fill_files): "new" function: ripped out of "location" (location): use fill_files instead (do_bp): add support for tracepoints (bp_line): add support for tracepoints (set_tracepoint): new function (config_win): add "Set tracepoint here" to right-click menu * actiondlg.tcl: new file to help with tracepoint data collection actions * tracedlg.tcl: new file to help with tracepoints
1997-11-26 23:38:10 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/*
* This adds all the Gdbtk commands.
*/
if (Gdbtk_Init(gdbtk_interp) != TCL_OK)
* tracepoint.c (set_raw_tracepoint): make sure there's a trailing slash on the directory name * Merge (lots) with foundry-971118-build * Makefile.in (install-only): install the new gdbtk, not the old * top.h: add declaration of get_prompt * top.c (get_prompt): new function * 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 function (gdb_get_file_command): new function (gdb_get_function_command): new function (gdb_get_tracepoint_info): new function (gdbtk_create_tracepoint): new function (gdbtk_delete_tracepoint): new function (tracepoint_notify): new function (tracepoint_exists): new function (gdb_actions_command): new function (gdb_tracepoint_exists_command): new function (gdb_prompt_command): new function * main.tcl: initialize gdbtk_state(readline) * console.tcl (invoke): get realine working (activate): add prompt argument for readline (setprompt): add prompt argument for readline * interface.tcl (gdbtk_tcl_readline): hack to get readline working * lots: Merge with foundry-971118-build * console.tcl (setprompt): get prompt from gdb * prefs.tcl (pref_set_defaults): add tracepoint defaults * interface.tcl (gdbtk_tcl_tracepoint): new function * src.tcl (constructor): set default behavior of left click, make a tracepoint dot, too (fill_files): "new" function: ripped out of "location" (location): use fill_files instead (do_bp): add support for tracepoints (bp_line): add support for tracepoints (set_tracepoint): new function (config_win): add "Set tracepoint here" to right-click menu * actiondlg.tcl: new file to help with tracepoint data collection actions * tracedlg.tcl: new file to help with tracepoints
1997-11-26 23:38:10 +01:00
{
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
error("Gdbtk_Init failed: %s", gdbtk_interp->result);
* tracepoint.c (set_raw_tracepoint): make sure there's a trailing slash on the directory name * Merge (lots) with foundry-971118-build * Makefile.in (install-only): install the new gdbtk, not the old * top.h: add declaration of get_prompt * top.c (get_prompt): new function * 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 function (gdb_get_file_command): new function (gdb_get_function_command): new function (gdb_get_tracepoint_info): new function (gdbtk_create_tracepoint): new function (gdbtk_delete_tracepoint): new function (tracepoint_notify): new function (tracepoint_exists): new function (gdb_actions_command): new function (gdb_tracepoint_exists_command): new function (gdb_prompt_command): new function * main.tcl: initialize gdbtk_state(readline) * console.tcl (invoke): get realine working (activate): add prompt argument for readline (setprompt): add prompt argument for readline * interface.tcl (gdbtk_tcl_readline): hack to get readline working * lots: Merge with foundry-971118-build * console.tcl (setprompt): get prompt from gdb * prefs.tcl (pref_set_defaults): add tracepoint defaults * interface.tcl (gdbtk_tcl_tracepoint): new function * src.tcl (constructor): set default behavior of left click, make a tracepoint dot, too (fill_files): "new" function: ripped out of "location" (location): use fill_files instead (do_bp): add support for tracepoints (bp_line): add support for tracepoints (set_tracepoint): new function (config_win): add "Set tracepoint here" to right-click menu * actiondlg.tcl: new file to help with tracepoint data collection actions * tracedlg.tcl: new file to help with tracepoints
1997-11-26 23:38:10 +01:00
}
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
Tcl_StaticPackage(gdbtk_interp, "Gdbtk", Gdbtk_Init, NULL);
/* This adds all the hooks that call up from the bowels of gdb
* back into Tcl-land...
*/
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
gdbtk_add_hooks();
/* Add a back door to Tk from the gdb console... */
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
add_com ("tk", class_obscure, tk_command,
"Send a command directly into tk.");
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
Tcl_LinkVar (gdbtk_interp, "disassemble-from-exec", (char *) &disassemble_from_exec,
TCL_LINK_INT);
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/* find the gdb tcl library and source main.tcl */
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
gdbtk_lib = getenv ("GDBTK_LIBRARY");
if (!gdbtk_lib)
{
if (access ("gdbtcl/main.tcl", R_OK) == 0)
gdbtk_lib = "gdbtcl";
else
gdbtk_lib = GDBTK_LIBRARY;
}
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
gdbtk_lib_tmp = xstrdup (gdbtk_lib);
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
found_main = 0;
/* see if GDBTK_LIBRARY is a path list */
lib = strtok (gdbtk_lib_tmp, GDBTK_PATH_SEP);
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
auto_path_name = Tcl_NewStringObj ("auto_path", -1);
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
do
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
{
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
auto_path_elem = Tcl_NewStringObj (lib, -1);
if (Tcl_ObjSetVar2 (gdbtk_interp, auto_path_name, NULL, auto_path_elem,
TCL_GLOBAL_ONLY | TCL_APPEND_VALUE | TCL_LIST_ELEMENT ) == NULL)
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
{
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
fputs_unfiltered (Tcl_GetVar (gdbtk_interp, "errorInfo", 0), gdb_stderr);
error ("");
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
}
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
if (!found_main)
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
{
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
gdbtk_file = concat (lib, "/main.tcl", (char *) NULL);
if (access (gdbtk_file, R_OK) == 0)
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
{
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
found_main++;
Tcl_SetVar (gdbtk_interp, "GDBTK_LIBRARY", lib, 0);
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
}
}
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
}
while ((lib = strtok (NULL, ":")) != NULL);
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
free (gdbtk_lib_tmp);
Tcl_DecrRefCount(auto_path_name);
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
if (!found_main)
{
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/* Try finding it with the auto path. */
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
static const char script[] ="\
proc gdbtk_find_main {} {\n\
global auto_path GDBTK_LIBRARY\n\
foreach dir $auto_path {\n\
set f [file join $dir main.tcl]\n\
if {[file exists $f]} then {\n\
set GDBTK_LIBRARY $dir\n\
return $f\n\
}\n\
}\n\
return ""\n\
}\n\
gdbtk_find_main";
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
if (Tcl_GlobalEval (gdbtk_interp, (char *) script) != TCL_OK)
{
fputs_unfiltered (Tcl_GetVar (gdbtk_interp, "errorInfo", 0), gdb_stderr);
error ("");
}
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
if (gdbtk_interp->result[0] != '\0')
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
{
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
gdbtk_file = xstrdup (gdbtk_interp->result);
found_main++;
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
}
}
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
if (!found_main)
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
{
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
fputs_unfiltered_hook = NULL; /* Force errors to stdout/stderr */
if (getenv("GDBTK_LIBRARY"))
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
{
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
fprintf_unfiltered (stderr, "Unable to find main.tcl in %s\n",getenv("GDBTK_LIBRARY"));
fprintf_unfiltered (stderr,
"Please set GDBTK_LIBRARY to a path that includes the GDB tcl files.\n");
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
}
else
{
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
fprintf_unfiltered (stderr, "Unable to find main.tcl in %s\n", GDBTK_LIBRARY);
fprintf_unfiltered (stderr, "You might want to set GDBTK_LIBRARY\n");
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
}
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
error("");
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
}
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/* Defer setup of fputs_unfiltered_hook to near the end so that error messages
prior to this point go to stdout/stderr. */
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
fputs_unfiltered_hook = gdbtk_fputs;
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/* start-sanitize-tclpro */
#ifdef TCLPRO_DEBUGGER
{
Tcl_DString source_cmd;
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
Tcl_DStringInit (&source_cmd);
Tcl_DStringAppend (&source_cmd,
"if {[info exists env(DEBUG_STUB)]} {source $env(DEBUG_STUB); " -1);
Tcl_DStringAppend (&source_cmd, "debugger_init; debugger_eval {source {", -1);
Tcl_DStringAppend (&source_cmd, gdbtk_file, -1);
Tcl_DStringAppend (&source_cmd, "}}} else {source {", -1);
Tcl_DStringAppend (&source_cmd, gdbtk_file, -1);
Tcl_DStringAppend (&source_cmd, "}}", -1);
if (Tcl_GlobalEval (gdbtk_interp, Tcl_DStringValue (&source_cmd)) != TCL_OK)
#else
/* end-sanitize-tclpro */
if (Tcl_EvalFile (gdbtk_interp, gdbtk_file) != TCL_OK)
/* start-sanitize-tclpro */
#endif
/* end-sanitize-tclpro */
{
char *msg;
Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> merged changes from Foundry (list follows by file/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. * ser-unix.c - Keith Seitz <keiths@onions.cygnus.com> (wait_for): Don't reset the timeout_remaining for CYGWIN32, since we now effectively poll the serial port. Don't reset the current_timeout, either, since this member is used by hardwire_readchar to track the timeout and call the ui_loop_hook. (hardwire_readchar): Poll the serial port for Cygwin32. We timeout every second, update the UI, and loop around doing this until we have hit the real timeout or we get data or an error. This will allow the UI to stay active while gdb is "blocked" talking to the target. - Martin M. Hunt <hunt@cygnus.com> (wait_for): Do reset current_timeout because it is only used to keep track of what the current timeout for the scb is. * top.c - Martin M. Hunt <hunt@cygnus.com> (quit_confirm): Change exit message again for GUI. (pc_changed_hook): Add prototype. - Tom Tromey <tromey@cygnus.com> (quit_confirm): Added missing `else'. (quit_confirm): Special-case message if init_ui_hook is set. * symtab.c - Martin M. Hunt <hunt@cygnus.com> (find_pc_sect_line): If no symbol information is found, return correct pc anyway. (find_methods): Comment out an apparently bogus error message because it messes up Foundry. * serial.c - Martin M. Hunt <hunt@cygnus.com> (_initialize_serial): Add a description of "set remotelogbase". * findvar.c - Martin M. Hunt <hunt@cygnus.com> (write_register_gen): Add call to pc_changed_hook if the PC is being changed. * defs.h - Martin M. Hunt <hunt@cygnus.com> (pc_changed_hook): Define. * command.c - Martin M. Hunt <hunt@cygnus.com> (do_setshow_command): If no arguments are supplied, don't dump core, instead print out an error message. * breakpoint.c - Martin M. Hunt <hunt@cygnus.com> Make set_raw_breakpoint, set_breakpoint_count, and breakpoint_count non-static so they are accessible from gdbtk.c. (enable_breakpoint): Enable breakpoint with same disposition instead of changing all breakpoints to donttouch. * annotate.h - Keith Seitz <keiths@onions.cygnus.com> Add declarations for annotation hooks. * annotate.c - Keith Seitz <keiths@onions.cygnus.com> Add hooks: annotate_starting_hook, annotate_stopped_hook, annotate_signalled_hook, annotate_exited_hook. (annotate_starting): If hook exists, call it instead. (annotate_stopped): If hook exists, call it instead. (annotate_exited): If hook exists, call it instead. (annotate_signalled): If hook exists, call it instead. 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.
1998-03-23 00:02:10 +01:00
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/* Force errorInfo to be set up propertly. */
Tcl_AddErrorInfo (gdbtk_interp, "");
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
msg = Tcl_GetVar (gdbtk_interp, "errorInfo", TCL_GLOBAL_ONLY);
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
fputs_unfiltered_hook = NULL; /* Force errors to stdout/stderr */
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
#ifdef _WIN32
MessageBox (NULL, msg, NULL, MB_OK | MB_ICONERROR | MB_TASKMODAL);
#else
fputs_unfiltered (msg, gdb_stderr);
#endif
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
error ("");
}
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/* start-sanitize-tclpro */
#ifdef TCLPRO_DEBUGGER
Tcl_DStringFree(&source_cmd);
}
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
#endif
/* end-sanitize-tclpro */
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
#ifdef IDE
/* start-sanitize-ide */
/* Don't do this until we have initialized. Otherwise, we may get a
run command before we are ready for one. */
if (ide_run_server_init (gdbtk_interp, h) != TCL_OK)
error ("ide_run_server_init failed: %s", gdbtk_interp->result);
/* end-sanitize-ide */
#endif
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
free (gdbtk_file);
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/* Now source in the filename provided by the --tclcommand option.
This is mostly used for the gdbtk testsuite... */
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
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);
}
discard_cleanups (old_chain);
}
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/* 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 (filename)
char *filename;
{
if (access (filename, R_OK) != 0)
return 0;
else
gdbtk_source_filename = xstrdup (filename);
return 1;
}
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
/* Come here during initialize_all_files () */
void
_initialize_gdbtk ()
{
if (use_windows)
{
/* Tell the rest of the world that Gdbtk is now set up. */
init_ui_hook = gdbtk_init;
#ifdef __CYGWIN32__
(void) FreeConsole ();
#endif
}
#ifdef __CYGWIN32__
else
{
DWORD ft = GetFileType (GetStdHandle (STD_INPUT_HANDLE));
void cygwin32_attach_handle_to_fd (char *, int, HANDLE, int, int);
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
}
Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com> * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an error in loading an executible specified on the command line, then the pre_add_symbol hook would have called gdbtk_busy but the corresponding call to gdbtk_idle would not have occured. Also changed some catch calls so they didn't use "catch {set foo [real_command]}" but rather the more efficient: "catch {real_command} foo" * register.tcl: more catch cleanups * src.tcl: more catch cleanups * stack.tcl: more catch cleanups * target.tcl: more catch cleanups * tdump.tcl: more catch cleanups * variables.tcl: more catch cleanups * watch.tcl: more catch cleanups * 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.c: removed all the commands and hooks from this file so now it contains only the startup code. * 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. Also added gdbtk as a package into gdbtk_interp. * 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.
1998-07-01 21:29:14 +02:00
static void
tk_command (cmd, from_tty)
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 = strdup (gdbtk_interp->result);
old_chain = make_cleanup (free, result);
if (retval != TCL_OK)
error (result);
printf_unfiltered ("%s\n", result);
do_cleanups (old_chain);
}