From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27306 invoked by alias); 27 Aug 2002 23:28:24 -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 27126 invoked from network); 27 Aug 2002 23:28:21 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 27 Aug 2002 23:28:21 -0000 Received: from ges.redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id A57393C40; Tue, 27 Aug 2002 19:28:19 -0400 (EDT) Message-ID: <3D6C0B13.8070605@ges.redhat.com> Date: Tue, 27 Aug 2002 16:37:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020824 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Grace Sainsbury Cc: gdb-patches@sources.redhat.com, insight@sources.redhat.com Subject: Re: [rfa] rename insight to insight References: <20020826142957.A24152@tomago.toronto.redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-08/txt/msg00926.txt.bz2 Some tweaks, Anything in the gdbtk sub-directory isn't my problem -- Keith has already approved it. > Index: Makefile.in > =================================================================== > RCS file: /cvs/src/src/gdb/Makefile.in,v > retrieving revision 1.249 > diff -u -r1.249 Makefile.in > --- Makefile.in 25 Aug 2002 21:43:05 -0000 1.249 > +++ Makefile.in 26 Aug 2002 18:25:23 -0000 > @@ -868,7 +868,7 @@ > .c.o: > $(CC) -c $(INTERNAL_CFLAGS) $< > > -all: gdb$(EXEEXT) $(CONFIG_ALL) > +all: insight$(EXEEXT) gdb$(EXEEXT) $(CONFIG_ALL) > @$(MAKE) $(FLAGS_TO_PASS) DO=all "DODIRS=`echo $(SUBDIRS) | sed 's/testsuite//'`" subdir_do Have a look at the SUBDIR_GDBTK_... variables. That way insight/gdbtk is more like a plug-in. (we're (Red Hat) trying to remove gdbtk references from gdb/Makefile.in). > installcheck: > @@ -898,28 +898,46 @@ > # install-only is intended to address that need. > install: all install-only > install-only: $(CONFIG_INSTALL) > - transformed_name=`t='$(program_transform_name)'; \ > + $(srcdir)/../mkinstalldirs $(bindir) ; \ > + transformed_name_gdb=`t='$(program_transform_name)'; \ > echo gdb | sed -e $$t` ; \ > - if test "x$$transformed_name" = x; then \ > - transformed_name=gdb ; \ > + if test "x$$transformed_name_gdb" = x; then \ > + transformed_name_gdb=gdb ; \ > + else \ > + true ; \ > + fi ; \ This can be moved to a separate install-gdbtk target (hmm, yes there is already one). > + if test -d "${srcdir}/gdbtk" ; then \ > + transformed_name_insight=`t='$(program_transform_name)'; \ > + echo insight | sed -e $$t` ; \ > + if test "x$$transformed_name_insight" = x; then \ > + transformed_name_insight=insight ; \ > 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) insight$(EXEEXT) $(bindir)/$$transformed_name_insight$(EXEEXT) ; \ > + fi; \ > + $(INSTALL_PROGRAM) gdb$(EXEEXT) $(bindir)/$$transformed_name_gdb$(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 \ > + if test "x$$transformed_name_gdb" = x; then \ > transformed_name=gdb ; \ > else \ > true ; \ > fi ; \ > - rm -f $(bindir)/$$transformed_name$(EXEEXT) $(man1dir)/$$transformed_name.1 This can be moved to uninstall-gdbtk: > + rm -f $(bindir)/$$transformed_name_gdb$(EXEEXT) $(man1dir)/$$transformed_name.1 > + transformed_name_insight=`t='$(program_transform_name)'; \ > + echo insight | sed -e $$t` ; \ > + if test "x$$transformed_name_insight" = x; then \ > + transformed_name_insight=insight ; \ > + else \ > + true ; \ > + fi ; \ > + rm -f $(bindir)/$$transformed_name_insight$(EXEEXT) $(man1dir)/$$transformed_name.1 > rm -rf $(GDBTK_LIBRARY) > @$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do > > @@ -1008,12 +1026,22 @@ > init.o: init.c $(defs_h) $(call_cmds_h) Yes. > # 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) Per keith's coments, move it to the same block as install-gdbtk. > +# Removing the old gdb first works better if it is running, at least on SunOS. > +# Only make the insight executable if gdbtk is available. > +insight$(EXEEXT): insight.o main.o libgdb.a $(CONFIG_OBS) $(ADD_DEPS) $(CDEPS) $(TDEPLIBS) > + rm -f insight$(EXEEXT) > + if [ -d "${srcdir}/gdbtk" ] ; then \ > + $(HLDENV) $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) -o insight$(EXEEXT) \ > + insight.o libgdb.a main.o $(CONFIG_OBS) $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS)\ > + $(LOADLIBES) ; \ > + fi ; > + > nlm: force > rootme=`pwd`; export rootme; $(MAKE) $(TARGET_FLAGS_TO_PASS) DO=all DODIRS=nlm subdir_do > > @@ -1106,6 +1134,7 @@ > rm -f init.c version.c > rm -f gdb$(EXEEXT) core make.log > rm -f gdb[0-9]$(EXEEXT) This can be made part of clean-gdbtk: > + 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 > @@ -1724,6 +1753,8 @@ > $(language_h) $(gdb_string_h) $(readline_headers) $(remote_h) \ > $(linespec_h) $(regcache_h) $(completer_h) Ok, > +gdb.o: gdb.c main.o $(defs_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) \ > $(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(gdbthread_h) \ > @@ -1753,7 +1784,7 @@ > > gnu-v3-abi.o: gnu-v3-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(demangle_h) \ > $(gdb_assert_h) $(gdb_string_h) > - > + > h8300-tdep.o: h8300-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(dis_asm_h) \ > $(gdbcmd_h) $(gdbtypes_h) $(gdbcore_h) $(gdb_string_h) $(value_h) \ > $(regcache_h) > @@ -1854,6 +1885,8 @@ > > inftarg.o: inftarg.c $(gdb_wait_h) $(defs_h) $(gdbcore_h) $(inferior_h) \ > $(target_h) $(terminal_h) $(command_h) This one can be moved to the gdbtk section of the makefile. > +/* from main.c */ > +extern int captured_main (void *); > + > +struct captured_main_args > + { > + int argc; > + char **argv; Extern's shouldn't be in .c files. What about instead creating a "main.h" file (for want of a better name) that contains: struct captured_main_args { ... /* Make use_windows a parameter for when someone eventually manages to make it local or static or even delete it. */ int use_windows; }; extern int gdb_main (struct captured_main_args *args); and then have gdb_main() (in main.c) do the captured call? It would reduce gdb.c to: main(argv, argc) { struct captured_main_args args; /* For when it changes size. */ memset (&args, 0, sizeof args); args.... = .. return gdb_main (&args); } The less things that know about that captured call around main, the better :-) Another option would have been to have ``gdb_main (argc, argv, use_windows)'' but that will break the moment someone adds another startup parameter :-(. BTW, someone is going to eventually end up going through the code and rationalizing interpreter_p and use_windows. That, however, is another separate problem -- here I assume the major objective is to just get the basic build/install framework in place. Oh, and thanks! This is on one of those very long overdue to do lists. Andrew