* insight rename patch
@ 2002-09-04 14:37 Grace Sainsbury
2002-09-04 14:47 ` Elena Zannoni
2002-09-04 14:59 ` Keith Seitz
0 siblings, 2 replies; 14+ messages in thread
From: Grace Sainsbury @ 2002-09-04 14:37 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 472 bytes --]
Here is the patch modified as suggested.
ok to commit?
grace
2002-09-04 Grace Sainsbury <graces@redhat.com>
* 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.
[-- Attachment #2: insight.diff --]
[-- Type: text/plain, Size: 10391 bytes --]
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);
+}
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: insight rename patch 2002-09-04 14:37 insight rename patch Grace Sainsbury @ 2002-09-04 14:47 ` Elena Zannoni 2002-09-04 14:59 ` Keith Seitz 1 sibling, 0 replies; 14+ messages in thread From: Elena Zannoni @ 2002-09-04 14:47 UTC (permalink / raw) To: Grace Sainsbury; +Cc: gdb-patches Grace Sainsbury writes: > Here is the patch modified as suggested. > > ok to commit? A few comments below on the main/top files. > > grace > > 2002-09-04 Grace Sainsbury <graces@redhat.com> > > * 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. > 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; > }; > There should only be one of struct captured_main_args, in main.h. > 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 *); Should have the 'extern' keyword here. > + > +#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 */ > OK Elena ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: insight rename patch 2002-09-04 14:37 insight rename patch Grace Sainsbury 2002-09-04 14:47 ` Elena Zannoni @ 2002-09-04 14:59 ` Keith Seitz 2002-09-19 19:15 ` 5.3 branch? Was: " Andrew Cagney 1 sibling, 1 reply; 14+ messages in thread From: Keith Seitz @ 2002-09-04 14:59 UTC (permalink / raw) To: Grace Sainsbury; +Cc: gdb-patches On Wed, 4 Sep 2002, Grace Sainsbury wrote: > * insight.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. s/insight-main/insight/g, otherwise, the insight portions of these are (still) approved. Wow, I need to find a bottle of bubbly if this all gets approved. Keith ^ permalink raw reply [flat|nested] 14+ messages in thread
* 5.3 branch? Was: insight rename patch 2002-09-04 14:59 ` Keith Seitz @ 2002-09-19 19:15 ` Andrew Cagney 2002-09-19 19:46 ` Keith Seitz 0 siblings, 1 reply; 14+ messages in thread From: Andrew Cagney @ 2002-09-19 19:15 UTC (permalink / raw) To: Keith Seitz, gdb-patches Does anyone have any thoughts on this main.c -> gdb.c/insight.c change being backported to the 5.3 branch? > On Wed, 4 Sep 2002, Grace Sainsbury wrote: > > >> * insight.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. > > > s/insight-main/insight/g, otherwise, the insight portions of these are > (still) approved. > > Wow, I need to find a bottle of bubbly if this all gets approved. > Keith Did you mean s/insight.c/insight-main.c/? I like ``insight.c'' and ``gdb.c'' :-) Andrew ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: 5.3 branch? Was: insight rename patch 2002-09-19 19:15 ` 5.3 branch? Was: " Andrew Cagney @ 2002-09-19 19:46 ` Keith Seitz 2002-09-25 19:30 ` Andrew Cagney 0 siblings, 1 reply; 14+ messages in thread From: Keith Seitz @ 2002-09-19 19:46 UTC (permalink / raw) To: Andrew Cagney; +Cc: gdb-patches On Thu, 19 Sep 2002, Andrew Cagney wrote: > Does anyone have any thoughts on this main.c -> gdb.c/insight.c change > being backported to the 5.3 branch? Nothing more intelligible than, "it's a good idea." > Did you mean s/insight.c/insight-main.c/? I like ``insight.c'' and > ``gdb.c'' :-) That's okay with me, too. I overlooked the bit about how gdb was getting gdb.c... Keith ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: 5.3 branch? Was: insight rename patch 2002-09-19 19:46 ` Keith Seitz @ 2002-09-25 19:30 ` Andrew Cagney 2002-09-25 19:42 ` Christopher Faylor 2002-09-26 10:48 ` Andrew Cagney 0 siblings, 2 replies; 14+ messages in thread From: Andrew Cagney @ 2002-09-25 19:30 UTC (permalink / raw) To: Keith Seitz; +Cc: Andrew Cagney, gdb-patches [-- Attachment #1: Type: text/plain, Size: 750 bytes --] > On Thu, 19 Sep 2002, Andrew Cagney wrote: > > >> Does anyone have any thoughts on this main.c -> gdb.c/insight.c change >> being backported to the 5.3 branch? > > > Nothing more intelligible than, "it's a good idea." > > >> Did you mean s/insight.c/insight-main.c/? I like ``insight.c'' and >> ``gdb.c'' :-) > > > That's okay with me, too. I overlooked the bit about how gdb was getting > gdb.c... But then I noticed that everything else was called gdbtk-* so I called it gdbtk-main.c (I just couldn't bring myself to being the one that added a file that wasn't gdbtk-* :-). So. My plan is to commit the attached to the trunk in ~12 hours and then the day or so after that commit it to the 5.3 branch.... (holds breath). Andrew [-- Attachment #2: diffs --] [-- Type: text/plain, Size: 13179 bytes --] 2002-09-25 Andrew Cagney <ac131313@redhat.com> 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-25 Andrew Cagney <ac131313@redhat.com> From Grace Sainsbury <graces@redhat.com>: * generic/gdbtk-main.c: New file. Index: Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/Makefile.in,v retrieving revision 1.263 diff -u -r1.263 Makefile.in --- Makefile.in 20 Sep 2002 18:14:49 -0000 1.263 +++ Makefile.in 26 Sep 2002 02:24:52 -0000 @@ -290,16 +290,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/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@ @@ -679,6 +680,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 @@ -929,25 +931,8 @@ 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.). @@ -1017,11 +1002,11 @@ 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 @@ -1691,6 +1676,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 $(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) \ @@ -1884,7 +1870,7 @@ $(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) @@ -2341,6 +2327,55 @@ # 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 @@ -2383,6 +2418,12 @@ $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) $(TIX_CFLAGS) \ $(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 \ Index: gdb.c =================================================================== RCS file: gdb.c diff -N gdb.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gdb.c 26 Sep 2002 02:24:52 -0000 @@ -0,0 +1,34 @@ +/* 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" +#include "gdb_string.h" + +int +main (int argc, char **argv) +{ + struct captured_main_args args; + memset (&args, 0, sizeof 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.19 diff -u -r1.19 main.c --- main.c 25 Sep 2002 03:10:26 -0000 1.19 +++ main.c 26 Sep 2002 02:24:52 -0000 @@ -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 @@ return 1; } -struct captured_main_args - { - int argc; - char **argv; - }; - static int captured_main (void *data) { @@ -736,12 +732,10 @@ } 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: main.h =================================================================== RCS file: main.h diff -N main.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ main.h 26 Sep 2002 02:24:52 -0000 @@ -0,0 +1,34 @@ +/* Main interface for GDB, the GNU debugger. + + 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. */ + +#ifndef MAIN_H +#define MAIN_H + +struct captured_main_args +{ + int argc; + char **argv; + int use_windows; +}; + +extern int gdb_main (struct captured_main_args *); + +#endif Index: top.c =================================================================== RCS file: /cvs/src/src/gdb/top.c,v retrieving revision 1.67 diff -u -r1.67 top.c --- top.c 9 Sep 2002 21:03:26 -0000 1.67 +++ top.c 26 Sep 2002 02:24:52 -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/gdbtk-main.c =================================================================== RCS file: gdbtk/generic/gdbtk-main.c diff -N gdbtk/generic/gdbtk-main.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gdbtk/generic/gdbtk-main.c 26 Sep 2002 02:24:52 -0000 @@ -0,0 +1,36 @@ +/* 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" +#include "gdb_string.h" + +int +main (int argc, char **argv) +{ + struct captured_main_args args; + memset (&args, 0, sizeof args); + args.argc = argc; + args.argv = argv; + args.use_windows = 1; + return gdb_main (&args); +} ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: 5.3 branch? Was: insight rename patch 2002-09-25 19:30 ` Andrew Cagney @ 2002-09-25 19:42 ` Christopher Faylor 2002-09-25 21:27 ` Keith Seitz 2002-09-26 10:48 ` Andrew Cagney 1 sibling, 1 reply; 14+ messages in thread From: Christopher Faylor @ 2002-09-25 19:42 UTC (permalink / raw) To: gdb-patches On Wed, Sep 25, 2002 at 10:30:44PM -0400, Andrew Cagney wrote: >So. My plan is to commit the attached to the trunk in ~12 hours and >then the day or so after that commit it to the 5.3 branch.... And who will buy the champagne at that point? :-) cgf ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: 5.3 branch? Was: insight rename patch 2002-09-25 19:42 ` Christopher Faylor @ 2002-09-25 21:27 ` Keith Seitz 0 siblings, 0 replies; 14+ messages in thread From: Keith Seitz @ 2002-09-25 21:27 UTC (permalink / raw) To: Christopher Faylor; +Cc: gdb-patches On Wed, 25 Sep 2002, Christopher Faylor wrote: > And who will buy the champagne at that point? :-) Doesn't everyone keep a few bottles on hand? O:-) I certainly do... Keith ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: 5.3 branch? Was: insight rename patch 2002-09-25 19:30 ` Andrew Cagney 2002-09-25 19:42 ` Christopher Faylor @ 2002-09-26 10:48 ` Andrew Cagney 2002-09-27 7:49 ` Keith Seitz 1 sibling, 1 reply; 14+ messages in thread From: Andrew Cagney @ 2002-09-26 10:48 UTC (permalink / raw) To: Andrew Cagney; +Cc: Keith Seitz, Andrew Cagney, gdb-patches Committed to HEAD..... > 2002-09-25 Andrew Cagney <ac131313@redhat.com> > > 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-25 Andrew Cagney <ac131313@redhat.com> > > From Grace Sainsbury <graces@redhat.com>: > * generic/gdbtk-main.c: New file. > ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: 5.3 branch? Was: insight rename patch 2002-09-26 10:48 ` Andrew Cagney @ 2002-09-27 7:49 ` Keith Seitz 2002-09-28 8:16 ` Andrew Cagney 0 siblings, 1 reply; 14+ messages in thread From: Keith Seitz @ 2002-09-27 7:49 UTC (permalink / raw) To: gdb-patches On Thu, 26 Sep 2002, Andrew Cagney wrote: > Committed to HEAD..... > > > > Index: gdbtk/ChangeLog > > 2002-09-25 Andrew Cagney <ac131313@redhat.com> > > > > From Grace Sainsbury <graces@redhat.com>: > > * generic/gdbtk-main.c: New file. FYI, I've committed a testsuite cleanup in testsuite/lib/insight-support.exp which will get it to run the "insight" executable instead of gdb. Keith ChangeLog 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. Patch Index: testsuite/lib/insight-support.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/insight-support.exp,v retrieving revision 1.5 diff -p -r1.5 insight-support.exp *** testsuite/lib/insight-support.exp 4 Oct 2001 22:11:12 -0000 1.5 --- testsuite/lib/insight-support.exp 27 Sep 2002 14:47:14 -0000 *************** proc gdbtk_start {test} { *** 54,60 **** gdb_stop_suppressing_tests; ! verbose "Starting $GDB -nx -q --tclcommand=$test" set real_test [which $test] if {$real_test == 0} { --- 54,68 ---- gdb_stop_suppressing_tests; ! # 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} { *************** proc gdbtk_start {test} { *** 63,70 **** } if {![is_remote host]} { ! if { [which $GDB] == 0 } { ! perror "$GDB does not exist." exit 1 } } --- 71,78 ---- } if {![is_remote host]} { ! if { [which $INSIGHT] == 0 } { ! perror "$INSIGHT does not exist." exit 1 } } *************** proc gdbtk_start {test} { *** 91,99 **** 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] if { $err } { ! perror "Execing $GDB failed: $res" append res "\nERROR gdb-crash" } return $res --- 99,107 ---- set env(GDBTK_VERBOSE) 1 set env(GDBTK_LOGFILE) [to_tcl_path [file join $objdir gdb.log]] ! set err [catch {exec $INSIGHT -nx -q --tclcommand=$test} res] if { $err } { ! perror "Execing $INSIGHT failed: $res" append res "\nERROR gdb-crash" } return $res ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: 5.3 branch? Was: insight rename patch 2002-09-27 7:49 ` Keith Seitz @ 2002-09-28 8:16 ` Andrew Cagney 2002-10-03 0:59 ` Problem about " Pierre Muller 0 siblings, 1 reply; 14+ messages in thread From: Andrew Cagney @ 2002-09-28 8:16 UTC (permalink / raw) To: Keith Seitz; +Cc: gdb-patches, insight [-- Attachment #1: Type: text/plain, Size: 843 bytes --] Ok, I've pulled the attached into the 5.3 branch. Sun's not yet over the yard arm so you'll have to wait a little before cracking that coldie. Andrew > On Thu, 26 Sep 2002, Andrew Cagney wrote: > > >> Committed to HEAD..... > >> > >> > Index: gdbtk/ChangeLog >> > 2002-09-25 Andrew Cagney <ac131313@redhat.com> >> > >> > From Grace Sainsbury <graces@redhat.com>: >> > * generic/gdbtk-main.c: New file. > > > FYI, I've committed a testsuite cleanup in > testsuite/lib/insight-support.exp which will get it to run the "insight" > executable instead of gdb. > > Keith > > ChangeLog > 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. > [-- Attachment #2: diffs --] [-- Type: text/plain, Size: 14997 bytes --] 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. 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. 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 28 Sep 2002 15:01:05 -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/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 @@ 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 @@ 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.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 @@ $(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 @@ $(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 @@ # 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 @@ -2372,6 +2407,12 @@ $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) $(TIX_CFLAGS) \ $(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 \ Index: gdb.c =================================================================== RCS file: gdb.c diff -N gdb.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gdb.c 28 Sep 2002 15:01:05 -0000 @@ -0,0 +1,34 @@ +/* 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" +#include "gdb_string.h" + +int +main (int argc, char **argv) +{ + struct captured_main_args args; + memset (&args, 0, sizeof 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.6.1 diff -u -r1.18.6.1 main.c --- main.c 25 Sep 2002 04:27:30 -0000 1.18.6.1 +++ main.c 28 Sep 2002 15:01:05 -0000 @@ -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 @@ return 1; } -struct captured_main_args - { - int argc; - char **argv; - }; - static int captured_main (void *data) { @@ -736,12 +732,10 @@ } 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: main.h =================================================================== RCS file: main.h diff -N main.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ main.h 28 Sep 2002 15:01:05 -0000 @@ -0,0 +1,34 @@ +/* Main interface for GDB, the GNU debugger. + + 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. */ + +#ifndef MAIN_H +#define MAIN_H + +struct captured_main_args +{ + int argc; + char **argv; + int use_windows; +}; + +extern int gdb_main (struct captured_main_args *); + +#endif Index: top.c =================================================================== RCS file: /cvs/src/src/gdb/top.c,v retrieving revision 1.66.6.1 diff -u -r1.66.6.1 top.c --- top.c 14 Sep 2002 23:32:00 -0000 1.66.6.1 +++ top.c 28 Sep 2002 15:01:05 -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/gdbtk-main.c =================================================================== RCS file: gdbtk/generic/gdbtk-main.c diff -N gdbtk/generic/gdbtk-main.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gdbtk/generic/gdbtk-main.c 28 Sep 2002 15:01:06 -0000 @@ -0,0 +1,36 @@ +/* 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" +#include "gdb_string.h" + +int +main (int argc, char **argv) +{ + struct captured_main_args args; + memset (&args, 0, sizeof args); + args.argc = argc; + args.argv = argv; + args.use_windows = 1; + return gdb_main (&args); +} Index: testsuite/lib/insight-support.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/insight-support.exp,v retrieving revision 1.5 diff -u -r1.5 insight-support.exp --- testsuite/lib/insight-support.exp 4 Oct 2001 22:11:12 -0000 1.5 +++ testsuite/lib/insight-support.exp 28 Sep 2002 15:01:06 -0000 @@ -54,7 +54,15 @@ 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 @@ } 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 @@ 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 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Problem about insight rename patch 2002-09-28 8:16 ` Andrew Cagney @ 2002-10-03 0:59 ` Pierre Muller 2002-10-03 8:54 ` Keith Seitz 0 siblings, 1 reply; 14+ messages in thread From: Pierre Muller @ 2002-10-03 0:59 UTC (permalink / raw) To: Andrew Cagney, Keith Seitz; +Cc: gdb-patches, insight At 17:16 28/09/2002 , Andrew Cagney a écrit: >Ok, I've pulled the attached into the 5.3 branch. > >Sun's not yet over the yard arm so you'll have to wait a little before cracking that coldie. This patch has a possible problem regarding the generated init.c code: Until now init.c contained references to objects that are in libgdb.a plus cli*.o or mi*.o files. But that patch also add _initialize_gdbtk function reference. I consider this as a bug because libgdb.a suddenly depends on gtk files which was not the case until now. Moreover this means that gtk is still included in the compilation of gdb executable, which seem to be the absolute contrary of the aim of separating gdb and insight, no? Basically removing _initialize_gdbtk from init.c does not prevent gdb from compiling, so the only reason why I didn't send a patch proposal is that I don't know the correct way of fixing it? Maybe separate init.c into init.c and insight-init.c? But there might be better solutions? Pierre Muller Institut Charles Sadron 6,rue Boussingault F 67083 STRASBOURG CEDEX (France) mailto:muller@ics.u-strasbg.fr Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Problem about insight rename patch 2002-10-03 0:59 ` Problem about " Pierre Muller @ 2002-10-03 8:54 ` Keith Seitz 2002-10-21 12:08 ` Andrew Cagney 0 siblings, 1 reply; 14+ messages in thread From: Keith Seitz @ 2002-10-03 8:54 UTC (permalink / raw) To: Pierre Muller; +Cc: Andrew Cagney, gdb-patches, insight On Thu, 3 Oct 2002, Pierre Muller wrote: > But that patch also add > _initialize_gdbtk > function reference. Yes, that's true, and if I ever get ten minutes to do this (and I can remember!), I'll submit a patch to fix this. However, it's not quite as critical a bug IMO as long as no one is linking against a libgdb.a built in an insight-enabled build. AFAIK, libgdb.a isn't very useful when insight is enabled (except to insight, of course). > Moreover this means that gtk is still > included in the compilation of gdb executable, > which seem to be the absolute contrary of the aim > of separating gdb and insight, no? [s/gdbtk/gtk/ ?] Yes, this is still true. And if you were to run "gdb -w", insight would show up. Contrary to the purpose of separating the two? Yes, really it is, but we've got to start somewhere. Too often I've found that ideas/patches are rejected because they don't implement everything needed. Some people (not all) are not satisfied by the piecemeal approach: nibble a little here, check it in. Maybe someone else will nibble at it. Eventually, the problem gets solved. Maybe not optimally, but it gets solved. > Basically removing > _initialize_gdbtk from init.c > does not prevent gdb from compiling, > so the only reason why I didn't send a patch proposal > is that I don't know the correct way of fixing it? > Maybe separate init.c > into init.c and insight-init.c? > But there might be better solutions? I believe the proper way to do this (Andrew/others will step in and tell me if I'm barking up the wrong perverbial tree) is to create an init_chain, which holds callbacks to be made for initialization. insight-main.c could register _initialize_gdbtk to this chain and top.c would then call it when it was doing initializations. My initial plan was to submit a patch to do just this. Eventually we could investigate getting other initializations registered in main (or we could simple keep init.c). Or we could just create a new initialize_hook (yich) which main could set to get _initialize_gdbtk to run. Or we could just integrate _initialize_gdbtk into main(), or ... Keith ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Problem about insight rename patch 2002-10-03 8:54 ` Keith Seitz @ 2002-10-21 12:08 ` Andrew Cagney 0 siblings, 0 replies; 14+ messages in thread From: Andrew Cagney @ 2002-10-21 12:08 UTC (permalink / raw) To: Keith Seitz; +Cc: Pierre Muller, gdb-patches, insight >> Basically removing >> _initialize_gdbtk from init.c >> does not prevent gdb from compiling, >> so the only reason why I didn't send a patch proposal >> is that I don't know the correct way of fixing it? >> Maybe separate init.c >> into init.c and insight-init.c? >> But there might be better solutions? > > > I believe the proper way to do this (Andrew/others will step in and tell > me if I'm barking up the wrong perverbial tree) is to create an > init_chain, which holds callbacks to be made for initialization. > insight-main.c could register _initialize_gdbtk to this chain and top.c > would then call it when it was doing initializations. My initial plan was > to submit a patch to do just this. Eventually we could investigate getting > other initializations registered in main (or we could simple keep init.c). > > Or we could just create a new initialize_hook (yich) which main could set > to get _initialize_gdbtk to run. Or we could just integrate > _initialize_gdbtk into main(), or ... Any / all of the above. Similar issues arise with MI, TUI and CLI. The way init.c is created could do with a re-think. Fortunatly it isn't causing any immediate pain. One thing though, I think more of the files should always be added to libgdb.a. I can't think of a reason for not including MI or CLI files in the archive by default. Andrew ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2002-10-21 19:08 UTC | newest] Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2002-09-04 14:37 insight rename patch Grace Sainsbury 2002-09-04 14:47 ` Elena Zannoni 2002-09-04 14:59 ` Keith Seitz 2002-09-19 19:15 ` 5.3 branch? Was: " Andrew Cagney 2002-09-19 19:46 ` Keith Seitz 2002-09-25 19:30 ` Andrew Cagney 2002-09-25 19:42 ` Christopher Faylor 2002-09-25 21:27 ` Keith Seitz 2002-09-26 10:48 ` Andrew Cagney 2002-09-27 7:49 ` Keith Seitz 2002-09-28 8:16 ` Andrew Cagney 2002-10-03 0:59 ` Problem about " Pierre Muller 2002-10-03 8:54 ` Keith Seitz 2002-10-21 12:08 ` Andrew Cagney
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox