From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13029 invoked by alias); 4 Sep 2002 21:37:30 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 13018 invoked from network); 4 Sep 2002 21:37:28 -0000 Received: from unknown (HELO tomago.toronto.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 4 Sep 2002 21:37:28 -0000 Received: (from graces@localhost) by tomago.toronto.redhat.com (8.11.6/8.11.6) id g84LbS311947 for gdb-patches@sources.redhat.com; Wed, 4 Sep 2002 17:37:28 -0400 Date: Wed, 04 Sep 2002 14:37:00 -0000 From: Grace Sainsbury To: gdb-patches@sources.redhat.com Subject: insight rename patch Message-ID: <20020904173728.A11943@tomago.toronto.redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="+HP7ph2BbKc20aGI" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-SW-Source: 2002-09/txt/msg00059.txt.bz2 --+HP7ph2BbKc20aGI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 472 Here is the patch modified as suggested. ok to commit? grace 2002-09-04 Grace Sainsbury * top.c: Set use_windows to default to zero. * main.c: Move main function to insight.c, gdb.c (gdb_main): New function. * main.h: New file. * insight.c: New File. * gdb.c: New File. * Makefile.in: Add rules for gdb.o, insight.o and * insight. Change gdbtk-install, gdbtk-uninstall, and GDBTK_ALL to reflect this. --+HP7ph2BbKc20aGI Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="insight.diff" Content-length: 10391 Index: Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/Makefile.in,v retrieving revision 1.257 diff -u -r1.257 Makefile.in --- Makefile.in 2 Sep 2002 18:09:06 -0000 1.257 +++ Makefile.in 4 Sep 2002 21:36:20 -0000 @@ -287,16 +287,17 @@ 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/insight-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_ALL= insight$(EXEEXT) SUBDIR_GDBTK_CLEAN= 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 @@ 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 @@ -868,7 +870,7 @@ .c.o: $(CC) -c $(INTERNAL_CFLAGS) $< -all: gdb$(EXEEXT) $(CONFIG_ALL) +all: gdb$(EXEEXT) $(CONFIG_ALL) @$(MAKE) $(FLAGS_TO_PASS) DO=all "DODIRS=`echo $(SUBDIRS) | sed 's/testsuite//'`" subdir_do installcheck: @@ -898,6 +900,7 @@ # install-only is intended to address that need. install: all install-only install-only: $(CONFIG_INSTALL) + $(srcdir)/../mkinstalldirs $(bindir) ; \ transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e $$t` ; \ if test "x$$transformed_name" = x; then \ @@ -905,25 +908,31 @@ else \ true ; \ fi ; \ - $(srcdir)/../mkinstalldirs $(bindir) ; \ - $(INSTALL_PROGRAM) gdb$(EXEEXT) $(bindir)/$$transformed_name$(EXEEXT) ; \ - $(srcdir)/../mkinstalldirs $(man1dir) ; \ - $(INSTALL_DATA) $(srcdir)/gdb.1 $(man1dir)/$$transformed_name.1 + $(INSTALL_PROGRAM) gdb$(EXEEXT) $(bindir)/$$transformed_name$(EXEEXT) ; \ + $(srcdir)/../mkinstalldirs $(man1dir) ; \ + $(INSTALL_DATA) $(srcdir)/gdb.1 $(man1dir)/$$transformed_name.1 @$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do uninstall: force $(CONFIG_UNINSTALL) - transformed_name=`t='$(program_transform_name)'; \ + transformed_name_gdb=`t='$(program_transform_name)'; \ echo gdb | sed -e $$t` ; \ if test "x$$transformed_name" = x; then \ transformed_name=gdb ; \ else \ true ; \ fi ; \ - rm -f $(bindir)/$$transformed_name$(EXEEXT) $(man1dir)/$$transformed_name.1 - rm -rf $(GDBTK_LIBRARY) + rm -f $(bindir)/$$transformed_name_gdb$(EXEEXT) $(man1dir)/$$transformed_name.1 @$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do 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 ; \ + $(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 ; \ @@ -939,6 +948,17 @@ $(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) + # 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,10 +1028,10 @@ 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)\ + gdb.o libgdb.a main.o $(CONFIG_OBS) $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS)\ $(LOADLIBES) nlm: force @@ -1106,6 +1126,7 @@ rm -f init.c version.c rm -f gdb$(EXEEXT) core make.log rm -f gdb[0-9]$(EXEEXT) + rm -f insight$(EXEEXT) # This used to depend on c-exp.tab.c m2-exp.tab.c TAGS # I believe this is wrong; the makefile standards for distclean just @@ -1678,6 +1699,7 @@ $(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 main.o $(defs_h) $(main_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) \ @@ -2330,6 +2352,14 @@ # Need to explicitly specify the compile rule as make will do nothing # or try to compile the object file into the mi directory. + +# Removing the old gdb first works better if it is running, at least on SunOS. +insight$(EXEEXT): insight-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) \ + insight-main.o libgdb.a main.o $(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 @@ -2404,6 +2434,8 @@ $(defs_h) $(frame_h) $(value_h) $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(GDBTK_CFLAGS)\ $(srcdir)/gdbtk/generic/gdbtk-wrapper.c + +insight-main.o: $(srcdir)/gdbtk/generic/insight-main.c main.o $(defs_h) $(main_h) # # gdb/mi/ dependencies Index: gdb.c =================================================================== RCS file: gdb.c diff -N gdb.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gdb.c 4 Sep 2002 21:36:20 -0000 @@ -0,0 +1,32 @@ +/* Main function for CLI gdb. + Copyright 2002 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "main.h" + +int +main (int argc, char **argv) +{ + struct captured_main_args args; + args.argc = argc; + args.argv = argv; + args.use_windows = 0; + return gdb_main (&args); +} Index: main.c =================================================================== RCS file: /cvs/src/src/gdb/main.c,v retrieving revision 1.18 diff -u -r1.18 main.c --- main.c 25 Jun 2002 05:35:16 -0000 1.18 +++ main.c 4 Sep 2002 21:36:21 -0000 @@ -112,6 +112,7 @@ { int argc; char **argv; + int use_windows; }; static int @@ -735,11 +736,9 @@ } int -main (int argc, char **argv) +gdb_main (struct captured_main_args *args) { - struct captured_main_args args; - args.argc = argc; - args.argv = argv; + use_windows = args->use_windows; catch_errors (captured_main, &args, "", RETURN_MASK_ALL); return 0; } Index: main.h =================================================================== RCS file: main.h diff -N main.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ main.h 4 Sep 2002 21:36:21 -0000 @@ -0,0 +1,13 @@ +#ifndef MAIN_H +#define MAIN_H + +struct captured_main_args +{ + int argc; + char **argv; + int use_windows; +}; + +int gdb_main (struct captured_main_args *); + +#endif Index: top.c =================================================================== RCS file: /cvs/src/src/gdb/top.c,v retrieving revision 1.66 diff -u -r1.66 top.c --- top.c 18 Aug 2002 12:39:03 -0000 1.66 +++ top.c 4 Sep 2002 21:36:22 -0000 @@ -82,7 +82,7 @@ /* 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 */ Index: gdbtk/generic/insight-main.c =================================================================== RCS file: gdbtk/generic/insight-main.c diff -N gdbtk/generic/insight-main.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gdbtk/generic/insight-main.c 4 Sep 2002 21:36:22 -0000 @@ -0,0 +1,33 @@ +/* Main function for gdb with insight. + Copyright 2002 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + +#include "defs.h" +#include "main.h" + +int +main (int argc, char **argv) +{ + struct captured_main_args args; + args.argc = argc; + args.argv = argv; + args.use_windows = 1; + return gdb_main (args); +} --+HP7ph2BbKc20aGI--