This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: Patch: rename to `insight'
>> The program first tries to see if `gdb' exists in the same
>> directory as `insight'. Most shells use the full path as $0, so
>> this has a good chance of working.
Eli> And yet you still kept the fallback on the installation
Eli> directory. It is this fallback that I was talking about.
Sorry, I didn't understand.
See the appended.
Tom
#! /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"; 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+"$@"}