Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfa] rename insight to insight
@ 2002-08-26 11:36 Grace Sainsbury
  2002-08-26 12:36 ` Keith Seitz
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Grace Sainsbury @ 2002-08-26 11:36 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 481 bytes --]

I changed the Makefile to make two independent executables (if gdbtk
is available); gdb and insight, where gdb opens in the terminal and
insight starts insight.

ok?

grace

2002-08-26  Grace Sainsbury  <graces@redhat.com>

	* top.c: Set use_windows to default to zero.
	* main.c: Move main function to insight.c, gdb.c
	* insight.c: New File.
	* gdb.c: New File.
	* Makefile.in: Add rules for gdb.o, insight.o and insight. Change
	all, install and clean rules to include insight.

[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 9580 bytes --]

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
 
 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 ; \
+	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
+		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)
 
 # 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)
 
+# 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)
+	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)
 
+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)
+
+insight.o: insight.c main.o $(defs_h)
 
 irix4-nat.o: irix4-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(regcache_h)
 irix5-nat.o: irix5-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(target_h) \
Index: gdb.c
===================================================================
RCS file: gdb.c
diff -N gdb.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gdb.c	26 Aug 2002 18:25:23 -0000
@@ -0,0 +1,41 @@
+/* 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"
+
+/* from main.c  */
+extern int captured_main (void *);
+
+struct captured_main_args
+  {
+    int argc;
+    char **argv;
+  };
+
+int
+main (int argc, char **argv)
+{
+  struct captured_main_args args;
+  args.argc = argc;
+  args.argv = argv;
+  use_windows = 0;
+  catch_errors (captured_main, &args, "", RETURN_MASK_ALL);
+  return 0;
+}
Index: insight.c
===================================================================
RCS file: insight.c
diff -N insight.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ insight.c	26 Aug 2002 18:25:23 -0000
@@ -0,0 +1,41 @@
+/* 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"
+
+/* from main.c  */
+extern int captured_main (void *);
+
+struct captured_main_args
+  {
+    int argc;
+    char **argv;
+  };
+
+int
+main (int argc, char **argv)
+{
+  struct captured_main_args args;
+  args.argc = argc;
+  args.argv = argv;
+  use_windows = 1;
+  catch_errors (captured_main, &args, "", RETURN_MASK_ALL);
+  return 0;
+}
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	26 Aug 2002 18:25:23 -0000
@@ -114,7 +114,7 @@
     char **argv;
   };
 
-static int
+int
 captured_main (void *data)
 {
   struct captured_main_args *context = data;
@@ -734,15 +734,15 @@
   /* No exit -- exit is through quit_command.  */
 }
 
-int
-main (int argc, char **argv)
-{
-  struct captured_main_args args;
-  args.argc = argc;
-  args.argv = argv;
-  catch_errors (captured_main, &args, "", RETURN_MASK_ALL);
-  return 0;
-}
+/*  int */
+/*  main (int argc, char **argv) */
+/*  { */
+/*    struct captured_main_args args; */
+/*    args.argc = argc; */
+/*    args.argv = argv; */
+/*    catch_errors (captured_main, &args, "", RETURN_MASK_ALL); */
+/*    return 0; */
+/*  } */
 
 
 /* Don't use *_filtered for printing help.  We don't want to prompt
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	26 Aug 2002 18:25:24 -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 */
 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [rfa] rename insight to insight
  2002-08-26 11:36 [rfa] rename insight to insight Grace Sainsbury
@ 2002-08-26 12:36 ` Keith Seitz
  2002-08-27  8:16   ` Grace Sainsbury
  2002-08-26 13:13 ` Kevin Buettner
  2002-08-27 16:37 ` Andrew Cagney
  2 siblings, 1 reply; 9+ messages in thread
From: Keith Seitz @ 2002-08-26 12:36 UTC (permalink / raw)
  To: Grace Sainsbury; +Cc: gdb-patches

On Mon, 26 Aug 2002, Grace Sainsbury wrote:

> 2002-08-26  Grace Sainsbury  <graces@redhat.com>
> 
> 	* top.c: Set use_windows to default to zero.
> 	* main.c: Move main function to insight.c, gdb.c
> 	* insight.c: New File.
> 	* gdb.c: New File.
> 	* Makefile.in: Add rules for gdb.o, insight.o and insight. Change
> 	all, install and clean rules to include insight.

Recommendation:

Move "insight.c" into gdbtk/generic (call it insight-main.c or something) 
and move the Makefile fragments next to the other insight-related files 
(look for all the gdbtk-*.o files). This way we make an attempt at keeping 
insight/gdb cross-contamination to a minimum. We're slowly working toward 
putting all the insight stuff in gdb/gdbtk/, but we've still a little work 
to do (and your patch is a good first step at the most troublesome piece).

Otherwise, I certainly welcome this change (which is far too overdue). Now 
we only need to straighten out the arg parsing stuff and the init.c stuff, 
and we'll be set! ;-)

Keith


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [rfa] rename insight to insight
  2002-08-26 11:36 [rfa] rename insight to insight Grace Sainsbury
  2002-08-26 12:36 ` Keith Seitz
