]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2002-09-28 Andrew Cagney <ac131313@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Sat, 28 Sep 2002 15:10:34 +0000 (15:10 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sat, 28 Sep 2002 15:10:34 +0000 (15:10 +0000)
Import from mainline:

From Grace Sainsbury <graces@redhat.com>:
* Makefile.in (gdbtk-main.o): New target.
(gdb.o): New target.
(main_h): Define.
(main.o): Update dependencies.
(gdb$(EXEEXT)): Add gdb.o.
(SUBDIR_GDBTK_SRCS): Add gdbtk-main.c.
(SUBDIR_GDBTK_ALL, SUBDIR_GDBTK_UNINSTALL): Set.
(SUBDIR_GDBTK_CLEAN): Set.
(install-gdbtk): Install the insight binary.
(uninstall-gdbtk): New target.
(all-gdbtk, clean-gdbtk): New rule.
* top.c (use_windows): Default to zero.
* main.c: Include "main.h".
(main): Delete.
(struct captured_main_args): Delete.
(gdb_main): New function.
* main.h: New file.
* gdb.c: New File.

Index: gdbtk/ChangeLog
2002-09-26  Andrew Cagney  <ac131313@redhat.com>

Import from mainline:

From Grace Sainsbury <graces@redhat.com>:
* generic/gdbtk-main.c: New file.

Index: testsuite/gdb.gdbtk/ChangeLog
2002-09-28  Andrew Cagney  <ac131313@redhat.com>

Import from mainline:
2002-09-26  Keith Seitz  <keiths@redhat.com>
        * lib/insight-support.exp (gdbtk_start): Figure out where
        the insight executable is based on where gdb is. Use this
        executable to start insight instead of gdb.

gdb/ChangeLog
gdb/Makefile.in
gdb/main.c
gdb/testsuite/lib/insight-support.exp
gdb/top.c

index dddac765ad94dabef75fa12737d78c86c52dce4e..46755aea694d469e78be39fd703765916d93b32d 100644 (file)
@@ -1,3 +1,27 @@
+2002-09-28  Andrew Cagney  <ac131313@redhat.com>
+
+       Import from mainline:
+
+       From Grace Sainsbury <graces@redhat.com>:
+       * Makefile.in (gdbtk-main.o): New target.
+       (gdb.o): New target.
+       (main_h): Define.
+       (main.o): Update dependencies.
+       (gdb$(EXEEXT)): Add gdb.o.
+       (SUBDIR_GDBTK_SRCS): Add gdbtk-main.c.
+       (SUBDIR_GDBTK_ALL, SUBDIR_GDBTK_UNINSTALL): Set.
+       (SUBDIR_GDBTK_CLEAN): Set.
+       (install-gdbtk): Install the insight binary.
+       (uninstall-gdbtk): New target.
+       (all-gdbtk, clean-gdbtk): New rule.
+       * top.c (use_windows): Default to zero.
+       * main.c: Include "main.h".
+       (main): Delete.
+       (struct captured_main_args): Delete.
+       (gdb_main): New function.
+       * main.h: New file.
+       * gdb.c: New File.
+
 2002-09-03  Andrew Cagney  <ac131313@redhat.com>
 
        * frame.c: Include "gdb_string.h" and "builtin-regs.h".
index 45739e3ab2c4f2bc7cdb75367677adb776cd938f..d56dc1569a078e15d491fc8299149e5b73584867 100644 (file)
@@ -287,16 +287,17 @@ SUBDIR_GDBTK_SRCS = \
        gdbtk/generic/gdbtk.c gdbtk/generic/gdbtk-bp.c \
        gdbtk/generic/gdbtk-cmds.c gdbtk/generic/gdbtk-hooks.c \
        gdbtk/generic/gdbtk-register.c gdbtk/generic/gdbtk-stack.c \
-       gdbtk/generic/gdbtk-varobj.c gdbtk/generic/gdbtk-wrapper.c
+       gdbtk/generic/gdbtk-varobj.c gdbtk/generic/gdbtk-wrapper.c \
+       gdbtk/generic/gdbtk-main.c
 SUBDIR_GDBTK_DEPS = \
        $(LIBGUI) $(ITCL_DEPS) $(ITK_DEPS) $(TIX_DEPS) $(TK_DEPS) $(TCL_DEPS)
 SUBDIR_GDBTK_INITS = gdbtk/generic/gdbtk.c
 SUBDIR_GDBTK_LDFLAGS=
 SUBDIR_GDBTK_CFLAGS= -DGDBTK
-SUBDIR_GDBTK_ALL=
-SUBDIR_GDBTK_CLEAN=
+SUBDIR_GDBTK_ALL= all-gdbtk
+SUBDIR_GDBTK_CLEAN= clean-gdbtk
 SUBDIR_GDBTK_INSTALL= install-gdbtk
-SUBDIR_GDBTK_UNINSTALL= 
+SUBDIR_GDBTK_UNINSTALL= uninstall-gdbtk
 
 CONFIG_OBS= @CONFIG_OBS@
 CONFIG_LIB_OBS= @CONFIG_LIB_OBS@
@@ -673,6 +674,7 @@ m2_lang_h = m2-lang.h
 macroexp_h = macroexp.h
 macroscope_h = macroscope.h $(macrotab_h) $(symtab_h)
 macrotab_h = macrotab.h
+main_h = main.h
 memattr_h = memattr.h
 minimon_h = minimon.h
 mipsnbsd_tdep_h = mipsnbsd-tdep.h
@@ -920,25 +922,8 @@ uninstall: force $(CONFIG_UNINSTALL)
                  true ; \
                fi ; \
                rm -f $(bindir)/$$transformed_name$(EXEEXT) $(man1dir)/$$transformed_name.1
-       rm -rf $(GDBTK_LIBRARY)
        @$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do 
 
-install-gdbtk:
-       $(SHELL) $(srcdir)/../mkinstalldirs $(GDBTK_LIBRARY) ; \
-       $(SHELL) $(srcdir)/../mkinstalldirs $(libdir)/insight$(GDBTK_VERSION) ; \
-       $(INSTALL_DATA) $(srcdir)/gdbtk/plugins/plugins.tcl $(libdir)/insight$(GDBTK_VERSION)/plugins.tcl ; \
-       $(SHELL) $(srcdir)/../mkinstalldirs \
-               $(GDBTK_LIBRARY)/images \
-               $(GDBTK_LIBRARY)/images2 ; \
-       $(SHELL) $(srcdir)/../mkinstalldirs $(GDBTK_LIBRARY)/help \
-               $(GDBTK_LIBRARY)/help/images \
-               $(GDBTK_LIBRARY)/help/trace ; \
-       cd $(srcdir)/gdbtk/library ; \
-       for i in *.tcl *.itcl *.ith *.itb images/*.gif images2/*.gif images/icons.txt images2/icons.txt tclIndex help/*.html  help/trace/*.html help/trace/index.toc help/images/*.gif; \
-         do \
-               $(INSTALL_DATA) $$i $(GDBTK_LIBRARY)/$$i ; \
-         done ;
-
 # We do this by grepping through sources.  If that turns out to be too slow,
 # maybe we could just require every .o file to have an initialization routine
 # of a given name (top.o -> _initialize_top, etc.).
@@ -1008,11 +993,11 @@ init.c: $(INIT_FILES)
 init.o: init.c $(defs_h) $(call_cmds_h)
 
 # Removing the old gdb first works better if it is running, at least on SunOS.
-gdb$(EXEEXT): main.o libgdb.a $(CONFIG_OBS) $(ADD_DEPS) $(CDEPS) $(TDEPLIBS)
+gdb$(EXEEXT): gdb.o main.o libgdb.a $(CONFIG_OBS) $(ADD_DEPS) $(CDEPS) $(TDEPLIBS)
        rm -f gdb$(EXEEXT)
-       $(HLDENV) $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) -o gdb$(EXEEXT) \
-       main.o libgdb.a $(CONFIG_OBS) $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS)\
-       $(LOADLIBES)
+       $(HLDENV) $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \
+               -o gdb$(EXEEXT) gdb.o main.o $(CONFIG_OBS) libgdb.a \
+               $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES)
 
 nlm:   force
        rootme=`pwd`; export rootme; $(MAKE) $(TARGET_FLAGS_TO_PASS) DO=all DODIRS=nlm subdir_do
@@ -1678,6 +1663,7 @@ frv-tdep.o: frv-tdep.c $(defs_h) $(inferior_h) $(symfile_h) $(gdbcore_h) \
        $(arch_utils_h) $(regcache_h)
 gcore.o: gcore.c $(defs_h) $(cli_decode_h) $(inferior_h) $(gdbcore_h) \
        $(elf_bfd_h) $(symfile_h) $(objfiles_h)
+gdb.o: gdb.c $(defs_h) $(main_h) $(gdb_string_h)
 gdb-events.o: gdb-events.c $(defs_h) $(gdb_events_h) $(gdbcmd_h)
 gdbarch.o: gdbarch.c $(defs_h) $(arch_utils_h) $(gdbcmd_h) $(inferior_h) \
        $(gdb_string_h) $(symtab_h) $(frame_h) $(inferior_h) $(breakpoint_h) \
@@ -1871,7 +1857,7 @@ macrotab.o: macrotab.c $(defs_h) $(gdb_obstack_h) $(splay_tree_h) \
        $(bcache_h) $(complaints_h)
 main.o: main.c $(defs_h) $(top_h) $(target_h) $(inferior_h) $(symfile_h) \
        $(gdbcore_h) $(getopt_h) $(gdb_stat_h) $(gdb_string_h) \
-       $(event_loop_h) $(ui_out_h)
+       $(event_loop_h) $(ui_out_h) $(main_h)
 maint.o: maint.c $(defs_h) $(command_h) $(gdbcmd_h) $(symtab_h) \
        $(gdbtypes_h) $(demangle_h) $(gdbcore_h) $(expression_h) \
        $(language_h) $(symfile_h) $(objfiles_h) $(value_h) $(cli_decode_h)
@@ -2330,6 +2316,55 @@ cli-utils.o: $(srcdir)/cli/cli-utils.c $(defs_h) $(cli_utils_h)
 # Need to explicitly specify the compile rule as make will do nothing
 # or try to compile the object file into the mi directory.
 
+all-gdbtk: insight$(EXEEXT)
+
+install-gdbtk:
+       transformed_name=`t='$(program_transform_name)'; \
+                 echo insight | sed -e $$t` ; \
+       if test "x$$transformed_name" = x; then \
+         transformed_name=insight ; \
+       else \
+         true ; \
+       fi ; \
+       $(SHELL) $(srcdir)/../mkinstalldirs $(bindir)
+       $(INSTALL_PROGRAM) insight$(EXEEXT) $(bindir)/$$transformed_name$(EXEEXT) ; \
+       $(SHELL) $(srcdir)/../mkinstalldirs $(GDBTK_LIBRARY) ; \
+       $(SHELL) $(srcdir)/../mkinstalldirs $(libdir)/insight$(GDBTK_VERSION) ; \
+       $(INSTALL_DATA) $(srcdir)/gdbtk/plugins/plugins.tcl $(libdir)/insight$(GDBTK_VERSION)/plugins.tcl ; \
+       $(SHELL) $(srcdir)/../mkinstalldirs \
+               $(GDBTK_LIBRARY)/images \
+               $(GDBTK_LIBRARY)/images2 ; \
+       $(SHELL) $(srcdir)/../mkinstalldirs $(GDBTK_LIBRARY)/help \
+               $(GDBTK_LIBRARY)/help/images \
+               $(GDBTK_LIBRARY)/help/trace ; \
+       cd $(srcdir)/gdbtk/library ; \
+       for i in *.tcl *.itcl *.ith *.itb images/*.gif images2/*.gif images/icons.txt images2/icons.txt tclIndex help/*.html  help/trace/*.html help/trace/index.toc help/images/*.gif; \
+         do \
+               $(INSTALL_DATA) $$i $(GDBTK_LIBRARY)/$$i ; \
+         done ;
+
+uninstall-gdbtk:
+       transformed_name=`t='$(program_transform_name)'; \
+                 echo insight | sed -e $$t` ; \
+       if test "x$$transformed_name" = x; then \
+               transformed_name=insight ; \
+       else \
+               true ; \
+       fi ; \
+       rm -f $(bindir)/$$transformed_name$(EXEEXT) ; \
+       rm -rf $(GDBTK_LIBRARY)
+
+clean-gdbtk:
+       rm -f insight$(EXEEXT)
+
+# Removing the old gdb first works better if it is running, at least on SunOS.
+insight$(EXEEXT): gdbtk-main.o main.o libgdb.a $(CONFIG_OBS) $(ADD_DEPS) \
+               $(CDEPS) $(TDEPLIBS)
+       rm -f insight$(EXEEXT)
+       $(HLDENV) $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \
+               -o insight$(EXEEXT) gdbtk-main.o main.o libgdb.a $(CONFIG_OBS)\
+               $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES)
+
 gdbres.o: $(srcdir)/gdbtk/gdb.rc $(srcdir)/gdbtk/gdbtool.ico
        $(WINDRES) --include $(srcdir)/gdbtk $(srcdir)/gdbtk/gdb.rc gdbres.o
 
@@ -2373,6 +2408,12 @@ gdbtk-hooks.o: $(srcdir)/gdbtk/generic/gdbtk-hooks.c \
        $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\
                $(srcdir)/gdbtk/generic/gdbtk-hooks.c -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\"
 
+gdbtk-main.o: $(srcdir)/gdbtk/generic/gdbtk-main.c $(defs_h) $(main_h) \
+       $(gdb_string_h)
+       $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) $(TIX_CFLAGS) \
+       $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\
+               $(srcdir)/gdbtk/generic/gdbtk-main.c -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\"
+
 gdbtk-register.o: $(srcdir)/gdbtk/generic/gdbtk-register.c \
                $(srcdir)/gdbtk/generic/gdbtk.h \
                $(srcdir)/gdbtk/generic/gdbtk-cmds.h \
index 4299817880e428539e0c9f96f6758ce50c395fea..eb88747d19b7fccfb40132468f3d6baf405d3c6f 100644 (file)
@@ -37,6 +37,8 @@
 #include "event-loop.h"
 #include "ui-out.h"
 
+#include "main.h"
+
 /* If nonzero, display time usage both at startup and for each command.  */
 
 int display_time;
@@ -108,12 +110,6 @@ captured_command_loop (void *data)
   return 1;
 }
 
