Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@ges.redhat.com>
To: Grace Sainsbury <graces@redhat.com>
Cc: gdb-patches@sources.redhat.com, insight@sources.redhat.com
Subject: Re: [rfa] rename insight to insight
Date: Tue, 27 Aug 2002 16:37:00 -0000	[thread overview]
Message-ID: <3D6C0B13.8070605@ges.redhat.com> (raw)
In-Reply-To: <20020826142957.A24152@tomago.toronto.redhat.com>

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


  parent reply	other threads:[~2002-08-27 23:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-26 11:36 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 [this message]
2002-08-28 13:31   ` Grace Sainsbury

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D6C0B13.8070605@ges.redhat.com \
    --to=ac131313@ges.redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=graces@redhat.com \
    --cc=insight@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox