From: Keith Seitz Date: Wed, 26 Nov 1997 22:38:10 +0000 (+0000) Subject: * tracepoint.c (set_raw_tracepoint): make sure there's a trailing slash on X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=018d76dddba746b8e59770136e5ca167ae72e15b;p=binutils-gdb.git * 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 --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fd5b76bfdad..15756b74b9b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,35 @@ +Wed Nov 26 11:33:09 1997 Keith Seitz + + * 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 + Wed Nov 26 09:59:47 1997 Andrew Cagney * dwarf2read.c (struct comp_unit_head): Change length and @@ -96,6 +128,15 @@ Fri Nov 14 13:04:34 1997 Jeffrey A Law (law@cygnus.com) * jv-exp.y (copy_exp, insert_exp): Avoid ANSI prototypes. +Thu Nov 13 18:15:54 1997 Ian Lance Taylor + + * gdbtk.c: Move include of gdbcore.h to top of file. + (close_bfds): New static function if _WIN32. + (gdbtk_readline): Call close_bfds. + (call_wrapper, tk_command_loop): Likewise. + (gdb_clear_file): New static function. + (gdbtk_init): Create gdb_clear_file Tcl command. + Thu Nov 13 09:47:35 1997 Michael Meissner * d30v-tdep.c (d30v_print_flags): Function to print the d30v flags @@ -109,11 +150,36 @@ Thu Nov 13 09:47:35 1997 Michael Meissner * config/d30v/tm-d30v.h (PSW_*): Add macros for each of the PSW bits that are defined. +Wed Nov 12 14:58:39 1997 Jeff Holcomb + + * gdbtk.c: gdbtk_load_hash and ui_load_progress_hook return an + int result. + (gdbtk_load_hash): download hash routine returns an int result. + * symfile.c (generic_load): Handle cancel from the + ui_load_progress_hook routine. + * dsrec.c (load_srec): Handle cancel from the + ui_load_progress_hook routine. + Mon Nov 10 15:13:13 1997 Ian Lance Taylor * valprint.c (print_longest): The b, h, w, and g format specifiers print unsigned values. +Mon Nov 10 15:11:51 1997 Ian Lance Taylor + + * gdbtk.c (gdbtk_init): Call ide_create_shell_execute_command if + __CYGWIN32__. + * configure.in: Add -lshell32 to WIN32LIBS on cygwin32. + * configure: Rebuild. + +Mon Nov 10 02:02:49 1997 Martin M. Hunt + + * top.c (quit_confirm): Change exit message. + +Sun Nov 9 16:25:34 1997 Tom Tromey + + * gdbtk.c (gdbtk_init): Run ide_create_help_command. + Tue Nov 4 16:52:50 1997 Geoffrey Noer * config/i386/cygwin32.mh: because cygwin.dll calls malloc/realloc @@ -144,6 +210,15 @@ Wed Oct 29 15:53:24 1997 David Taylor * solib.c (solib_break_names): add entry for Solaris 2.6 run time linker. From Casper Dik via Peter Schauer. +Tue Oct 28 17:31:47 1997 Martin M. Hunt + + * gdbtk.c (gdbtk_init): Call ide_create_winprint_command. + + * configure.in (configdir): Add -lcomdlg32 and -ladvapi32 + to WIN32LIBS. + + * configure: Rebuild + Fri Oct 24 16:48:21 1997 David Taylor * sol-thread.c (sol_find_new_threads_callback, @@ -162,6 +237,16 @@ Thu Oct 23 16:16:04 1997 Jeff Law (law@fast.cs.utah.edu) found. All callers changed appropriately. (define_symbol): Don't perform assignment inside conditionals. +Thu Oct 23 15:53:37 1997 Ian Lance Taylor + + * configure.in: Add -lgdi32 to WIN32LIBS when linking gdbtk on + cygwin32. + * configure: Rebuild. + +Wed Oct 22 21:32:54 1997 Martin M. Hunt + + * gdbtk.c (gdbtk_init): Create sizebox command on Windows. + Wed Oct 22 13:04:52 1997 Jeffrey A Law (law@cygnus.com) * mdebugread.c (psymtab_to_symtab_1): Handle new live range stabs @@ -224,6 +309,12 @@ Tue Oct 14 22:13:27 1997 Dawn Perchik * stabsread.c: Make ref_map entries dynamically allocated. +Thu Oct 9 14:33:21 1997 Ian Lance Taylor + + * gdbtk.c (gdbtk_init): Remove assertion argument from call to + ide_create_window_register_command. + * gdbtcl2/main.tcl: Call ide_window_register restorer. + Thu Oct 9 12:37:57 1997 Frank Ch. Eigler * printcmd.c (print_address_symbolic, address_info): Mask @@ -267,6 +358,11 @@ start-sanitize-r5900 to disable use of FP registers for function arguments. end-sanitize-r5900 +Wed Oct 1 11:09:52 1997 Tom Tromey + + * gdbtk.c (gdbtk_init): Pass name of restore interface to + ide_create_window_register_command. + Mon Sep 29 23:03:03 1997 Mark Alexander * mips-tdep.c (set_reg_offset): New function. @@ -293,6 +389,16 @@ end-sanitize-r5900 * config/mips/tm-mips.h (NUM_REGS): Define conditionally. (REGISTER_NAMES): Ditto. +Fri Sep 26 21:08:22 1997 Keith Seitz + + * gdbtk.c (gdbtk_init): initialize ui_load_progress_hook + + * dsrec.c (load_srec): add ui_load_progress_hook to + display some feedback to user + + * symfile.c (generic_load): add ui_load_progress_hook to + display some feedback to user + Fri Sep 26 17:32:22 1997 Jason Molenda (crash@pern.cygnus.com) * command.c (add_cmd, add_show_from_set): Insert new commands in @@ -329,6 +435,13 @@ Fri Sep 26 10:33:54 1997 Felix Lee * configure.tgt (v850-*-*): necmsg.lib instead of v850.lib. +Thu Sep 25 03:05:00 1997 Martin M. Hunt + + * gdbtk.c (gdb_load_info): New function. Returns a list + of section names and sizes for an executable. + (gdbtk_load_hash): Stub function to call tcl function + download_hash. + Wed Sep 24 14:02:09 1997 Andrew Cagney * config/v850/tm-v850.h (BREAKPOINT): Use 1 word DIVH insn with @@ -363,6 +476,10 @@ Tue Sep 23 11:24:13 1997 Stan Shebs * Makefile.in (ALLCONFIG): Remove, inaccurate and never used. +Tue Sep 23 01:29:00 1997 Martin M. Hunt + + * gdbtk.c (gdb_get_mem): Fix compiler warning. + Tue Sep 23 00:08:18 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) * mips-tdep.c (mips_push_arguments): Tweak alignment of register @@ -377,6 +494,10 @@ Mon Sep 22 15:32:06 1997 Dawn Perchik * stabsread.h, symtab.h, dbxread.c, symtab.c, stabsread.c: Fix prototypes. Remove function scoped function declarations. +Sun Sep 21 00:15:00 1997 Martin M. Hunt + + * gdbtk.c (gdb_get_mem): Fix problem with ASCII dump. + Fri Sep 19 18:51:26 1997 Felix Lee * config/i386/windows.mh (XDEPFILES): need to list some files @@ -414,6 +535,11 @@ Tue Sep 16 19:56:23 1997 Per Bothner on a new 'run' command. (symbol_add_stub): First look for existing objfile with same name. +Tue Sep 16 18:07:17 1997 Martin M. Hunt + + * gdbtk.c (gdb_get_mem): New function. Returns + a formatted memory dump with optional ASCII dump. + Tue Sep 16 16:00:01 1997 Stan Shebs * remote-sds.c (sds_load): New function. @@ -480,6 +606,22 @@ Mon Sep 8 16:45:51 1997 Stu Grossman mechanism. Remove prototypes for dos_async_* functions. They don't exist anymore. +Mon Sep 8 12:48:50 1997 Ian Lance Taylor + + * gdbtk.c: Include ilutk.h if IDE. + (gdb_confirm_quit, gdb_force_quit): New static functions. + (gdbtk_init): Add Tcl commands gdb_confirm_quit and + gdb_force_quit. + * top.c (quit_confirm, quit_force): New functions, broken out of + quit_command. + (quit_command): Just call quit_confirm and quit_force. + * top.h (quit_confirm, quit_force): Declare. + +Mon Sep 8 03:05:33 1997 Martin M. Hunt + + * gdbtk.c (gdb_get_breakpoint_info): Now returns the + function a breakpoint is in. + Sun Sep 7 17:26:30 1997 Dawn Perchik * dbxread.c, buildsym.c, symtab.c, stabsread.c: Add support for @@ -487,6 +629,23 @@ Sun Sep 7 17:26:30 1997 Dawn Perchik * stabsread.h, partial-stab.h: Add prototypes for new functions. * symtab.h: Add structure for storing live range information. +Fri Sep 5 20:23:58 1997 Ian Lance Taylor + + * gdbtk.c (gdbtk_init): Call ide_create_exit_command. + +Wed Sep 3 19:39:15 1997 Ian Lance Taylor + + * gdbtk.c: Include guitcl.h. + (gdbtk_init): Always call ide_initialize_paths. Set the Tcl + variable IDE to 1 when using the IDE. Always try using auto path + to find main.tcl. + * Makefile.in (IDE_CFLAGS_X): Always include libide. + (LIBIDE): New variable. + (IDE_X): Omit -lide. + (IDE_DEPS): Omit libide. + * configure.in: Add LIBIDE to TCL_LIBS and CONFIG_DEPS. + * configure: Rebuild. + Wed Sep 3 16:39:39 1997 Andrew Cagney * top.c (set_arch): New function, update target_architecture. @@ -570,11 +729,70 @@ Mon Aug 25 12:21:46 1997 Andrew Cagney * remote-sim.c (gdbsim_open): Pass exec_bfd to sim_open call. +Mon Aug 25 02:28:55 1997 Keith Seitz + + * gdbtk.c: (gdb_target_has_inferior) check if inferior_pid is non-zero + before assuming that the inferior is running. + + +Mon Aug 25 01:06:48 1997 Ian Lance Taylor + + * gdbtk.c (gdbtk_start_timer): Pass third argument to setitimer. + (gdbtk_stop_timer): Likewise. + +Mon Aug 25 00:23:08 1997 Keith Seitz + + * gdbtk.c: (gdbtk_init) create new command "gdb_target_has_execution" + (gdb_target_has_execution_command) new function + Sun Aug 24 21:16:59 1997 Geoffrey Noer * ocd.c: comment out sections that create and flush wigglers.log log file when using the wiggler. +Sun Aug 24 20:27:22 1997 Ian Lance Taylor + + * gdbtk.c (gdb_loc): If there are no symbols, just bail + immediately. + (tk_command_loop): Print errors encountered while running + gdbtk_tcl_preloop. + +start-sanitize-gdbtk +Sun Aug 24 13:44:03 1997 Tom Tromey + + * gdbtk.c (gdbtk_init): Run ide_create_build_command. + +end-sanitize-gdbtk + +Sat Aug 23 21:53:39 1997 Ian Lance Taylor + + * gdbtk.c: If CYGWIN32, include . + (x_fd): Don't define if WINNT. + (gdbtk_start_timer, gdbtk_stop_timer): New static functions if + CYGWIN32. + (gdbtk_wait): Don't set up signal handling if WINNT. If CYGWIN32, + call gdbtk_start_timer and gdbtk_stop_timer. + (gdbtk_init): Don't set up signal handling or make x_fd + asynchronous if CYGWIN32. + +Fri Aug 22 15:23:15 1997 Ian Lance Taylor + + * gdbtk.c (error_string_ptr): New static variable. + (gdbtk_fputs): If result_ptr is NULL, and error_string_ptr is not + NULL, and we're outputting to stderr, append string to + error_string_ptr rather than calling gdbtk_tcl_fputs. + (call_wrapper): Set up error_string_ptr. Put both error string + and normal string in Tcl result. + + * gdbtk.c (gdbtk_init): Don't call ide_run_server_init until after + gdb has initialized. + +Thu Aug 21 19:14:38 1997 Ian Lance Taylor + + * gdbtk.c: If _WIN32, include winuser.h. + (gdbtk_init): If _WIN32, use MessageBox to display an error + evaluating main.tcl. + Thu Aug 21 16:18:08 1997 Geoffrey Noer * config/powerpc/ppc-eabi.mt: @@ -595,6 +813,35 @@ Thu Aug 21 14:56:04 1997 Geoffrey Noer * ser-ocd.c (ocd_readchar): error if we attempt to read past the end of the from_wiggler_buffer. +start-sanitize-gdbtk +Thu Aug 21 00:48:00 1997 Martin M. Hunt + + * gdbtk.c (gdbtk_init): Add call to ide_run_server_init(). + (gdb_cmd): For the load command, don't buffer the I/O. + +end-sanitize-gdbtk + +Wed Aug 20 14:08:39 1997 Stan Shebs + + * dink32-rom.c: Don't use "mf" command to fill, is too picky + about alignment. + +start-sanitize-gdbtk +Wed Aug 20 11:41:22 1997 Martin M. Hunt + + * gdbtk.c (gdbtk_query): Chaneg free() call to Tcl_Free(). + +Tue Aug 19 17:09:19 1997 Ian Lance Taylor + + * Makefile.in (TCL_DEPS, TK_DEPS): New variables. + (ITCL_DEPS, TIX_DEPS): New variables. + (IDE_DEPS): New variable. + (CDEPS): Include @CONFIG_DEPS@. + * configure.in: Set and substitute CONFIG_DEPS and TIX_DEPS. + * configure: Rebuild. + +end-sanitize-gdbtk + Tue Aug 19 08:41:36 1997 Fred Fish * objfiles.c (objfile_relocate): Add call to breakpoint_re_set @@ -645,6 +892,11 @@ Sun Aug 17 00:42:11 1997 Martin M. Hunt a list of all the functions in a source file. end-sanitize-gdbtk + +Fri Aug 15 20:53:13 1997 Ian Lance Taylor + + * Makefile.in (init.c): Don't use xargs. + Fri Aug 15 13:59:37 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) * infrun.c (wait_for_inferior): Add the symbols for any diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 18f6ee5f09c..dfabb72fcc4 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -41,7 +41,7 @@ man9dir = $(mandir)/man9 infodir = @infodir@ includedir = @includedir@ -SHELL = @SHELL@ +SHELL = /bin/sh EXEEXT = # @EXEEXT@ # This isn't getting substituted in correctly :-( INSTALL = @INSTALL@ @@ -136,18 +136,22 @@ LIB_INSTALL_DIR = $(libdir) LIB_RUNTIME_DIR = $(libdir) TCL = @TCL_LD_SEARCH_FLAGS@ @TCL_BUILD_LIB_SPEC@ TCL_CFLAGS = @TCLHDIR@ +TCL_DEPS = # Where is the TK library? Typically in ../tk. TK = @TK_BUILD_LIB_SPEC@ TK_CFLAGS = @TKHDIR@ @TK_BUILD_INCLUDES@ +TK_DEPS = # Where is Itcl? Typically in ../itcl. ITCL_CFLAGS = @ITCLHDIR@ ITCL = @ITCLLIB@ +ITCL_DEPS = $(ITCL) # Where is Tix? Typically in ../tix. TIX_CFLAGS = @TIXHDIR@ TIX = @TIXLIB@ +TIX_DEPS = @TIX_DEPS@ X11_CFLAGS = @TK_XINCLUDES@ X11_LDFLAGS = @@ -159,16 +163,21 @@ WIN32LIBS = @WIN32LIBS@ ENABLE_GDBTK= @ENABLE_GDBTK@ ENABLE_IDE= @ENABLE_IDE@ -IDE_CFLAGS_X = ` \ - if [ x"$(ENABLE_IDE)" != x ] ; then \ - echo -DIDE -I$(srcdir)/../libide/src -I$(srcdir)/../ilu/runtime/mainloop;\ +IDE_CFLAGS_X = -I$(srcdir)/../libide/src \ + `if [ x"$(ENABLE_IDE)" != x ] ; then \ + echo -DIDE -I$(srcdir)/../ilu/runtime/mainloop;\ fi` +LIBIDE = ../libide/src/libide.a + IDE_X = ` \ if [ x"$(ENABLE_IDE)" != x ] ; then \ - echo -L../libide/src -lide -L../ilu/runtime/mainloop -lilu-Tk -L../ilu/runtime/c -lilu-c -L../ilu/runtime/kernel -lilu;\ + echo -L../ilu/runtime/mainloop -lilu-Tk -L../ilu/runtime/c -lilu-c -L../ilu/runtime/kernel -lilu;\ fi` +IDE_DEPS = ../ilu/runtime/mainloop/libilu-Tk.a \ + ../ilu/runtime/c/libilu-c.a ../ilu/runtime/kernel/libilu.a + IDE=$(IDE_X) IDE_CFLAGS=$(IDE_CFLAGS_X) #end-sanitize-gdbtk @@ -235,12 +244,12 @@ CLIBS = $(SIM) $(BFD) $(READLINE) $(OPCODES) $(LIBIBERTY) \ $(TERMCAP) $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) @LIBS@ \ $(MMALLOC) $(LIBIBERTY) $(WIN32LIBS) CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \ - $(OPCODES) $(MMALLOC) $(LIBIBERTY) + $(OPCODES) $(MMALLOC) $(LIBIBERTY) @CONFIG_DEPS@ ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) ADD_DEPS = $(REGEX1) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) -VERSION = 4.16.1 +VERSION=4.16-foundry-971110 DIST=gdb LINT=/usr/5bin/lint @@ -574,25 +583,17 @@ install-only: fi ; \ $(INSTALL_PROGRAM) gdb$(EXEEXT) $(bindir)/$$transformed_name$(EXEEXT) ; \ $(INSTALL_DATA) $(srcdir)/gdb.1 $(man1dir)/$$transformed_name.1 - # start-sanitize-gdbtk - if [ x"$(ENABLE_GDBTK)" != x ] ; then \ + # start-sanitize-gdbtk + if [ x"$(ENABLE_GDBTK)" != x ] ; then \ $(SHELL) $(srcdir)/../mkinstalldirs $(datadir)/gdbtcl ; \ - if [ x"$(ENABLE_IDE)" = x ]; then \ - cd $(srcdir)/gdbtcl ; \ - for i in asm.tcl break.xbm breakpoint.tcl command.tcl copyright.tcl expr.tcl file.tcl main.tcl register.tcl source.tcl stop2.gif tclIndex ; \ - do \ - $(INSTALL_DATA) $$i $(datadir)/gdbtcl/$$i ; \ - done ; \ - else \ - $(SHELL) $(srcdir)/../mkinstalldirs \ - $(datadir)/gdbtcl/images \ - $(datadir)/gdbtcl/images2 ; \ - cd $(srcdir)/gdbtcl2 ; \ - for i in *.tcl images/*.gif images2/*.gif tclIndex; \ - do \ + $(SHELL) $(srcdir)/../mkinstalldirs \ + $(datadir)/gdbtcl/images \ + $(datadir)/gdbtcl/images2 ; \ + cd $(srcdir)/gdbtcl2 ; \ + for i in *.tcl images/*.gif images2/*.gif tclIndex; \ + do \ $(INSTALL_DATA) $$i $(datadir)/gdbtcl/$$i ; \ - done ; \ - fi ; \ + done ; \ else \ true ; \ fi @@ -645,7 +646,7 @@ init.c: $(OBS) $(TSOBS) -e '/[a-z0-9A-Z_]*-exp.tab.o/d' \ -e 's/\.o/.c/' \ -e 's|\([^ ][^ ]*\)|$(srcdir)/\1|g' | \ - xargs grep '^_initialize_[a-z_0-9A-Z]* *(' | \ + while read f; do grep '^_initialize_[a-z_0-9A-Z]* *(' $$f 2>/dev/null; done | \ sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/ {extern void \1 PARAMS ((void)); \1 ();}/' >>init.c-tmp @echo '}' >>init.c-tmp @mv init.c-tmp init.c diff --git a/gdb/configure b/gdb/configure index 9ca121c025f..68266f02d31 100755 --- a/gdb/configure +++ b/gdb/configure @@ -976,6 +976,7 @@ test "$host_alias" != "$target_alias" && CONFIG_OBS= +CONFIG_DEPS= configdirs="doc testsuite" @@ -996,7 +997,7 @@ configdirs="doc testsuite" # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1000: checking for a BSD compatible install" >&5 +echo "configure:1001: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1054,7 +1055,7 @@ fi # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1058: checking for $ac_word" >&5 +echo "configure:1059: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1085,7 +1086,7 @@ fi # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1089: checking for $ac_word" >&5 +echo "configure:1090: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1116,7 +1117,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1120: checking for $ac_word" >&5 +echo "configure:1121: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1152,7 +1153,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1156: checking for $ac_word" >&5 +echo "configure:1157: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1186,7 +1187,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1190: checking for $ac_word" >&5 +echo "configure:1191: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1236,12 +1237,12 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:1240: checking return type of signal handlers" >&5 +echo "configure:1241: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1258,7 +1259,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:1262: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1263: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -1278,12 +1279,12 @@ EOF echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1282: checking for ANSI C header files" >&5 +echo "configure:1283: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1291,7 +1292,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1295: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1308,7 +1309,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1326,7 +1327,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1347,7 +1348,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1358,7 +1359,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else @@ -1385,17 +1386,17 @@ for ac_hdr in limits.h memory.h string.h strings.h unistd.h termios.h termio.h s do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1389: checking for $ac_hdr" >&5 +echo "configure:1390: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1399: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1400: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1422,12 +1423,12 @@ fi done echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:1426: checking whether stat file-mode macros are broken" >&5 +echo "configure:1427: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1479,12 +1480,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1483: checking for working const" >&5 +echo "configure:1484: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1538: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1557,12 +1558,12 @@ fi for ac_func in setpgid sbrk select poll do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1561: checking for $ac_func" >&5 +echo "configure:1562: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1627,19 +1628,19 @@ EOF fi echo $ac_n "checking for gregset_t type""... $ac_c" 1>&6 -echo "configure:1631: checking for gregset_t type" >&5 +echo "configure:1632: checking for gregset_t type" >&5 if eval "test \"`echo '$''{'gdb_cv_have_gregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { gregset_t *gregsetp = 0 ; return 0; } EOF -if { (eval echo configure:1643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* gdb_cv_have_gregset_t=yes else @@ -1660,19 +1661,19 @@ EOF fi echo $ac_n "checking for fpregset_t type""... $ac_c" 1>&6 -echo "configure:1664: checking for fpregset_t type" >&5 +echo "configure:1665: checking for fpregset_t type" >&5 if eval "test \"`echo '$''{'gdb_cv_have_fpregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { fpregset_t *fpregsetp = 0 ; return 0; } EOF -if { (eval echo configure:1676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* gdb_cv_have_fpregset_t=yes else @@ -1693,7 +1694,7 @@ EOF fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:1697: checking for main in -lm" >&5 +echo "configure:1698: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1701,14 +1702,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1738,12 +1739,12 @@ fi echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6 -echo "configure:1742: checking for long long support in compiler" >&5 +echo "configure:1743: checking for long long support in compiler" >&5 if eval "test \"`echo '$''{'gdb_cv_c_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1758: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_c_long_long=yes else @@ -1775,7 +1776,7 @@ fi echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6 -echo "configure:1779: checking for long long support in printf" >&5 +echo "configure:1780: checking for long long support in printf" >&5 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1783,7 +1784,7 @@ else gdb_cv_printf_has_long_long=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_long=yes else @@ -1821,19 +1822,19 @@ echo "$ac_t""$gdb_cv_printf_has_long_long" 1>&6 echo $ac_n "checking for long double support in compiler""... $ac_c" 1>&6 -echo "configure:1825: checking for long double support in compiler" >&5 +echo "configure:1826: checking for long double support in compiler" >&5 if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1838: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_long_double=yes else @@ -1855,7 +1856,7 @@ fi echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6 -echo "configure:1859: checking for long double support in printf" >&5 +echo "configure:1860: checking for long double support in printf" >&5 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1863,7 +1864,7 @@ else gdb_cv_printf_has_long_double=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_double=yes else @@ -1897,7 +1898,7 @@ echo "$ac_t""$gdb_cv_printf_has_long_double" 1>&6 echo $ac_n "checking for long double support in scanf""... $ac_c" 1>&6 -echo "configure:1901: checking for long double support in scanf" >&5 +echo "configure:1902: checking for long double support in scanf" >&5 if eval "test \"`echo '$''{'gdb_cv_scanf_has_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1905,7 +1906,7 @@ else gdb_cv_scanf_has_long_double=no else cat > conftest.$ac_ext < 3.14159 && f < 3.14160); } EOF -if { (eval echo configure:1919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then gdb_cv_scanf_has_long_double=yes else @@ -1941,17 +1942,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1945: checking for $ac_hdr" >&5 +echo "configure:1946: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1955: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1980,12 +1981,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1984: checking for $ac_func" >&5 +echo "configure:1985: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2033,7 +2034,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:2037: checking for working mmap" >&5 +echo "configure:2038: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2041,7 +2042,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -2205,12 +2206,12 @@ fi echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6 -echo "configure:2209: checking whether malloc must be declared" >&5 +echo "configure:2210: checking whether malloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2231,7 +2232,7 @@ int main() { char *(*pfn) = (char *(*)) malloc ; return 0; } EOF -if { (eval echo configure:2235: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_malloc=no else @@ -2253,12 +2254,12 @@ EOF fi echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6 -echo "configure:2257: checking whether realloc must be declared" >&5 +echo "configure:2258: checking whether realloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2279,7 +2280,7 @@ int main() { char *(*pfn) = (char *(*)) realloc ; return 0; } EOF -if { (eval echo configure:2283: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2284: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_realloc=no else @@ -2301,12 +2302,12 @@ EOF fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:2305: checking whether free must be declared" >&5 +echo "configure:2306: checking whether free must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2327,7 +2328,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:2331: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -2355,7 +2356,7 @@ if test ${build} = ${host} -a ${host} = ${target} ; then case ${host_os} in hpux*) echo $ac_n "checking for HPUX/OSF thread support""... $ac_c" 1>&6 -echo "configure:2359: checking for HPUX/OSF thread support" >&5 +echo "configure:2360: checking for HPUX/OSF thread support" >&5 if test -f /usr/include/dce/cma_config.h ; then if test "$GCC" = "yes" ; then echo "$ac_t""yes" 1>&6 @@ -2373,7 +2374,7 @@ EOF ;; solaris*) echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6 -echo "configure:2377: checking for Solaris thread debugging library" >&5 +echo "configure:2378: checking for Solaris thread debugging library" >&5 if test -f /usr/lib/libthread_db.so.1 ; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -2382,7 +2383,7 @@ EOF CONFIG_OBS="${CONFIG_OBS} sol-thread.o" echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:2386: checking for dlopen in -ldl" >&5 +echo "configure:2387: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2390,7 +2391,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2509,12 +2510,12 @@ fi # In the cygwin32 environment, we need some additional flags. echo $ac_n "checking for cygwin32""... $ac_c" 1>&6 -echo "configure:2513: checking for cygwin32" >&5 +echo "configure:2514: checking for cygwin32" >&5 if eval "test \"`echo '$''{'gdb_cv_os_cygwin32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:2571: checking for Tcl configuration" >&5 +echo "configure:2572: checking for Tcl configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2675,7 +2676,7 @@ if test "${with_tkconfig+set}" = set; then fi echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6 -echo "configure:2679: checking for Tk configuration" >&5 +echo "configure:2680: checking for Tk configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tkconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2771,7 +2772,7 @@ fi no_tcl=true echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6 -echo "configure:2775: checking for Tcl private headers. dir=${configdir}" >&5 +echo "configure:2776: checking for Tcl private headers. dir=${configdir}" >&5 # Check whether --with-tclinclude or --without-tclinclude was given. if test "${with_tclinclude+set}" = set; then withval="$with_tclinclude" @@ -2837,17 +2838,17 @@ fi if test x"${ac_cv_c_tclh}" = x ; then ac_safe=`echo "tclInt.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tclInt.h""... $ac_c" 1>&6 -echo "configure:2841: checking for tclInt.h" >&5 +echo "configure:2842: checking for tclInt.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2851: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2852: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2907,7 +2908,7 @@ fi # no_tk=true echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6 -echo "configure:2911: checking for Tk private headers" >&5 +echo "configure:2912: checking for Tk private headers" >&5 # Check whether --with-tkinclude or --without-tkinclude was given. if test "${with_tkinclude+set}" = set; then withval="$with_tkinclude" @@ -2973,17 +2974,17 @@ fi if test x"${ac_cv_c_tkh}" = x ; then ac_safe=`echo "tk.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tk.h""... $ac_c" 1>&6 -echo "configure:2977: checking for tk.h" >&5 +echo "configure:2978: checking for tk.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2987: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2988: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3029,7 +3030,7 @@ fi echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:3033: checking for Itcl private headers. srcdir=${srcdir}" >&5 +echo "configure:3034: checking for Itcl private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_itclh}" = x ; then for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ; do if test -f $i/src/itcl.h ; then @@ -3052,7 +3053,7 @@ fi echo $ac_n "checking for Tix private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:3056: checking for Tix private headers. srcdir=${srcdir}" >&5 +echo "configure:3057: checking for Tix private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_tixh}" = x ; then for i in ${srcdir}/../tix ${srcdir}/../../tix ${srcdir}/../../../tix ; do if test -f $i/generic/tix.h ; then @@ -3084,17 +3085,21 @@ fi esac if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then TIXLIB="-L${tixdir} -ltix${TIXVERSION}" + TIX_DEPS="${tixdir}/libtix${TIXVERSION}.a" else TIXLIB="-L${tixdir} -ltix`echo ${TIXVERSION} | tr -d .`" + TIX_DEPS="${tixdir}/libtix`echo ${TIXVERSION} | tr -d .`.a" fi ENABLE_GDBTK=1 # Include some libraries that Tcl and Tk want. if test "${enable_ide}" = "yes"; then - TCL_LIBS='$(IDE) $(ITCL) $(TIX) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)' + TCL_LIBS='$(LIBIDE) $(IDE) $(ITCL) $(TIX) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)' + CONFIG_DEPS='$(LIBIDE) $(IDE_DEPS) $(ITCL_DEPS) $(TIX_DEPS) $(TK_DEPS) $(TCL_DEPS)' else - TCL_LIBS='$(ITCL) $(TIX) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)' + TCL_LIBS='$(LIBIDE) $(ITCL) $(TIX) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)' + CONFIG_DEPS='$(LIBIDE) $(ITCL_DEPS) $(TIX_DEPS) $(TK_DEPS) $(TCL_DEPS)' fi # Yes, the ordering seems wrong here. But it isn't. # TK_LIBS is the list of libraries that need to be linked @@ -3103,7 +3108,7 @@ fi CONFIG_OBS="${CONFIG_OBS} gdbtk.o" if test x$gdb_cv_os_cygwin32 = xyes; then - WIN32LIBS="${WIN32LIBS} -luser32" + WIN32LIBS="${WIN32LIBS} -lshell32 -lgdi32 -lcomdlg32 -ladvapi32 -luser32" WIN32LDAPP="-Wl,--subsystem,windows" fi fi @@ -3115,12 +3120,14 @@ fi + # end-sanitize-gdbtk + # Begin stuff to support --enable-shared # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then @@ -3258,7 +3265,7 @@ links="${links} nm.h" fi # start-sanitize-gdbtk echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:3262: checking whether ln -s works" >&5 +echo "configure:3269: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3293,19 +3300,19 @@ fi echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6 -echo "configure:3297: checking for Cygwin32 environment" >&5 +echo "configure:3304: checking for Cygwin32 environment" >&5 if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_cygwin32=yes else @@ -3323,7 +3330,7 @@ CYGWIN32= test "$am_cv_cygwin32" = yes && CYGWIN32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:3327: checking for executable suffix" >&5 +echo "configure:3334: checking for executable suffix" >&5 if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3542,8 +3549,10 @@ s%@X_CFLAGS@%$X_CFLAGS%g s%@X_LDFLAGS@%$X_LDFLAGS%g s%@X_LIBS@%$X_LIBS%g s%@TIXLIB@%$TIXLIB%g +s%@TIX_DEPS@%$TIX_DEPS%g s%@ENABLE_CFLAGS@%$ENABLE_CFLAGS%g s%@CONFIG_OBS@%$CONFIG_OBS%g +s%@CONFIG_DEPS@%$CONFIG_DEPS%g s%@HLDFLAGS@%$HLDFLAGS%g s%@HLDENV@%$HLDENV%g s%@target_subdir@%$target_subdir%g diff --git a/gdb/configure.in b/gdb/configure.in index 429a5dc91fc..8512fc93263 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -37,6 +37,7 @@ AC_CANONICAL_SYSTEM dnl List of object files added by configure. CONFIG_OBS= +CONFIG_DEPS= configdirs="doc testsuite" @@ -340,17 +341,21 @@ if test "${enable_gdbtk}" = "yes"; then esac if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then TIXLIB="-L${tixdir} -ltix${TIXVERSION}" + TIX_DEPS="${tixdir}/libtix${TIXVERSION}.a" else TIXLIB="-L${tixdir} -ltix`echo ${TIXVERSION} | tr -d .`" + TIX_DEPS="${tixdir}/libtix`echo ${TIXVERSION} | tr -d .`.a" fi ENABLE_GDBTK=1 # Include some libraries that Tcl and Tk want. if test "${enable_ide}" = "yes"; then - TCL_LIBS='$(IDE) $(ITCL) $(TIX) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)' + TCL_LIBS='$(LIBIDE) $(IDE) $(ITCL) $(TIX) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)' + CONFIG_DEPS='$(LIBIDE) $(IDE_DEPS) $(ITCL_DEPS) $(TIX_DEPS) $(TK_DEPS) $(TCL_DEPS)' else - TCL_LIBS='$(ITCL) $(TIX) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)' + TCL_LIBS='$(LIBIDE) $(ITCL) $(TIX) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)' + CONFIG_DEPS='$(LIBIDE) $(ITCL_DEPS) $(TIX_DEPS) $(TK_DEPS) $(TCL_DEPS)' fi # Yes, the ordering seems wrong here. But it isn't. # TK_LIBS is the list of libraries that need to be linked @@ -359,7 +364,7 @@ if test "${enable_gdbtk}" = "yes"; then CONFIG_OBS="${CONFIG_OBS} gdbtk.o" if test x$gdb_cv_os_cygwin32 = xyes; then - WIN32LIBS="${WIN32LIBS} -luser32" + WIN32LIBS="${WIN32LIBS} -lshell32 -lgdi32 -lcomdlg32 -ladvapi32 -luser32" WIN32LDAPP="-Wl,--subsystem,windows" fi fi @@ -371,11 +376,13 @@ AC_SUBST(X_CFLAGS) AC_SUBST(X_LDFLAGS) AC_SUBST(X_LIBS) AC_SUBST(TIXLIB) +AC_SUBST(TIX_DEPS) # end-sanitize-gdbtk AC_SUBST(ENABLE_CFLAGS) AC_SUBST(CONFIG_OBS) +AC_SUBST(CONFIG_DEPS) # Begin stuff to support --enable-shared AC_ARG_ENABLE(shared, diff --git a/gdb/copying.c b/gdb/copying.c index c31c280c79e..19b19187a31 100644 --- a/gdb/copying.c +++ b/gdb/copying.c @@ -1,48 +1,60 @@ -/* Do not modify this file; it is created automatically - by copying.awk. */ +/* ==> Do not modify this file!! It is created automatically + by copying.awk. Modify copying.awk instead. <== */ + #include "defs.h" #include "command.h" #include "gdbcmd.h" + +static void +show_copying_command PARAMS ((char *, int)); + +static void +show_warranty_command PARAMS ((char *, int)); + extern int immediate_quit; static void -show_copying () +show_copying_command (ignore, from_tty) + char *ignore; + int from_tty; { immediate_quit++; - printf_filtered ("\n"); printf_filtered (" GNU GENERAL PUBLIC LICENSE\n"); - printf_filtered (" Version 1, February 1989\n"); + printf_filtered (" Version 2, June 1991\n"); printf_filtered ("\n"); - printf_filtered (" Copyright (C) 1989 Free Software Foundation, Inc.\n"); - printf_filtered (" 675 Mass Ave, Cambridge, MA 02139, USA\n"); + printf_filtered (" Copyright (C) 1989, 1991 Free Software Foundation, Inc.\n"); + printf_filtered (" 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n"); printf_filtered (" Everyone is permitted to copy and distribute verbatim copies\n"); printf_filtered (" of this license document, but changing it is not allowed.\n"); printf_filtered ("\n"); printf_filtered (" Preamble\n"); printf_filtered ("\n"); - printf_filtered (" The license agreements of most software companies try to keep users\n"); - printf_filtered ("at the mercy of those companies. By contrast, our General Public\n"); + printf_filtered (" The licenses for most software are designed to take away your\n"); + printf_filtered ("freedom to share and change it. By contrast, the GNU General Public\n"); printf_filtered ("License is intended to guarantee your freedom to share and change free\n"); - printf_filtered ("software--to make sure the software is free for all its users. The\n"); - printf_filtered ("General Public License applies to the Free Software Foundation's\n"); - printf_filtered ("software and to any other program whose authors commit to using it.\n"); - printf_filtered ("You can use it for your programs, too.\n"); + printf_filtered ("software--to make sure the software is free for all its users. This\n"); + printf_filtered ("General Public License applies to most of the Free Software\n"); + printf_filtered ("Foundation's software and to any other program whose authors commit to\n"); + printf_filtered ("using it. (Some other Free Software Foundation software is covered by\n"); + printf_filtered ("the GNU Library General Public License instead.) You can apply it to\n"); + printf_filtered ("your programs, too.\n"); printf_filtered ("\n"); printf_filtered (" When we speak of free software, we are referring to freedom, not\n"); - printf_filtered ("price. Specifically, the General Public License is designed to make\n"); - printf_filtered ("sure that you have the freedom to give away or sell copies of free\n"); - printf_filtered ("software, that you receive source code or can get it if you want it,\n"); - printf_filtered ("that you can change the software or use pieces of it in new free\n"); - printf_filtered ("programs; and that you know you can do these things.\n"); + printf_filtered ("price. Our General Public Licenses are designed to make sure that you\n"); + printf_filtered ("have the freedom to distribute copies of free software (and charge for\n"); + printf_filtered ("this service if you wish), that you receive source code or can get it\n"); + printf_filtered ("if you want it, that you can change the software or use pieces of it\n"); + printf_filtered ("in new free programs; and that you know you can do these things.\n"); printf_filtered ("\n"); printf_filtered (" To protect your rights, we need to make restrictions that forbid\n"); printf_filtered ("anyone to deny you these rights or to ask you to surrender the rights.\n"); printf_filtered ("These restrictions translate to certain responsibilities for you if you\n"); printf_filtered ("distribute copies of the software, or if you modify it.\n"); printf_filtered ("\n"); - printf_filtered (" For example, if you distribute copies of a such a program, whether\n"); + printf_filtered (" For example, if you distribute copies of such a program, whether\n"); printf_filtered ("gratis or for a fee, you must give the recipients all the rights that\n"); printf_filtered ("you have. You must make sure that they, too, receive or can get the\n"); - printf_filtered ("source code. And you must tell them their rights.\n"); + printf_filtered ("source code. And you must show them these terms so they know their\n"); + printf_filtered ("rights.\n"); printf_filtered ("\n"); printf_filtered (" We protect your rights with two steps: (1) copyright the software, and\n"); printf_filtered ("(2) offer you this license which gives you legal permission to copy,\n"); @@ -55,120 +67,207 @@ show_copying () printf_filtered ("that any problems introduced by others will not reflect on the original\n"); printf_filtered ("authors' reputations.\n"); printf_filtered ("\n"); + printf_filtered (" Finally, any free program is threatened constantly by software\n"); + printf_filtered ("patents. We wish to avoid the danger that redistributors of a free\n"); + printf_filtered ("program will individually obtain patent licenses, in effect making the\n"); + printf_filtered ("program proprietary. To prevent this, we have made it clear that any\n"); + printf_filtered ("patent must be licensed for everyone's free use or not licensed at all.\n"); + printf_filtered ("\n"); printf_filtered (" The precise terms and conditions for copying, distribution and\n"); printf_filtered ("modification follow.\n"); - printf_filtered (" \n"); + printf_filtered ("\n"); printf_filtered (" GNU GENERAL PUBLIC LICENSE\n"); printf_filtered (" TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n"); printf_filtered ("\n"); - printf_filtered (" 0. This License Agreement applies to any program or other work which\n"); - printf_filtered ("contains a notice placed by the copyright holder saying it may be\n"); - printf_filtered ("distributed under the terms of this General Public License. The\n"); - printf_filtered ("\"Program\", below, refers to any such program or work, and a \"work based\n"); - printf_filtered ("on the Program\" means either the Program or any work containing the\n"); - printf_filtered ("Program or a portion of it, either verbatim or with modifications. Each\n"); - printf_filtered ("licensee is addressed as \"you\".\n"); - printf_filtered ("\n"); - printf_filtered (" 1. You may copy and distribute verbatim copies of the Program's source\n"); - printf_filtered ("code as you receive it, in any medium, provided that you conspicuously and\n"); - printf_filtered ("appropriately publish on each copy an appropriate copyright notice and\n"); - printf_filtered ("disclaimer of warranty; keep intact all the notices that refer to this\n"); - printf_filtered ("General Public License and to the absence of any warranty; and give any\n"); - printf_filtered ("other recipients of the Program a copy of this General Public License\n"); - printf_filtered ("along with the Program. You may charge a fee for the physical act of\n"); - printf_filtered ("transferring a copy.\n"); - printf_filtered ("\n"); - printf_filtered (" 2. You may modify your copy or copies of the Program or any portion of\n"); - printf_filtered ("it, and copy and distribute such modifications under the terms of Paragraph\n"); - printf_filtered ("1 above, provided that you also do the following:\n"); - printf_filtered ("\n"); - printf_filtered (" a) cause the modified files to carry prominent notices stating that\n"); - printf_filtered (" you changed the files and the date of any change; and\n"); - printf_filtered ("\n"); - printf_filtered (" b) cause the whole of any work that you distribute or publish, that\n"); - printf_filtered (" in whole or in part contains the Program or any part thereof, either\n"); - printf_filtered (" with or without modifications, to be licensed at no charge to all\n"); - printf_filtered (" third parties under the terms of this General Public License (except\n"); - printf_filtered (" that you may choose to grant warranty protection to some or all\n"); - printf_filtered (" third parties, at your option).\n"); - printf_filtered ("\n"); - printf_filtered (" c) If the modified program normally reads commands interactively when\n"); - printf_filtered (" run, you must cause it, when started running for such interactive use\n"); - printf_filtered (" in the simplest and most usual way, to print or display an\n"); - printf_filtered (" announcement including an appropriate copyright notice and a notice\n"); - printf_filtered (" that there is no warranty (or else, saying that you provide a\n"); - printf_filtered (" warranty) and that users may redistribute the program under these\n"); - printf_filtered (" conditions, and telling the user how to view a copy of this General\n"); - printf_filtered (" Public License.\n"); - printf_filtered ("\n"); - printf_filtered (" d) You may charge a fee for the physical act of transferring a\n"); - printf_filtered (" copy, and you may at your option offer warranty protection in\n"); - printf_filtered (" exchange for a fee.\n"); - printf_filtered ("\n"); - printf_filtered ("Mere aggregation of another independent work with the Program (or its\n"); - printf_filtered ("derivative) on a volume of a storage or distribution medium does not bring\n"); - printf_filtered ("the other work under the scope of these terms.\n"); - printf_filtered (" \n"); - printf_filtered (" 3. You may copy and distribute the Program (or a portion or derivative of\n"); - printf_filtered ("it, under Paragraph 2) in object code or executable form under the terms of\n"); - printf_filtered ("Paragraphs 1 and 2 above provided that you also do one of the following:\n"); - printf_filtered ("\n"); - printf_filtered (" a) accompany it with the complete corresponding machine-readable\n"); - printf_filtered (" source code, which must be distributed under the terms of\n"); - printf_filtered (" Paragraphs 1 and 2 above; or,\n"); - printf_filtered ("\n"); - printf_filtered (" b) accompany it with a written offer, valid for at least three\n"); - printf_filtered (" years, to give any third party free (except for a nominal charge\n"); - printf_filtered (" for the cost of distribution) a complete machine-readable copy of the\n"); - printf_filtered (" corresponding source code, to be distributed under the terms of\n"); - printf_filtered (" Paragraphs 1 and 2 above; or,\n"); - printf_filtered ("\n"); - printf_filtered (" c) accompany it with the information you received as to where the\n"); - printf_filtered (" corresponding source code may be obtained. (This alternative is\n"); + printf_filtered (" 0. This License applies to any program or other work which contains\n"); + printf_filtered ("a notice placed by the copyright holder saying it may be distributed\n"); + printf_filtered ("under the terms of this General Public License. The \"Program\", below,\n"); + printf_filtered ("refers to any such program or work, and a \"work based on the Program\"\n"); + printf_filtered ("means either the Program or any derivative work under copyright law:\n"); + printf_filtered ("that is to say, a work containing the Program or a portion of it,\n"); + printf_filtered ("either verbatim or with modifications and/or translated into another\n"); + printf_filtered ("language. (Hereinafter, translation is included without limitation in\n"); + printf_filtered ("the term \"modification\".) Each licensee is addressed as \"you\".\n"); + printf_filtered ("\n"); + printf_filtered ("Activities other than copying, distribution and modification are not\n"); + printf_filtered ("covered by this License; they are outside its scope. The act of\n"); + printf_filtered ("running the Program is not restricted, and the output from the Program\n"); + printf_filtered ("is covered only if its contents constitute a work based on the\n"); + printf_filtered ("Program (independent of having been made by running the Program).\n"); + printf_filtered ("Whether that is true depends on what the Program does.\n"); + printf_filtered ("\n"); + printf_filtered (" 1. You may copy and distribute verbatim copies of the Program's\n"); + printf_filtered ("source code as you receive it, in any medium, provided that you\n"); + printf_filtered ("conspicuously and appropriately publish on each copy an appropriate\n"); + printf_filtered ("copyright notice and disclaimer of warranty; keep intact all the\n"); + printf_filtered ("notices that refer to this License and to the absence of any warranty;\n"); + printf_filtered ("and give any other recipients of the Program a copy of this License\n"); + printf_filtered ("along with the Program.\n"); + printf_filtered ("\n"); + printf_filtered ("You may charge a fee for the physical act of transferring a copy, and\n"); + printf_filtered ("you may at your option offer warranty protection in exchange for a fee.\n"); + printf_filtered ("\n"); + printf_filtered (" 2. You may modify your copy or copies of the Program or any portion\n"); + printf_filtered ("of it, thus forming a work based on the Program, and copy and\n"); + printf_filtered ("distribute such modifications or work under the terms of Section 1\n"); + printf_filtered ("above, provided that you also meet all of these conditions:\n"); + printf_filtered ("\n"); + printf_filtered (" a) You must cause the modified files to carry prominent notices\n"); + printf_filtered (" stating that you changed the files and the date of any change.\n"); + printf_filtered ("\n"); + printf_filtered (" b) You must cause any work that you distribute or publish, that in\n"); + printf_filtered (" whole or in part contains or is derived from the Program or any\n"); + printf_filtered (" part thereof, to be licensed as a whole at no charge to all third\n"); + printf_filtered (" parties under the terms of this License.\n"); + printf_filtered ("\n"); + printf_filtered (" c) If the modified program normally reads commands interactively\n"); + printf_filtered (" when run, you must cause it, when started running for such\n"); + printf_filtered (" interactive use in the most ordinary way, to print or display an\n"); + printf_filtered (" announcement including an appropriate copyright notice and a\n"); + printf_filtered (" notice that there is no warranty (or else, saying that you provide\n"); + printf_filtered (" a warranty) and that users may redistribute the program under\n"); + printf_filtered (" these conditions, and telling the user how to view a copy of this\n"); + printf_filtered (" License. (Exception: if the Program itself is interactive but\n"); + printf_filtered (" does not normally print such an announcement, your work based on\n"); + printf_filtered (" the Program is not required to print an announcement.)\n"); + printf_filtered ("\n"); + printf_filtered ("These requirements apply to the modified work as a whole. If\n"); + printf_filtered ("identifiable sections of that work are not derived from the Program,\n"); + printf_filtered ("and can be reasonably considered independent and separate works in\n"); + printf_filtered ("themselves, then this License, and its terms, do not apply to those\n"); + printf_filtered ("sections when you distribute them as separate works. But when you\n"); + printf_filtered ("distribute the same sections as part of a whole which is a work based\n"); + printf_filtered ("on the Program, the distribution of the whole must be on the terms of\n"); + printf_filtered ("this License, whose permissions for other licensees extend to the\n"); + printf_filtered ("entire whole, and thus to each and every part regardless of who wrote it.\n"); + printf_filtered ("\n"); + printf_filtered ("Thus, it is not the intent of this section to claim rights or contest\n"); + printf_filtered ("your rights to work written entirely by you; rather, the intent is to\n"); + printf_filtered ("exercise the right to control the distribution of derivative or\n"); + printf_filtered ("collective works based on the Program.\n"); + printf_filtered ("\n"); + printf_filtered ("In addition, mere aggregation of another work not based on the Program\n"); + printf_filtered ("with the Program (or with a work based on the Program) on a volume of\n"); + printf_filtered ("a storage or distribution medium does not bring the other work under\n"); + printf_filtered ("the scope of this License.\n"); + printf_filtered ("\n"); + printf_filtered (" 3. You may copy and distribute the Program (or a work based on it,\n"); + printf_filtered ("under Section 2) in object code or executable form under the terms of\n"); + printf_filtered ("Sections 1 and 2 above provided that you also do one of the following:\n"); + printf_filtered ("\n"); + printf_filtered (" a) Accompany it with the complete corresponding machine-readable\n"); + printf_filtered (" source code, which must be distributed under the terms of Sections\n"); + printf_filtered (" 1 and 2 above on a medium customarily used for software interchange; or,\n"); + printf_filtered ("\n"); + printf_filtered (" b) Accompany it with a written offer, valid for at least three\n"); + printf_filtered (" years, to give any third party, for a charge no more than your\n"); + printf_filtered (" cost of physically performing source distribution, a complete\n"); + printf_filtered (" machine-readable copy of the corresponding source code, to be\n"); + printf_filtered (" distributed under the terms of Sections 1 and 2 above on a medium\n"); + printf_filtered (" customarily used for software interchange; or,\n"); + printf_filtered ("\n"); + printf_filtered (" c) Accompany it with the information you received as to the offer\n"); + printf_filtered (" to distribute corresponding source code. (This alternative is\n"); printf_filtered (" allowed only for noncommercial distribution and only if you\n"); - printf_filtered (" received the program in object code or executable form alone.)\n"); - printf_filtered ("\n"); - printf_filtered ("Source code for a work means the preferred form of the work for making\n"); - printf_filtered ("modifications to it. For an executable file, complete source code means\n"); - printf_filtered ("all the source code for all modules it contains; but, as a special\n"); - printf_filtered ("exception, it need not include source code for modules which are standard\n"); - printf_filtered ("libraries that accompany the operating system on which the executable\n"); - printf_filtered ("file runs, or for standard header files or definitions files that\n"); - printf_filtered ("accompany that operating system.\n"); - printf_filtered ("\n"); - printf_filtered (" 4. You may not copy, modify, sublicense, distribute or transfer the\n"); - printf_filtered ("Program except as expressly provided under this General Public License.\n"); - printf_filtered ("Any attempt otherwise to copy, modify, sublicense, distribute or transfer\n"); - printf_filtered ("the Program is void, and will automatically terminate your rights to use\n"); - printf_filtered ("the Program under this License. However, parties who have received\n"); - printf_filtered ("copies, or rights to use copies, from you under this General Public\n"); - printf_filtered ("License will not have their licenses terminated so long as such parties\n"); - printf_filtered ("remain in full compliance.\n"); - printf_filtered ("\n"); - printf_filtered (" 5. By copying, distributing or modifying the Program (or any work based\n"); - printf_filtered ("on the Program) you indicate your acceptance of this license to do so,\n"); - printf_filtered ("and all its terms and conditions.\n"); + printf_filtered (" received the program in object code or executable form with such\n"); + printf_filtered (" an offer, in accord with Subsection b above.)\n"); + printf_filtered ("\n"); + printf_filtered ("The source code for a work means the preferred form of the work for\n"); + printf_filtered ("making modifications to it. For an executable work, complete source\n"); + printf_filtered ("code means all the source code for all modules it contains, plus any\n"); + printf_filtered ("associated interface definition files, plus the scripts used to\n"); + printf_filtered ("control compilation and installation of the executable. However, as a\n"); + printf_filtered ("special exception, the source code distributed need not include\n"); + printf_filtered ("anything that is normally distributed (in either source or binary\n"); + printf_filtered ("form) with the major components (compiler, kernel, and so on) of the\n"); + printf_filtered ("operating system on which the executable runs, unless that component\n"); + printf_filtered ("itself accompanies the executable.\n"); + printf_filtered ("\n"); + printf_filtered ("If distribution of executable or object code is made by offering\n"); + printf_filtered ("access to copy from a designated place, then offering equivalent\n"); + printf_filtered ("access to copy the source code from the same place counts as\n"); + printf_filtered ("distribution of the source code, even though third parties are not\n"); + printf_filtered ("compelled to copy the source along with the object code.\n"); + printf_filtered ("\n"); + printf_filtered (" 4. You may not copy, modify, sublicense, or distribute the Program\n"); + printf_filtered ("except as expressly provided under this License. Any attempt\n"); + printf_filtered ("otherwise to copy, modify, sublicense or distribute the Program is\n"); + printf_filtered ("void, and will automatically terminate your rights under this License.\n"); + printf_filtered ("However, parties who have received copies, or rights, from you under\n"); + printf_filtered ("this License will not have their licenses terminated so long as such\n"); + printf_filtered ("parties remain in full compliance.\n"); + printf_filtered ("\n"); + printf_filtered (" 5. You are not required to accept this License, since you have not\n"); + printf_filtered ("signed it. However, nothing else grants you permission to modify or\n"); + printf_filtered ("distribute the Program or its derivative works. These actions are\n"); + printf_filtered ("prohibited by law if you do not accept this License. Therefore, by\n"); + printf_filtered ("modifying or distributing the Program (or any work based on the\n"); + printf_filtered ("Program), you indicate your acceptance of this License to do so, and\n"); + printf_filtered ("all its terms and conditions for copying, distributing or modifying\n"); + printf_filtered ("the Program or works based on it.\n"); printf_filtered ("\n"); printf_filtered (" 6. Each time you redistribute the Program (or any work based on the\n"); - printf_filtered ("Program), the recipient automatically receives a license from the original\n"); - printf_filtered ("licensor to copy, distribute or modify the Program subject to these\n"); - printf_filtered ("terms and conditions. You may not impose any further restrictions on the\n"); - printf_filtered ("recipients' exercise of the rights granted herein.\n"); - printf_filtered (" \n"); - printf_filtered (" 7. The Free Software Foundation may publish revised and/or new versions\n"); + printf_filtered ("Program), the recipient automatically receives a license from the\n"); + printf_filtered ("original licensor to copy, distribute or modify the Program subject to\n"); + printf_filtered ("these terms and conditions. You may not impose any further\n"); + printf_filtered ("restrictions on the recipients' exercise of the rights granted herein.\n"); + printf_filtered ("You are not responsible for enforcing compliance by third parties to\n"); + printf_filtered ("this License.\n"); + printf_filtered ("\n"); + printf_filtered (" 7. If, as a consequence of a court judgment or allegation of patent\n"); + printf_filtered ("infringement or for any other reason (not limited to patent issues),\n"); + printf_filtered ("conditions are imposed on you (whether by court order, agreement or\n"); + printf_filtered ("otherwise) that contradict the conditions of this License, they do not\n"); + printf_filtered ("excuse you from the conditions of this License. If you cannot\n"); + printf_filtered ("distribute so as to satisfy simultaneously your obligations under this\n"); + printf_filtered ("License and any other pertinent obligations, then as a consequence you\n"); + printf_filtered ("may not distribute the Program at all. For example, if a patent\n"); + printf_filtered ("license would not permit royalty-free redistribution of the Program by\n"); + printf_filtered ("all those who receive copies directly or indirectly through you, then\n"); + printf_filtered ("the only way you could satisfy both it and this License would be to\n"); + printf_filtered ("refrain entirely from distribution of the Program.\n"); + printf_filtered ("\n"); + printf_filtered ("If any portion of this section is held invalid or unenforceable under\n"); + printf_filtered ("any particular circumstance, the balance of the section is intended to\n"); + printf_filtered ("apply and the section as a whole is intended to apply in other\n"); + printf_filtered ("circumstances.\n"); + printf_filtered ("\n"); + printf_filtered ("It is not the purpose of this section to induce you to infringe any\n"); + printf_filtered ("patents or other property right claims or to contest validity of any\n"); + printf_filtered ("such claims; this section has the sole purpose of protecting the\n"); + printf_filtered ("integrity of the free software distribution system, which is\n"); + printf_filtered ("implemented by public license practices. Many people have made\n"); + printf_filtered ("generous contributions to the wide range of software distributed\n"); + printf_filtered ("through that system in reliance on consistent application of that\n"); + printf_filtered ("system; it is up to the author/donor to decide if he or she is willing\n"); + printf_filtered ("to distribute software through any other system and a licensee cannot\n"); + printf_filtered ("impose that choice.\n"); + printf_filtered ("\n"); + printf_filtered ("This section is intended to make thoroughly clear what is believed to\n"); + printf_filtered ("be a consequence of the rest of this License.\n"); + printf_filtered ("\n"); + printf_filtered (" 8. If the distribution and/or use of the Program is restricted in\n"); + printf_filtered ("certain countries either by patents or by copyrighted interfaces, the\n"); + printf_filtered ("original copyright holder who places the Program under this License\n"); + printf_filtered ("may add an explicit geographical distribution limitation excluding\n"); + printf_filtered ("those countries, so that distribution is permitted only in or among\n"); + printf_filtered ("countries not thus excluded. In such case, this License incorporates\n"); + printf_filtered ("the limitation as if written in the body of this License.\n"); + printf_filtered ("\n"); + printf_filtered (" 9. The Free Software Foundation may publish revised and/or new versions\n"); printf_filtered ("of the General Public License from time to time. Such new versions will\n"); printf_filtered ("be similar in spirit to the present version, but may differ in detail to\n"); printf_filtered ("address new problems or concerns.\n"); printf_filtered ("\n"); printf_filtered ("Each version is given a distinguishing version number. If the Program\n"); - printf_filtered ("specifies a version number of the license which applies to it and \"any\n"); + printf_filtered ("specifies a version number of this License which applies to it and \"any\n"); printf_filtered ("later version\", you have the option of following the terms and conditions\n"); printf_filtered ("either of that version or of any later version published by the Free\n"); printf_filtered ("Software Foundation. If the Program does not specify a version number of\n"); - printf_filtered ("the license, you may choose any version ever published by the Free Software\n"); + printf_filtered ("this License, you may choose any version ever published by the Free Software\n"); printf_filtered ("Foundation.\n"); printf_filtered ("\n"); - printf_filtered (" 8. If you wish to incorporate parts of the Program into other free\n"); + printf_filtered (" 10. If you wish to incorporate parts of the Program into other free\n"); printf_filtered ("programs whose distribution conditions are different, write to the author\n"); printf_filtered ("to ask for permission. For software which is copyrighted by the Free\n"); printf_filtered ("Software Foundation, write to the Free Software Foundation; we sometimes\n"); @@ -179,42 +278,59 @@ show_copying () immediate_quit--; } + +void +_initialize_copying () +{ + add_cmd ("copying", no_class, show_copying_command, + "Conditions for redistributing copies of GDB.", + &showlist); + add_cmd ("warranty", no_class, show_warranty_command, + "Various kinds of warranty you do not have.", + &showlist); + + /* For old-timers, allow "info copying", etc. */ + add_info ("copying", show_copying_command, + "Conditions for redistributing copies of GDB."); + add_info ("warranty", show_warranty_command, + "Various kinds of warranty you do not have."); +} + + static void -show_warranty () +show_warranty_command (ignore, from_tty) + char *ignore; + int from_tty; { immediate_quit++; - printf_filtered (" NO WARRANTY\n"); - printf_filtered ("\n"); - printf_filtered (" 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\n"); - printf_filtered ("FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN\n"); - printf_filtered ("OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\n"); - printf_filtered ("PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\n"); - printf_filtered ("OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n"); - printf_filtered ("MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS\n"); - printf_filtered ("TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE\n"); - printf_filtered ("PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\n"); - printf_filtered ("REPAIR OR CORRECTION.\n"); - printf_filtered ("\n"); - printf_filtered (" 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n"); - printf_filtered ("WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\n"); - printf_filtered ("REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\n"); - printf_filtered ("INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\n"); - printf_filtered ("OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\n"); - printf_filtered ("TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\n"); - printf_filtered ("YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\n"); - printf_filtered ("PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\n"); - printf_filtered ("POSSIBILITY OF SUCH DAMAGES.\n"); + printf_filtered ("gdb is free software, covered by the GNU General Public\n"); + printf_filtered ("License, and you are welcome to change it and/or distribute\n"); + printf_filtered ("copies of it under certain conditions. This version of gdb\n"); + printf_filtered ("is supported for customers of Cygnus Solutions.\n"); + printf_filtered ("\n"); + printf_filtered ("For non customers, gdb has NO WARRANTY.\n"); + printf_filtered ("\n"); + printf_filtered ("Because this software is licensed free of charge, there are no\n"); + printf_filtered ("warranties for it, to the extent permitted by applicable law.\n"); + printf_filtered ("Except when otherwise stated in writing, the copyright holders\n"); + printf_filtered ("and/or other parties provide the software \"as is\" without\n"); + printf_filtered ("warranty of any kind, either expressed or implied, including,\n"); + printf_filtered ("but not limited to, the implied warranties of merchantability\n"); + printf_filtered ("and fitness for a particular purpose. The entire risk as\n"); + printf_filtered ("to the quality and performance of the software is with you.\n"); + printf_filtered ("Should the software provide defective, you assume the cost of\n"); + printf_filtered ("all necessary servicing, repair or correction.\n"); + printf_filtered ("\n"); + printf_filtered ("In no event, unless required by applicable law or agreed to\n"); + printf_filtered ("in writing, will any copyright holder, or any other party who\n"); + printf_filtered ("may modify and/or redistribute the program as permitted above,\n"); + printf_filtered ("be liable to you for damages, including any general, special,\n"); + printf_filtered ("incidental or consequential damages arising out of the use\n"); + printf_filtered ("or inability to use the program (including but not limited\n"); + printf_filtered ("to loss of data or data being rendered inaccurate or losses\n"); + printf_filtered ("sustained by your or third parties or a failure of the program\n"); + printf_filtered ("to operate with any other programs), even if such holder or\n"); + printf_filtered ("other party has been advised of the possibility of such damages.\n"); printf_filtered ("\n"); immediate_quit--; } - -void -_initialize_copying () -{ - add_cmd ("copying", no_class, show_copying, - "Conditions for redistributing copies of GDB.", - &showlist); - add_cmd ("warranty", no_class, show_warranty, - "Various kinds of warranty you do not have.", - &showlist); -} diff --git a/gdb/gdbtk.c b/gdb/gdbtk.c index 60a921fd3a6..13bdcd8bfcf 100644 --- a/gdb/gdbtk.c +++ b/gdb/gdbtk.c @@ -27,14 +27,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "symfile.h" #include "objfiles.h" #include "target.h" +#include "gdbcore.h" +#include "tracepoint.h" + +#ifdef _WIN32 +#include +#endif + #include #include #include #include +#include "guitcl.h" + #ifdef IDE +/* start-sanitize-ide */ #include "event.h" #include "idetcl.h" +#include "ilutk.h" +/* end-sanitize-ide */ #endif #ifdef ANSI_PROTOTYPES @@ -59,6 +71,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #endif #endif +#ifdef __CYGWIN32__ +#include +#endif + #ifdef WINNT #define GDBTK_PATH_SEP ";" #else @@ -71,6 +87,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #undef SIOCSPGRP #endif +int gdbtk_load_hash PARAMS ((char *, unsigned long)); +int (*ui_load_progress_hook) PARAMS ((char *, unsigned long)); + static void null_routine PARAMS ((int)); static void gdbtk_flush PARAMS ((FILE *)); static void gdbtk_fputs PARAMS ((const char *, FILE *)); @@ -89,6 +108,8 @@ static int compare_lines PARAMS ((const PTR, const PTR)); static int gdbtk_dis_asm_read_memory PARAMS ((bfd_vma, bfd_byte *, int, disassemble_info *)); static int gdb_path_conv PARAMS ((ClientData, Tcl_Interp *, int, char *[])); static int gdb_stop PARAMS ((ClientData, Tcl_Interp *, int, char *[])); +static int gdb_confirm_quit PARAMS ((ClientData, Tcl_Interp *, int, char *[])); +static int gdb_force_quit PARAMS ((ClientData, Tcl_Interp *, int, char *[])); static int gdb_listfiles PARAMS ((ClientData, Tcl_Interp *, int, char *[])); static int gdb_listfuncs PARAMS ((ClientData, Tcl_Interp *, int, char *[])); static int call_wrapper PARAMS ((ClientData, Tcl_Interp *, int, char *[])); @@ -110,12 +131,27 @@ static int map_arg_registers PARAMS ((int, char *[], void (*) (int, void *), voi static void get_register_name PARAMS ((int, void *)); static int gdb_regnames PARAMS ((ClientData, Tcl_Interp *, int, char *[])); static void get_register PARAMS ((int, void *)); +static int gdb_target_has_execution_command PARAMS ((ClientData, Tcl_Interp *, int, char *argv[])); +static int gdb_load_info PARAMS ((ClientData, Tcl_Interp *, int, Tcl_Obj *CONST objv[])); +static int gdb_get_vars_command PARAMS ((ClientData, Tcl_Interp *, int, Tcl_Obj *CONST objv[])); +static int gdb_get_function_command PARAMS ((ClientData, Tcl_Interp *, int, Tcl_Obj *CONST objv[])); +static int gdb_get_line_command PARAMS ((ClientData, Tcl_Interp *, int, Tcl_Obj *CONST objv[])); +static int gdb_get_file_command PARAMS ((ClientData, Tcl_Interp *, int, Tcl_Obj *CONST objv[])); +static int gdb_tracepoint_exists_command PARAMS ((ClientData, Tcl_Interp *, int, Tcl_Obj *CONST objv[])); +static int gdb_get_tracepoint_info PARAMS ((ClientData, Tcl_Interp *, int, Tcl_Obj *CONST objv[])); +static int gdb_actions_command PARAMS ((ClientData, Tcl_Interp *, int, Tcl_Obj *CONST objv[])); +static int gdb_prompt_command PARAMS ((ClientData, Tcl_Interp *, int, Tcl_Obj *CONST objv[])); +static void gdbtk_create_tracepoint PARAMS ((struct tracepoint *)); +static void gdbtk_delete_tracepoint PARAMS ((struct tracepoint *)); +static void tracepoint_notify PARAMS ((struct tracepoint *, const char *)); /* Handle for TCL interpreter */ static Tcl_Interp *interp = NULL; +#ifndef WINNT static int x_fd; /* X network socket */ +#endif /* This variable is true when the inferior is running. Although it's possible to disable most input from widgets and thus prevent @@ -163,7 +199,7 @@ Tcl_Free(ptr) free (ptr); } -#endif /* _WIN32 */ +#endif /* ! _WIN32 */ static void null_routine(arg) @@ -171,6 +207,31 @@ null_routine(arg) { } +#ifdef _WIN32 + +/* On Windows, if we hold a file open, other programs can't write to + it. In particular, we don't want to hold the executable open, + because it will mean that people have to get out of the debugging + session in order to remake their program. So we close it, although + this will cost us if and when we need to reopen it. */ + +static void +close_bfds () +{ + struct objfile *o; + + ALL_OBJFILES (o) + { + if (o->obfd != NULL) + bfd_cache_close (o->obfd); + } + + if (exec_bfd != NULL) + bfd_cache_close (exec_bfd); +} + +#endif /* _WIN32 */ + /* The following routines deal with stdout/stderr data, which is created by {f}printf_{un}filtered and friends. gdbtk_fputs and gdbtk_flush are the lowest level of these routines and capture all output from the rest of GDB. @@ -185,9 +246,14 @@ null_routine(arg) get_saved_output (but this must be done before the call to finish_saving_output). */ -/* Dynamic string header for stdout. */ +/* Dynamic string for output. */ static Tcl_DString *result_ptr; + +/* Dynamic string for stderr. This is only used if result_ptr is + NULL. */ + +static Tcl_DString *error_string_ptr; static void gdbtk_flush (stream) @@ -206,7 +272,9 @@ gdbtk_fputs (ptr, stream) FILE *stream; { if (result_ptr) - Tcl_DStringAppend (result_ptr, (char *)ptr, -1); + Tcl_DStringAppend (result_ptr, (char *) ptr, -1); + else if (error_string_ptr != NULL && stream == gdb_stderr) + Tcl_DStringAppend (error_string_ptr, (char *) ptr, -1); else { Tcl_DString str; @@ -235,7 +303,7 @@ gdbtk_query (query, args) merge[1] = buf; command = Tcl_Merge (2, merge); Tcl_Eval (interp, command); - free (command); + Tcl_Free (command); val = atol (interp->result); return val; @@ -278,6 +346,10 @@ gdbtk_readline (prompt) char *command; int result; +#ifdef _WIN32 + close_bfds (); +#endif + merge[0] = "gdbtk_tcl_readline"; merge[1] = prompt; command = Tcl_Merge (2, merge); @@ -392,6 +464,7 @@ gdb_get_breakpoint_info (clientData, interp, argc, argv) int bpnum; struct breakpoint *b; extern struct breakpoint *breakpoint_chain; + char *funcname; if (argc != 2) error ("wrong # args"); @@ -408,12 +481,13 @@ gdb_get_breakpoint_info (clientData, interp, argc, argv) sal = find_pc_line (b->address, 0); Tcl_DStringAppendElement (result_ptr, symtab_to_filename (sal.symtab)); + find_pc_partial_function (b->address, &funcname, NULL, NULL); + Tcl_DStringAppendElement (result_ptr, funcname); dsprintf_append_element (result_ptr, "%d", sal.line); dsprintf_append_element (result_ptr, "0x%lx", b->address); Tcl_DStringAppendElement (result_ptr, bptypes[b->type]); Tcl_DStringAppendElement (result_ptr, b->enable == enabled ? "1" : "0"); Tcl_DStringAppendElement (result_ptr, bpdisp[b->disposition]); - dsprintf_append_element (result_ptr, "%d", b->silent); dsprintf_append_element (result_ptr, "%d", b->ignore_count); Tcl_DStringStartSublist (result_ptr); @@ -492,6 +566,12 @@ gdb_loc (clientData, interp, argc, argv) char *funcname; CORE_ADDR pc; + if (!have_full_symbols () && !have_partial_symbols ()) + { + Tcl_SetResult (interp, "No symbol table is loaded", TCL_STATIC); + return TCL_ERROR; + } + if (argc == 1) { pc = selected_frame ? selected_frame->pc : stop_pc; @@ -565,7 +645,95 @@ gdb_eval (clientData, interp, argc, argv) return TCL_OK; } - + +/* gdb_get_mem addr form size num aschar*/ +/* dump a block of memory */ +/* addr: address of data to dump */ +/* form: a char indicating format */ +/* size: size of each element; 1,2,4, or 8 bytes*/ +/* num: the number of 'size' elements to return */ +/* acshar: an optional ascii character to use in ASCII dump */ +/* returns a list of 'num' elements followed by an optional */ +/* ASCII dump */ +static int +gdb_get_mem (clientData, interp, argc, argv) + ClientData clientData; + Tcl_Interp *interp; + int argc; + char *argv[]; +{ + int size, asize, num, i, j; + CORE_ADDR addr, saved_addr, ptr; + int format; + struct type *val_type; + value_ptr vptr; + char c, buff[128], aschar; + + if (argc != 6) + error ("wrong # args"); + + addr = (CORE_ADDR)strtoul(argv[1],(char **)NULL,0); + saved_addr = addr; + format = *argv[2]; + size = (int)strtoul(argv[3],(char **)NULL,0); + num = (int)strtoul(argv[4],(char **)NULL,0); + aschar = *argv[5]; + + switch (size) { + case 1: + val_type = builtin_type_char; + asize = 'b'; + break; + case 2: + val_type = builtin_type_short; + asize = 'h'; + break; + case 4: + val_type = builtin_type_int; + asize = 'w'; + break; + case 8: + val_type = builtin_type_long_long; + asize = 'g'; + break; + default: + val_type = builtin_type_char; + asize = 'b'; + } + + for (i=0; i < num; i++) + { + vptr = value_at (val_type, addr, (asection *)NULL); + print_scalar_formatted (VALUE_CONTENTS(vptr), val_type, format, asize, gdb_stdout); + fputs_unfiltered (" ", gdb_stdout); + addr += size; + } + + if (aschar) + { + val_type = builtin_type_char; + ptr = saved_addr; + buff[0] = '"'; + i = 1; + for (j=0; j < num*size; j++) + { + c = *(char *)VALUE_CONTENTS(value_at (val_type, ptr, (asection *)NULL)); + if (c < 32 || c > 126) + c = aschar; + if (c == '"') + buff[i++] = '\\'; + buff[i++] = c; + ptr++; + } + buff[i++] = '"'; + buff[i] = 0; + fputs_unfiltered (buff, gdb_stdout); + } + + return TCL_OK; +} + + /* This implements the TCL command `gdb_sourcelines', which returns a list of all of the lines containing executable code for the specified source file (ie: lines where you can put breakpoints). */ @@ -809,15 +977,30 @@ gdb_cmd (clientData, interp, argc, argv) int argc; char *argv[]; { + Tcl_DString *save_ptr = NULL; + if (argc != 2) error ("wrong # args"); if (running_now) return TCL_OK; + /* for the load instruction (and possibly others later) we + set result_ptr to NULL so gdbtk_fputs() will not buffer + all the data until the command is finished. */ + + if (strncmp("load ",argv[1],5) == 0) { + Tcl_DStringAppend (result_ptr, "", -1); + save_ptr = result_ptr; + result_ptr = NULL; + } + execute_command (argv[1], 1); bpstat_do_actions (&stop_bpstat); + + if (save_ptr) + result_ptr = save_ptr; return TCL_OK; } @@ -858,11 +1041,16 @@ call_wrapper (clientData, interp, argc, argv) { struct wrapped_call_args wrapped_args; Tcl_DString result, *old_result_ptr; + Tcl_DString error_string, *old_error_string_ptr; Tcl_DStringInit (&result); old_result_ptr = result_ptr; result_ptr = &result; + Tcl_DStringInit (&error_string); + old_error_string_ptr = error_string_ptr; + error_string_ptr = &error_string; + wrapped_args.func = (Tcl_CmdProc *)clientData; wrapped_args.interp = interp; wrapped_args.argc = argc; @@ -885,8 +1073,31 @@ call_wrapper (clientData, interp, argc, argv) Tcl_Eval (interp, "gdbtk_tcl_idle"); } - Tcl_DStringResult (interp, &result); + if (Tcl_DStringLength (&error_string) == 0) + { + Tcl_DStringResult (interp, &result); + Tcl_DStringFree (&error_string); + } + else if (Tcl_DStringLength (&result) == 0) + { + Tcl_DStringResult (interp, &error_string); + Tcl_DStringFree (&result); + } + else + { + Tcl_ResetResult (interp); + Tcl_AppendResult (interp, Tcl_DStringValue (&result), + Tcl_DStringValue (&error_string), (char *) NULL); + Tcl_DStringFree (&result); + Tcl_DStringFree (&error_string); + } + result_ptr = old_result_ptr; + error_string_ptr = old_error_string_ptr; + +#ifdef _WIN32 + close_bfds (); +#endif return wrapped_args.val; } @@ -965,6 +1176,64 @@ gdb_stop (clientData, interp, argc, argv) return TCL_OK; } + +/* Prepare to accept a new executable file. This is called when we + want to clear away everything we know about the old file, without + asking the user. The Tcl code will have already asked the user if + necessary. After this is called, we should be able to run the + `file' command without getting any questions. */ + +static int +gdb_clear_file (clientData, interp, argc, argv) + ClientData clientData; + Tcl_Interp *interp; + int argc; + char *argv[]; +{ + if (inferior_pid != 0 && target_has_execution) + { + if (attach_flag) + target_detach (NULL, 0); + else + target_kill (); + } + + if (target_has_execution) + pop_target (); + + symbol_file_command (NULL, 0); + + return TCL_OK; +} + +/* Ask the user to confirm an exit request. */ + +static int +gdb_confirm_quit (clientData, interp, argc, argv) + ClientData clientData; + Tcl_Interp *interp; + int argc; + char *argv[]; +{ + int ret; + + ret = quit_confirm (); + Tcl_DStringAppendElement (result_ptr, ret ? "1" : "0"); + return TCL_OK; +} + +/* Quit without asking for confirmation. */ + +static int +gdb_force_quit (clientData, interp, argc, argv) + ClientData clientData; + Tcl_Interp *interp; + int argc; + char *argv[]; +{ + quit_force ((char *) NULL, 1); + return TCL_OK; +} /* This implements the TCL command `gdb_disassemble'. */ @@ -1275,14 +1544,72 @@ x_event (signo) while (Tcl_DoOneEvent (TCL_DONT_WAIT|TCL_ALL_EVENTS) != 0); } +#ifdef __CYGWIN32__ + +/* 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 void +gdbtk_start_timer () +{ + sigset_t nullsigmask; + struct sigaction action; + struct itimerval it; + + sigemptyset (&nullsigmask); + + action.sa_handler = x_event; + action.sa_mask = nullsigmask; + action.sa_flags = 0; + sigaction (SIGALRM, &action, NULL); + + it.it_interval.tv_sec = 0; + /* Check for messages twice a second. */ + it.it_interval.tv_usec = 500 * 1000; + it.it_value.tv_sec = 0; + it.it_value.tv_usec = 500 * 1000; + + setitimer (ITIMER_REAL, &it, NULL); +} + +static void +gdbtk_stop_timer () +{ + sigset_t nullsigmask; + struct sigaction action; + struct itimerval it; + + sigemptyset (&nullsigmask); + + action.sa_handler = SIG_IGN; + action.sa_mask = nullsigmask; + action.sa_flags = 0; + sigaction (SIGALRM, &action, NULL); + + it.it_interval.tv_sec = 0; + it.it_interval.tv_usec = 0; + it.it_value.tv_sec = 0; + it.it_value.tv_usec = 0; + setitimer (ITIMER_REAL, &it, NULL); +} + +#endif + +/* This hook function is called whenever we want to wait for the + target. */ + static int gdbtk_wait (pid, ourstatus) int pid; struct target_waitstatus *ourstatus; { +#ifndef WINNT struct sigaction action; static sigset_t nullsigmask = {0}; + #ifndef SA_RESTART /* Needed for SunOS 4.1.x */ #define SA_RESTART 0 @@ -1291,14 +1618,21 @@ gdbtk_wait (pid, ourstatus) action.sa_handler = x_event; action.sa_mask = nullsigmask; action.sa_flags = SA_RESTART; -#ifndef WINNT sigaction(SIGIO, &action, NULL); +#endif /* WINNT */ + +#ifdef __CYGWIN32__ + gdbtk_start_timer (); #endif pid = target_wait (pid, ourstatus); - action.sa_handler = SIG_IGN; +#ifdef __CYGWIN32__ + gdbtk_stop_timer (); +#endif + #ifndef WINNT + action.sa_handler = SIG_IGN; sigaction(SIGIO, &action, NULL); #endif @@ -1318,7 +1652,7 @@ gdbtk_call_command (cmdblk, arg, from_tty) int from_tty; { running_now = 0; - if (cmdblk->class == class_run) + if (cmdblk->class == class_run || cmdblk->class == class_trace) { running_now = 1; Tcl_Eval (interp, "gdbtk_tcl_busy"); @@ -1340,7 +1674,26 @@ tk_command_loop () /* We no longer want to use stdin as the command input stream */ instream = NULL; - Tcl_Eval (interp, "gdbtk_tcl_preloop"); + + if (Tcl_Eval (interp, "gdbtk_tcl_preloop") != TCL_OK) + { + char *msg; + + /* Force errorInfo to be set up propertly. */ + Tcl_AddErrorInfo (interp, ""); + + msg = Tcl_GetVar (interp, "errorInfo", TCL_GLOBAL_ONLY); +#ifdef _WIN32 + MessageBox (NULL, msg, NULL, MB_OK | MB_ICONERROR | MB_TASKMODAL); +#else + fputs_unfiltered (msg, gdb_stderr); +#endif + } + +#ifdef _WIN32 + close_bfds (); +#endif + Tk_MainLoop (); } @@ -1362,12 +1715,16 @@ gdbtk_init ( argv0 ) struct cleanup *old_chain; char *lib, *gdbtk_lib, *gdbtk_lib_tmp, *gdbtk_file; int i, found_main; +#ifndef WINNT struct sigaction action; static sigset_t nullsigmask = {0}; +#endif #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, @@ -1393,11 +1750,12 @@ gdbtk_init ( argv0 ) make_final_cleanup (gdbtk_cleanup, NULL); -#ifdef IDE /* Initialize the Paths variable. */ if (ide_initialize_paths (interp, "gdbtcl") != TCL_OK) error ("ide_initialize_paths failed: %s", interp->result); +#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 (interp, "Paths", "libexecdir", TCL_GLOBAL_ONLY); @@ -1417,26 +1775,39 @@ gdbtk_init ( argv0 ) { if (ide_create_tclevent_command (interp, h) != TCL_OK) error ("ide_create_tclevent_command failed: %s", interp->result); + if (ide_create_edit_command (interp, h) != TCL_OK) error ("ide_create_edit_command failed: %s", interp->result); if (ide_create_property_command (interp, h) != TCL_OK) error ("ide_create_property_command failed: %s", interp->result); - - if (ide_create_window_register_command (interp, h) != TCL_OK) + + if (ide_create_build_command (interp, h) != TCL_OK) + error ("ide_create_build_command failed: %s", interp->result); + + if (ide_create_window_register_command (interp, h, "gdb-restore") + != TCL_OK) error ("ide_create_window_register_command failed: %s", interp->result); if (ide_create_window_command (interp, h) != TCL_OK) error ("ide_create_window_command failed: %s", interp->result); + if (ide_create_exit_command (interp, h) != TCL_OK) + error ("ide_create_exit_command failed: %s", interp->result); + + if (ide_create_help_command (interp) != TCL_OK) + error ("ide_create_help_command failed: %s", interp->result); + /* if (ide_initialize (interp, "gdb") != TCL_OK) error ("ide_initialize failed: %s", interp->result); */ Tcl_SetVar (interp, "GDBTK_IDE", "1", 0); + Tcl_SetVar (interp, "IDE", "1", TCL_GLOBAL_ONLY); } + /* end-sanitize-ide */ #else Tcl_SetVar (interp, "GDBTK_IDE", "0", 0); #endif /* IDE */ @@ -1454,6 +1825,18 @@ gdbtk_init ( argv0 ) if (Tix_Init(interp) != TCL_OK) error ("Tix_Init failed: %s", interp->result); +#ifdef __CYGWIN32__ + /* On Windows, create a sizebox widget command */ + if (ide_create_sizebox_command (interp) != TCL_OK) + error ("sizebox creation failed"); + if (ide_create_winprint_command (interp) != TCL_OK) + error ("windows print code initialization failed"); + /* start-sanitize-ide */ + /* An interface to ShellExecute. */ + if (ide_create_shell_execute_command (interp) != TCL_OK) + error ("shell execute command initialization failed"); +#endif + Tcl_CreateCommand (interp, "gdb_cmd", call_wrapper, gdb_cmd, NULL); Tcl_CreateCommand (interp, "gdb_loc", call_wrapper, gdb_loc, NULL); Tcl_CreateCommand (interp, "gdb_path_conv", call_wrapper, gdb_path_conv, NULL); @@ -1463,6 +1846,8 @@ gdbtk_init ( argv0 ) NULL); Tcl_CreateCommand (interp, "gdb_listfuncs", call_wrapper, gdb_listfuncs, NULL); + Tcl_CreateCommand (interp, "gdb_get_mem", call_wrapper, gdb_get_mem, + NULL); Tcl_CreateCommand (interp, "gdb_stop", call_wrapper, gdb_stop, NULL); Tcl_CreateCommand (interp, "gdb_regnames", call_wrapper, gdb_regnames, NULL); Tcl_CreateCommand (interp, "gdb_fetch_registers", call_wrapper, @@ -1476,7 +1861,35 @@ gdbtk_init ( argv0 ) gdb_get_breakpoint_list, NULL); Tcl_CreateCommand (interp, "gdb_get_breakpoint_info", call_wrapper, gdb_get_breakpoint_info, NULL); - + Tcl_CreateCommand (interp, "gdb_clear_file", call_wrapper, + gdb_clear_file, NULL); + Tcl_CreateCommand (interp, "gdb_confirm_quit", call_wrapper, + gdb_confirm_quit, NULL); + Tcl_CreateCommand (interp, "gdb_force_quit", call_wrapper, + gdb_force_quit, NULL); + Tcl_CreateCommand (interp, "gdb_target_has_execution", + gdb_target_has_execution_command, + NULL, NULL); + Tcl_CreateObjCommand (interp, "gdb_load_info", gdb_load_info, NULL, NULL); + Tcl_CreateObjCommand (interp, "gdb_get_locals", gdb_get_vars_command, + (ClientData) 0, NULL); + Tcl_CreateObjCommand (interp, "gdb_get_args", gdb_get_vars_command, + (ClientData) 1, NULL); + Tcl_CreateObjCommand (interp, "gdb_get_function", gdb_get_function_command, + NULL, NULL); + Tcl_CreateObjCommand (interp, "gdb_get_line", gdb_get_line_command, + NULL, NULL); + Tcl_CreateObjCommand (interp, "gdb_get_file", gdb_get_file_command, + NULL, NULL); + Tcl_CreateObjCommand (interp, "gdb_tracepoint_exists", + gdb_tracepoint_exists_command, NULL, NULL); + Tcl_CreateObjCommand (interp, "gdb_get_tracepoint_info", + gdb_get_tracepoint_info, NULL, NULL); + Tcl_CreateObjCommand (interp, "gdb_actions", + gdb_actions_command, NULL, NULL); + Tcl_CreateObjCommand (interp, "gdb_prompt", + gdb_prompt_command, NULL, NULL); + command_loop_hook = tk_command_loop; print_frame_info_listing_hook = (void (*) PARAMS ((struct symtab *, int, int, int))) null_routine; @@ -1491,7 +1904,11 @@ gdbtk_init ( argv0 ) readline_begin_hook = gdbtk_readline_begin; readline_hook = gdbtk_readline; readline_end_hook = gdbtk_readline_end; + ui_load_progress_hook = gdbtk_load_hash; + create_tracepoint_hook = gdbtk_create_tracepoint; + delete_tracepoint_hook = gdbtk_delete_tracepoint; +#ifndef WINNT /* Get the file descriptor for the X server */ x_fd = ConnectionNumber (Tk_Display (Tk_MainWindow (interp))); @@ -1501,9 +1918,7 @@ gdbtk_init ( argv0 ) action.sa_mask = nullsigmask; action.sa_flags = 0; action.sa_handler = SIG_IGN; -#ifndef WINNT sigaction(SIGIO, &action, NULL); -#endif #ifdef FIOASYNC i = 1; @@ -1529,6 +1944,7 @@ gdbtk_init ( argv0 ) #endif #endif /* ifndef FIOASYNC */ +#endif /* WINNT */ add_com ("tk", class_obscure, tk_command, "Send a command directly into tk."); @@ -1571,7 +1987,6 @@ gdbtk_init ( argv0 ) free (gdbtk_lib_tmp); -#ifdef IDE if (!found_main) { /* Try finding it with the auto path. */ @@ -1602,7 +2017,6 @@ gdbtk_find_main"; found_main++; } } -#endif if (!found_main) { @@ -1628,21 +2042,544 @@ gdbtk_find_main"; if (Tcl_EvalFile (interp, gdbtk_file) != TCL_OK) { + char *msg; + + /* Force errorInfo to be set up propertly. */ + Tcl_AddErrorInfo (interp, ""); + + msg = Tcl_GetVar (interp, "errorInfo", TCL_GLOBAL_ONLY); + fputs_unfiltered_hook = NULL; /* Force errors to stdout/stderr */ - fprintf_unfiltered (stderr, "%s:%d: %s\n", gdbtk_file, - interp->errorLine, interp->result); +#ifdef _WIN32 + MessageBox (NULL, msg, NULL, MB_OK | MB_ICONERROR | MB_TASKMODAL); +#else + fputs_unfiltered (msg, gdb_stderr); +#endif - fputs_unfiltered ("Stack trace:\n", gdb_stderr); - fputs_unfiltered (Tcl_GetVar (interp, "errorInfo", 0), gdb_stderr); error (""); } +#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 (interp, h) != TCL_OK) + error ("ide_run_server_init failed: %s", interp->result); + /* end-sanitize-ide */ +#endif + free (gdbtk_file); discard_cleanups (old_chain); } +static int +gdb_target_has_execution_command (clientData, interp, argc, argv) + ClientData clientData; + Tcl_Interp *interp; + int argc; + char *argv[]; +{ + int result = 0; + + if (target_has_execution && inferior_pid != 0) + result = 1; + + Tcl_SetIntObj (Tcl_GetObjResult (interp), result); + return TCL_OK; +} + +/* gdb_load_info - returns information about the file about to be downloaded */ + +static int +gdb_load_info (clientData, interp, objc, objv) + ClientData clientData; + Tcl_Interp *interp; + int objc; + Tcl_Obj *CONST objv[]; +{ + bfd *loadfile_bfd; + struct cleanup *old_cleanups; + asection *s; + Tcl_Obj *ob[2]; + Tcl_Obj *res[16]; + int i = 0; + + char *filename = Tcl_GetStringFromObj (objv[1], NULL); + + loadfile_bfd = bfd_openr (filename, gnutarget); + if (loadfile_bfd == NULL) + { + Tcl_SetObjResult (interp, Tcl_NewStringObj ("Open failed", -1)); + return TCL_ERROR; + } + old_cleanups = make_cleanup (bfd_close, loadfile_bfd); + + if (!bfd_check_format (loadfile_bfd, bfd_object)) + { + Tcl_SetObjResult (interp, Tcl_NewStringObj ("Bad Object File", -1)); + return TCL_ERROR; + } + + for (s = loadfile_bfd->sections; s; s = s->next) + { + if (s->flags & SEC_LOAD) + { + bfd_size_type size = bfd_get_section_size_before_reloc (s); + if (size > 0) + { + ob[0] = Tcl_NewStringObj((char *)bfd_get_section_name(loadfile_bfd, s), -1); + ob[1] = Tcl_NewLongObj ((long)size); + res[i++] = Tcl_NewListObj (2, ob); + } + } + } + + Tcl_SetObjResult (interp, Tcl_NewListObj (i, res)); + do_cleanups (old_cleanups); + return TCL_OK; +} + + +int +gdbtk_load_hash (section, num) + char *section; + unsigned long num; +{ + int result; + char buf[128]; + sprintf (buf, "download_hash %s %ld", section, num); + result = Tcl_Eval (interp, buf); + return result; +} + +/* gdb_get_vars_command - + * + * Implements the "gdb_get_locals" and "gdb_get_args" tcl commands. This + * function sets the Tcl interpreter's result to a list of variable names + * depending on clientData. If clientData is one, the result is a list of + * arguments; zero returns a list of locals -- all relative to the block + * specified as an argument to the command. Valid commands include + * anything decode_line_1 can handle (like "main.c:2", "*0x02020202", + * and "main"). + */ +static int +gdb_get_vars_command (clientData, interp, objc, objv) + ClientData clientData; + Tcl_Interp *interp; + int objc; + Tcl_Obj *CONST objv[]; +{ + Tcl_Obj *result; + struct symtabs_and_lines sals; + struct symbol *sym; + struct block *block; + char **canonical, *args; + int i, nsyms, arguments; + + if (objc != 2) + { + Tcl_AppendResult (interp, + "wrong # of args: should be \"", + Tcl_GetStringFromObj (objv[0], NULL), + " function:line|function|line|*addr\""); + return TCL_ERROR; + } + + arguments = (int) clientData; + args = Tcl_GetStringFromObj (objv[1], NULL); + sals = decode_line_1 (&args, 1, NULL, 0, &canonical); + if (sals.nelts == 0) + { + Tcl_AppendResult (interp, + "error decoding line", NULL); + return TCL_ERROR; + } + + /* Initialize a list that will hold the results */ + result = Tcl_NewListObj (0, NULL); + + /* Resolve all line numbers to PC's */ + for (i = 0; i < sals.nelts; i++) + resolve_sal_pc (&sals.sals[i]); + + block = block_for_pc (sals.sals[0].pc); + while (block != 0) + { + nsyms = BLOCK_NSYMS (block); + for (i = 0; i < nsyms; i++) + { + sym = BLOCK_SYM (block, i); + switch (SYMBOL_CLASS (sym)) { + default: + case LOC_UNDEF: /* catches errors */ + case LOC_CONST: /* constant */ + case LOC_STATIC: /* static */ + case LOC_REGISTER: /* register */ + case LOC_TYPEDEF: /* local typedef */ + case LOC_LABEL: /* local label */ + case LOC_BLOCK: /* local function */ + case LOC_CONST_BYTES: /* loc. byte seq. */ + case LOC_UNRESOLVED: /* unresolved static */ + case LOC_OPTIMIZED_OUT: /* optimized out */ + break; + case LOC_ARG: /* argument */ + case LOC_REF_ARG: /* reference arg */ + case LOC_REGPARM: /* register arg */ + case LOC_REGPARM_ADDR: /* indirect register arg */ + case LOC_LOCAL_ARG: /* stack arg */ + case LOC_BASEREG_ARG: /* basereg arg */ + if (arguments) + Tcl_ListObjAppendElement (interp, result, + Tcl_NewStringObj (SYMBOL_NAME (sym), -1)); + break; + case LOC_LOCAL: /* stack local */ + case LOC_BASEREG: /* basereg local */ + if (!arguments) + Tcl_ListObjAppendElement (interp, result, + Tcl_NewStringObj (SYMBOL_NAME (sym), -1)); + break; + } + } + if (BLOCK_FUNCTION (block)) + break; + else + block = BLOCK_SUPERBLOCK (block); + } + + Tcl_SetObjResult (interp, result); + return TCL_OK; +} + +static int +gdb_get_line_command (clientData, interp, objc, objv) + ClientData clientData; + Tcl_Interp *interp; + int objc; + Tcl_Obj *CONST objv[]; +{ + Tcl_Obj *result; + struct symtabs_and_lines sals; + char *args, **canonical; + + if (objc != 2) + { + Tcl_AppendResult (interp, "wrong # of args: should be \"", + Tcl_GetStringFromObj (objv[0], NULL), + " linespec\""); + return TCL_ERROR; + } + + args = Tcl_GetStringFromObj (objv[1], NULL); + sals = decode_line_1 (&args, 1, NULL, 0, &canonical); + if (sals.nelts == 1) + { + Tcl_SetObjResult (interp, Tcl_NewIntObj (sals.sals[0].line)); + return TCL_OK; + } + + Tcl_SetResult (interp, "N/A", TCL_STATIC); + return TCL_OK; +} + +static int +gdb_get_file_command (clientData, interp, objc, objv) + ClientData clientData; + Tcl_Interp *interp; + int objc; + Tcl_Obj *CONST objv[]; +{ + Tcl_Obj *result; + struct symtabs_and_lines sals; + char *args, **canonical; + + if (objc != 2) + { + Tcl_AppendResult (interp, "wrong # of args: should be \"", + Tcl_GetStringFromObj (objv[0], NULL), + " linespec\""); + return TCL_ERROR; + } + + args = Tcl_GetStringFromObj (objv[1], NULL); + sals = decode_line_1 (&args, 1, NULL, 0, &canonical); + if (sals.nelts == 1) + { + Tcl_SetResult (interp, sals.sals[0].symtab->filename, TCL_VOLATILE); + return TCL_OK; + } + + Tcl_SetResult (interp, "N/A", TCL_STATIC); + return TCL_OK; +} + +static int +gdb_get_function_command (clientData, interp, objc, objv) + ClientData clientData; + Tcl_Interp *interp; + int objc; + Tcl_Obj *CONST objv[]; +{ + Tcl_Obj *result; + char *function; + struct symtabs_and_lines sals; + char *args, **canonical; + + if (objc != 2) + { + Tcl_AppendResult (interp, "wrong # of args: should be \"", + Tcl_GetStringFromObj (objv[0], NULL), + " linespec\""); + return TCL_ERROR; + } + + args = Tcl_GetStringFromObj (objv[1], NULL); + sals = decode_line_1 (&args, 1, NULL, 0, &canonical); + if (sals.nelts == 1) + { + resolve_sal_pc (&sals.sals[0]); + find_pc_partial_function (sals.sals[0].pc, &function, NULL, NULL); + if (function != NULL) + { + Tcl_SetResult (interp, function, TCL_VOLATILE); + return TCL_OK; + } + } + + Tcl_SetResult (interp, "N/A", TCL_STATIC); + return TCL_OK; +} + +static int +gdb_get_tracepoint_info (clientData, interp, objc, objv) + ClientData clientData; + Tcl_Interp *interp; + int objc; + Tcl_Obj *CONST objv[]; +{ + struct symtab_and_line sal; + struct command_line *cmd; + int tpnum; + struct tracepoint *tp; + struct action_line *al; + Tcl_Obj *list, *action_list; + char tmp[19]; + + if (objc != 2) + error ("wrong # args"); + + Tcl_GetIntFromObj (NULL, objv[1], &tpnum); + + ALL_TRACEPOINTS (tp) + if (tp->number == tpnum) + break; + + if (tp == NULL) + error ("Tracepoint #%d does not exist", tpnum); + + list = Tcl_NewListObj (0, NULL); + if (tp->source_file != NULL) + Tcl_ListObjAppendElement (interp, list, Tcl_NewStringObj (tp->source_file, -1)); + else + Tcl_ListObjAppendElement (interp, list, Tcl_NewStringObj ("N/A", -1)); + Tcl_ListObjAppendElement (interp, list, Tcl_NewIntObj (tp->line_number)); + /* the function part is not currently used by the frontend */ + Tcl_ListObjAppendElement (interp, list, Tcl_NewStringObj ("function", -1)); + sprintf (tmp, "0x%08x", tp->address); + Tcl_ListObjAppendElement (interp, list, Tcl_NewStringObj (tmp, -1)); + Tcl_ListObjAppendElement (interp, list, Tcl_NewIntObj (tp->enabled)); + Tcl_ListObjAppendElement (interp, list, Tcl_NewIntObj (tp->pass_count)); + Tcl_ListObjAppendElement (interp, list, Tcl_NewIntObj (tp->step_count)); + Tcl_ListObjAppendElement (interp, list, Tcl_NewIntObj (tp->thread)); + Tcl_ListObjAppendElement (interp, list, Tcl_NewIntObj (tp->hit_count)); + + /* Append a list of actions */ + action_list = Tcl_NewListObj (0, NULL); + for (al = tp->actions; al != NULL; al = al->next) + { + Tcl_ListObjAppendElement (interp, action_list, + Tcl_NewStringObj (al->action, -1)); + } + Tcl_ListObjAppendElement (interp, list, action_list); + + Tcl_SetObjResult (interp, list); + return TCL_OK; +} + +static void +gdbtk_create_tracepoint (tp) + struct tracepoint *tp; +{ + tracepoint_notify (tp, "create"); +} + +static void +gdbtk_delete_tracepoint (tp) + struct tracepoint *tp; +{ + tracepoint_notify (tp, "delete"); +} + +static void +tracepoint_notify(tp, action) + struct tracepoint *tp; + const char *action; +{ + char buf[256]; + char *source; + int v; + + /* We ensure that ACTION contains no special Tcl characters, so we + can do this. */ + if (tp->source_file != NULL) + source = tp->source_file; + else + source = "N/A"; + sprintf (buf, "gdbtk_tcl_tracepoint %s %d 0x%lx %d {%s}", action, tp->number, + (long)tp->address, tp->line_number, source); + + v = Tcl_Eval (interp, buf); + + if (v != TCL_OK) + { + gdbtk_fputs (interp->result, gdb_stdout); + gdbtk_fputs ("\n", gdb_stdout); + } +} + +/* returns -1 if not found, tracepoint # if found */ +int +tracepoint_exists (char * args) +{ + struct tracepoint *tp; + char **canonical; + struct symtabs_and_lines sals; + char *file = NULL; + int result = -1; + + sals = decode_line_1 (&args, 1, NULL, 0, &canonical); + if (sals.nelts == 1) + { + resolve_sal_pc (&sals.sals[0]); + file = xmalloc (strlen (sals.sals[0].symtab->dirname) + + strlen (sals.sals[0].symtab->filename) + 1); + if (file != NULL) + { + strcpy (file, sals.sals[0].symtab->dirname); + strcat (file, sals.sals[0].symtab->filename); + + ALL_TRACEPOINTS (tp) + { + if (tp->address == sals.sals[0].pc) + result = tp->number; + else if (tp->source_file != NULL + && strcmp (tp->source_file, file) == 0 + && sals.sals[0].line == tp->line_number) + + result = tp->number; + } + } + } + if (file != NULL) + free (file); + return result; +} + +static int +gdb_actions_command (clientData, interp, objc, objv) + ClientData clientData; + Tcl_Interp *interp; + int objc; + Tcl_Obj *CONST objv[]; +{ + struct tracepoint *tp; + Tcl_Obj **actions; + int nactions, i, len; + char *number, *args, *action; + struct action_line *next = NULL, *temp; + + if (objc != 3) + { + Tcl_AppendResult (interp, "wrong # args: should be: \"", + Tcl_GetStringFromObj (objv[0], NULL), + " number actions\""); + return TCL_ERROR; + } + + args = number = Tcl_GetStringFromObj (objv[1], NULL); + tp = get_tracepoint_by_number (&args); + if (tp == NULL) + { + Tcl_AppendResult (interp, "Tracepoint \"", number, "\" does not exist"); + return TCL_ERROR; + } + + /* Free any existing actions */ + for (temp = tp->actions; temp != NULL; temp = temp->next) + { + if (temp->action) + free (temp->action); + free (temp); + } + + Tcl_ListObjGetElements (interp, objv[2], &nactions, &actions); + for (i = 0; i < nactions; i++) + { + temp = xmalloc (sizeof (struct action_line)); + temp->next = NULL; + action = Tcl_GetStringFromObj (actions[i], &len); + temp->action = savestring (action, len); + if (next == NULL) + { + tp->actions = temp; + next = temp; + } + else + { + next->next = temp; + next = temp; + } + } + + return TCL_OK; +} + +static int +gdb_tracepoint_exists_command (clientData, interp, objc, objv) + ClientData clientData; + Tcl_Interp *interp; + int objc; + Tcl_Obj *CONST objv[]; +{ + char * args; + + if (objc != 2) + { + Tcl_AppendResult (interp, "wrong # of args: should be \"", + Tcl_GetStringFromObj (objv[0], NULL), + " function:line|function|line|*addr\""); + return TCL_ERROR; + } + + args = Tcl_GetStringFromObj (objv[1], NULL); + + Tcl_SetObjResult (interp, Tcl_NewIntObj (tracepoint_exists (args))); + return TCL_OK; +} + +/* Return the prompt to the interpreter */ +static int +gdb_prompt_command (clientData, interp, objc, objv) + ClientData clientData; + Tcl_Interp *interp; + int objc; + Tcl_Obj *CONST objv[]; +{ + Tcl_SetResult (interp, get_prompt (), TCL_VOLATILE); + return TCL_OK; +} + /* Come here during initialize_all_files () */ void diff --git a/gdb/top.c b/gdb/top.c index cc1a1daca8b..d8fd7da756f 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -2813,8 +2813,8 @@ print_gdb_version (stream) fprintf_filtered (stream, "\ GDB is free software, covered by the GNU General Public License, and you are\n\ welcome to change it and/or distribute copies of it under certain conditions.\n\ -Type \"show copying\" to see the conditions.\n\ -There is absolutely no warranty for GDB. Type \"show warranty\" for details.\n"); +Type \"show copying\" to see the conditions. This version of GDB is supported This version of GDB is supported\n\ +for customers of Cygnus Solutions. Type \"show warranty\" for details.\n"); /* After the required info we print the configuration information. */ @@ -2851,9 +2851,41 @@ print_prompt () printf_unfiltered ("%s", prompt); gdb_flush (gdb_stdout); } + +/* This replaces the above for the frontends: it returns a pointer + to the prompt. */ +char * +get_prompt () +{ + return prompt; +} +/* If necessary, make the user confirm that we should quit. Return + non-zero if we should quit, zero if we shouldn't. */ + +int +quit_confirm () +{ + if (inferior_pid != 0 && target_has_execution) + { + char *s; + + if (attach_flag) + s = "The program is running. Quit anyway (and detach it)? "; + else + s = "The program is running. Exit anyway? "; + + if (! query (s)) + return 0; + } + + return 1; +} + +/* Quit without asking for confirmation. */ + void -quit_command (args, from_tty) +quit_force (args, from_tty) char *args; int from_tty; { @@ -2871,20 +2903,11 @@ quit_command (args, from_tty) if (inferior_pid != 0 && target_has_execution) { if (attach_flag) - { - if (query ("The program is running. Quit anyway (and detach it)? ")) - target_detach (args, from_tty); - else - error ("Not confirmed."); - } + target_detach (args, from_tty); else - { - if (query ("The program is running. Quit anyway (and kill it)? ")) - target_kill (); - else - error ("Not confirmed."); - } + target_kill (); } + /* UDI wants this, to kill the TIP. */ target_close (1); @@ -2897,6 +2920,18 @@ quit_command (args, from_tty) exit (exit_code); } +/* Handle the quit command. */ + +void +quit_command (args, from_tty) + char *args; + int from_tty; +{ + if (! quit_confirm ()) + error ("Not confirmed."); + quit_force (args, from_tty); +} + /* Returns whether GDB is running on a terminal and whether the user desires that questions be asked of them on that terminal. */ diff --git a/gdb/top.h b/gdb/top.h index f9977507998..f60d926cae4 100644 --- a/gdb/top.h +++ b/gdb/top.h @@ -39,7 +39,10 @@ extern void cd_command PARAMS ((char *, int)); extern void read_command_file PARAMS ((FILE *)); extern void init_history PARAMS ((void)); extern void command_loop PARAMS ((void)); +extern int quit_confirm PARAMS ((void)); +extern void quit_force PARAMS ((char *, int)); extern void quit_command PARAMS ((char *, int)); +extern char *get_prompt PARAMS((void)); /* From random places. */ extern int mapped_symbol_files; diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 15f5394fc45..2c046c70d4d 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -292,10 +292,16 @@ set_raw_tracepoint (sal) t->source_file = NULL; else { + char *p; + t->source_file = (char *) xmalloc (strlen (sal.symtab->filename) + - strlen (sal.symtab->dirname) + 1); + strlen (sal.symtab->dirname) + 2); strcpy (t->source_file, sal.symtab->dirname); + p = t->source_file; + while (*p++) ; + if (*p != '/') /* Will this work on Windows? */ + strcat (t->source_file, "/"); strcat (t->source_file, sal.symtab->filename); }