Patch: rename to `insight'

Christopher Faylor cgf@redhat.com
Wed Nov 29 12:00:00 GMT 2000


On Wed, Nov 29, 2000 at 12:17:25PM -0700, Tom Tromey wrote:
>>>>>> "Eli" == Eli Zaretskii <eliz@delorie.com> writes:
>
>Eli> I would suggest to consider a short C program instead of a shell
>Eli> script, for portability's sake.  Shell scripts are not very
>Eli> portable to non-Posix platforms.
>
>I assume you're talking about Windows.  I thought gdb required Cygwin
>to run on Windows, in which case you will have a shell.  Or is there a
>real native gdb?

I think that the mingw project has a native version of gdb but I think
that it still uses '/' rather than '\' for its paths.  I don't believe
that it works with insight, though.

How's that for a definitive statement?

>Eli> This assumes that the distribution is not moved once installed.
>Eli> That might be true on a typical Unix system (even there you might
>Eli> have problems with CD-ROM distributions), but it will make lots
>Eli> of problems on DOS/Windows systems, where a precompiled binary is
>Eli> usually installed into a directory that has nothing to do with
>Eli> the original installation at "make install" time.
>
>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.

This is true of cygwin shells, too.

>Eli> Why not simply invoke "gdb" and let PATH do its thing?  Or at
>Eli> least try that before falling back on the installation directory?
>
>The installation directory should be the first choice (after the
>directory of `insight' itself).
>
>Using PATH isn't so good because people sometimes use the full path to
>run something that isn't in their PATH.  This happens a lot with
>developers.  An earlier version of this patch didn't use bindir -- and
>I ran into this problem myself (I have 3 or 4 versions of gdb around
>at any given time).
>
>I fixed the script to fall back on PATH if it can't find the file any
>other way.
>
>Eli> I'm not sure this will DTRT with all DOS/Windows ports of Unixy
>Eli> shells.  I suggest to use "gdb.exe" on those platfrms (better
>Eli> safe than sorry).
>
>Ok.  I added $(EXEEXT) to the @gdb@ substitution.
>
>Eli> Writing a short C program would eliminate all these problems (and
>Eli> also avoid requiring users to have a ported shell on their
>Eli> machines).  That's why I suggested that in the first place.
>
>I don't know that much about Windows or DOS.  I don't know how I would
>determine whether the program was portable there.

For Windows, if it works on linux, it should work on cygwin.  This isn't
an issue for DOS is it?  Does insight work on DOS?

AFAICT, this shell script would work as well on Windows/Cygwin as it
does on linux.

cgf


More information about the Gdb-patches mailing list