-struct captured_main_args
-  {
-    int argc;
-    char **argv;
-  };
-
 static int
 captured_main (void *data)
 {
@@ -736,12 +732,10 @@ extern int gdbtk_test (char *);
 }
 
 int
-main (int argc, char **argv)
+gdb_main (struct captured_main_args *args)
 {
-  struct captured_main_args args;
-  args.argc = argc;
-  args.argv = argv;
-  catch_errors (captured_main, &args, "", RETURN_MASK_ALL);
+  use_windows = args->use_windows;
+  catch_errors (captured_main, args, "", RETURN_MASK_ALL);
   return 0;
 }
 
index 42d14a9a27a72e4c481edee2d5ca0676237b2485..cbdf163c85f290f2fdced0bab58d1673b79ec34a 100644 (file)
@@ -54,7 +54,15 @@ proc gdbtk_start {test} {
 
   gdb_stop_suppressing_tests;
 
-  verbose "Starting $GDB -nx -q --tclcommand=$test"
+  # Need to convert ::GDB to use (-)?insight...
+  if {[regsub {gdb$} $GDB insight newGDB]} {
+    set INSIGHT $newGDB
+  } else {
+    perror "Cannot find Insight executable"
+    exit 1
+  }
+
+  verbose "Starting $INSIGHT -nx -q --tclcommand=$test"
 
   set real_test [which $test]
   if {$real_test == 0} {
@@ -63,8 +71,8 @@ proc gdbtk_start {test} {
   }
 
   if {![is_remote host]} {
-    if { [which $GDB] == 0 } {
-      perror "$GDB does not exist."
+    if { [which $INSIGHT] == 0 } {
+      perror "$INSIGHT does not exist."
       exit 1
     }
   }
@@ -91,9 +99,9 @@ proc gdbtk_start {test} {
   set env(GDBTK_VERBOSE) 1
   set env(GDBTK_LOGFILE) [to_tcl_path [file join $objdir gdb.log]]
 
-  set err [catch {exec $GDB -nx -q --tclcommand=$test} res]
+  set err [catch {exec $INSIGHT -nx -q --tclcommand=$test} res]
   if { $err } {
-    perror "Execing $GDB failed: $res"
+    perror "Execing $INSIGHT failed: $res"
     append res "\nERROR gdb-crash"
   }
   return $res
index 60c1bf9c3e08e5e7774bd55f4efa99f55e0487c3..3d5783fbe82c9aafb0de6a9d02724c9ea6c1b413 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -82,7 +82,7 @@ int inhibit_gdbinit = 0;
 /* If nonzero, and GDB has been configured to be able to use windows,
    attempt to open them upon startup.  */
 
-int use_windows = 1;
+int use_windows = 0;
 
 extern char lang_frame_mismatch_warn[];                /* language.c */