@ 2002-08-26 13:13 ` Kevin Buettner
  2002-08-27  7:29   ` Grace Sainsbury
  2002-08-27 16:37 ` Andrew Cagney
  2 siblings, 1 reply; 9+ messages in thread
From: Kevin Buettner @ 2002-08-26 13:13 UTC (permalink / raw)
  To: Grace Sainsbury, gdb-patches

On Aug 26,  2:29pm, Grace Sainsbury wrote:

> -int
> -main (int argc, char **argv)
> -{
> -  struct captured_main_args args;
> -  args.argc = argc;
> -  args.argv = argv;
> -  catch_errors (captured_main, &args, "", RETURN_MASK_ALL);
> -  return 0;
> -}
> +/*  int */
> +/*  main (int argc, char **argv) */
> +/*  { */
> +/*    struct captured_main_args args; */
> +/*    args.argc = argc; */
> +/*    args.argv = argv; */
> +/*    catch_errors (captured_main, &args, "", RETURN_MASK_ALL); */
> +/*    return 0; */
> +/*  } */

I think you might was well remove main() entirely instead of
preserving it in a commented out form.  If there's a real need to
preserve it for a time, I think using #if 0 ...  #endif is preferable.

Kevin


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [rfa] rename insight to insight
  2002-08-26 13:13 ` Kevin Buettner
@ 2002-08-27  7:29   ` Grace Sainsbury
  0 siblings, 0 replies; 9+ messages in thread
From: Grace Sainsbury @ 2002-08-27  7:29 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches

On Mon, Aug 26, 2002 at 01:13:03PM -0700, Kevin Buettner wrote:
> On Aug 26,  2:29pm, Grace Sainsbury wrote:
> 
> > -int
> > -main (int argc, char **argv)
> > -{
> > -  struct captured_main_args args;
> > -  args.argc = argc;
> > -  args.argv = argv;
> > -  catch_errors (captured_main, &args, "", RETURN_MASK_ALL);
> > -  return 0;
> > -}
> > +/*  int */
> > +/*  main (int argc, char **argv) */
> > +/*  { */
> > +/*    struct captured_main_args args; */
> > +/*    args.argc = argc; */
> > +/*    args.argv = argv; */
> > +/*    catch_errors (captured_main, &args, "", RETURN_MASK_ALL); */
> > +/*    return 0; */
> > +/*  } */
> 
> I think you might was well remove main() entirely instead of
> preserving it in a commented out form.  If there's a real need to
> preserve it for a time, I think using #if 0 ...  #endif is preferable.
> 
> Kevin

I'll get rid of it -- I forgot that I hadn't removed it already.

grace


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [rfa] rename insight to insight
  2002-08-26 12:36 ` Keith Seitz
@ 2002-08-27  8:16   ` Grace Sainsbury
  2002-08-27  9:14     ` Keith Seitz
  0 siblings, 1 reply; 9+ messages in thread
From: Grace Sainsbury @ 2002-08-27  8:16 UTC (permalink / raw)
  To: Keith Seitz; +Cc: gdb-patches

