This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: Patch: rename to `insight'
- To: Eli Zaretskii <eliz at is dot elta dot co dot il>
- Subject: Re: Patch: rename to `insight'
- From: Tom Tromey <tromey at redhat dot com>
- Date: 06 Dec 2000 17:16:35 -0700
- Cc: gdb-patches at sources dot redhat dot com
- References: <87u28r7niz.fsf@creche.cygnus.com> <200011290838.DAA00402@indy.delorie.com> <87aeai1tbu.fsf@creche.cygnus.com> <9743-Wed29Nov2000225643+0200-eliz@is.elta.co.il> <87itp6w59j.fsf@creche.cygnus.com> <200011300759.CAA18622@indy.delorie.com>
- Reply-To: tromey at redhat dot com
>>>>> "Eli" == Eli Zaretskii <eliz@delorie.com> writes:
Eli> Perhaps this should actually look for the executable (with "test
Eli> -f"), instead of just checking for the non-empty directory. If
Eli> you agree, then this test should be moved down, where it falls
Eli> back on PATH:
I made it do both tests. See appended.
>> if test -f "$exe"; then
Eli> If you use "test -f", you must append a .exe extension, because
Eli> there's no file named `gdb' on those systems which use .exe.
The new Makefile.in substitutes EXEEXT into the script.
I've appended the latest revision of the patch.
2000-11-28 Tom Tromey <tromey@cygnus.com>
* insight.in: New file.
* Makefile.in (install-gdbtk): Install `insight'.
(all-gdbtk): Depend on `insight'.
(insight): New target.
* top.c (use_windows): Default to 0.
Tom
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.47
diff -u -r1.47 Makefile.in
--- Makefile.in 2000/11/10 23:02:56 1.47
+++ Makefile.in 2000/12/07 00:02:58
@@ -1308,7 +1315,7 @@
# FIXME: cagney/2000-03-27: Post 5.0 this link code can be removed.
# It should now be possible to run GDBtk from the build directory
# without the link in place.
-all-gdbtk:
+all-gdbtk: insight
@if test ! -d gdbtcl/images ; then \
if test "$(LN_S)" = "ln -s" ; then \
echo linking ${srcdir}/gdbtk/library to gdbtcl ; \
@@ -1334,11 +1341,32 @@
$(SHELL) $(srcdir)/../mkinstalldirs $(datadir)/gdbtcl/help \
$(datadir)/gdbtcl/help/images \
$(datadir)/gdbtcl/help/trace ; \
+ $(SHELL) $(srcdir)/../mkinstalldirs $(bindir)
cd $(srcdir)/gdbtk/library ; \
for i in *.tcl *.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 $(datadir)/gdbtcl/$$i ; \
- done ;
+ done
+ 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 $(bindir)/$$transformed_name
+
+insight: $(srcdir)/insight.in
+ transformed_name=`t='$(program_transform_name)'; \
+ echo gdb | sed -e $$t` ; \
+ if test "x$$transformed_name" = x; then \
+ transformed_name=gdb ; \
+ else \
+ true ; \
+ fi ; \
+ sed -e "s,\@gdb\@,$$transformed_name$(EXEEXT)," -e 's,\@bindir\@,$(bindir),' \
+ < $(srcdir)/insight.in > insight \
+ && chmod +x insight
gdbres.o: $(srcdir)/gdbtk/gdb.rc $(srcdir)/gdbtk/gdbtool.ico
$(WINDRES) --include $(srcdir)/gdbtk $(srcdir)/gdbtk/gdb.rc gdbres.o
Index: top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.22
diff -u -r1.22 top.c
--- top.c 2000/11/27 02:18:44 1.22
+++ top.c 2000/12/07 00:03:02
@@ -173,7 +173,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: insight.in
===================================================================
RCS file: insight.in
diff -N insight.in
--- /dev/null Tue May 5 13:32:27 1998
+++ insight.in Wed Dec 6 16:03:02 2000
@@ -0,0 +1,45 @@
+#! /bin/sh
+
+# GUI wrapper for gdb.
+# Copyright 2000 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.
+
+# Name of gdb, properly transformed.
+gdb="@gdb@"
+# Default location of gdb.
+bindir="@bindir@"
+
+# Try to pick up gdb from the same directory as insight.
+path="`echo $0 | sed -e 's,/[^/]*$,,'`"
+
+if test -n "$path" && test -f "$path/$gdb"; then
+ exe="$path/$gdb"
+else
+ exe="$bindir/$gdb"
+fi
+
+if test -f "$exe"; then
+ # Nothing
+ :
+else
+ # Use PATH.
+ exe="$gdb"
+fi
+
+exec $exe -w ${1+"$@"}