On Mon, Aug 26, 2002 at 12:06:55PM -0700, Keith Seitz wrote:
> 
> Recommendation:
> 
> Move "insight.c" into gdbtk/generic (call it insight-main.c or something) 
> and move the Makefile fragments next to the other insight-related files 
> (look for all the gdbtk-*.o files). This way we make an attempt at keeping 
> insight/gdb cross-contamination to a minimum. We're slowly working toward 
> putting all the insight stuff in gdb/gdbtk/, but we've still a little work 
> to do (and your patch is a good first step at the most troublesome piece).
> 
> Otherwise, I certainly welcome this change (which is far too overdue). Now 
> we only need to straighten out the arg parsing stuff and the init.c stuff, 
> and we'll be set! ;-)
> 
> Keith
> 

done.

grace

is it ok to commit?


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [rfa] rename insight to insight
  2002-08-27  8:16   ` Grace Sainsbury
@ 2002-08-27  9:14     ` Keith Seitz
  2002-08-29  8:42       ` Elena Zannoni
  0 siblings, 1 reply; 9+ messages in thread
From: Keith Seitz @ 2002-08-27  9:14 UTC (permalink / raw)
  To: Grace Sainsbury; +Cc: gdb-patches

On Tue, 27 Aug 2002, Grace Sainsbury wrote:

> is it ok to commit?

You may certainly check-in anything that I can approve (anything in 
gdb/gdbtk and insight build/configury/testsuite).

Keith


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [rfa] rename insight to insight
  2002-08-26 11:36 [rfa] rename insight to insight Grace Sainsbury
  2002-08-26 12:36 ` Keith Seitz
  2002-08-26 13:13 ` Kevin Buettner
@ 2002-08-27 16:37 ` Andrew Cagney
  2002-08-28 13:31   ` Grace Sainsbury
  2 siblings, 1 reply; 9+ messages in thread
From: Andrew Cagney @ 2002-08-27 16:37 UTC (permalink / raw)
  To: Grace Sainsbury; +Cc: gdb-patches, insight

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [rfa] rename insight to insight
  2002-08-27 16:37 ` Andrew Cagney
@ 2002-08-28 13:31   ` Grace Sainsbury
  0 siblings, 0 replies; 9+ messages in thread
From: Grace Sainsbury @ 2002-08-28 13:31 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 66 bytes --]


Here is the fixed patch of the Makefile.

ok to commit ?

grace


[-- Attachment #2: make.patch --]
[-- Type: text/plain, Size: 6006 bytes --]

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.252
diff -u -r1.252 Makefile.in
--- Makefile.in	28 Aug 2002 14:02:18 -0000	1.252
+++ Makefile.in	28 Aug 2002 18:49:43 -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@
@@ -868,7 +869,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 +899,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 +907,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 +947,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 +1027,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 +1125,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 +1698,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)
 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) \
@@ -2328,6 +2349,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
 
@@ -2402,6 +2431,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)
 
 #
 # gdb/mi/ dependencies

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [rfa] rename insight to insight
  2002-08-27  9:14     ` Keith Seitz
@ 2002-08-29  8:42       ` Elena Zannoni
  0 siblings, 0 replies; 9+ messages in thread
From: Elena Zannoni @ 2002-08-29  8:42 UTC (permalink / raw)
  To: Grace Sainsbury; +Cc: gdb-patches

Keith Seitz writes:
 > On Tue, 27 Aug 2002, Grace Sainsbury wrote:
 > 
 > > is it ok to commit?
 > 
 > You may certainly check-in anything that I can approve (anything in 
 > gdb/gdbtk and insight build/configury/testsuite).
 > 
 > Keith

Ok for top.c/main.c

Elena


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-08-29 15:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-26 11:36 [rfa] rename insight to insight Grace Sainsbury
2002-08-26 12:36 ` Keith Seitz
2002-08-27  8:16   ` Grace Sainsbury
2002-08-27  9:14     ` Keith Seitz
2002-08-29  8:42       ` Elena Zannoni
2002-08-26 13:13 ` Kevin Buettner
2002-08-27  7:29   ` Grace Sainsbury
2002-08-27 16:37 ` Andrew Cagney
2002-08-28 13:31   ` Grace Sainsbury

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox