Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Sandra Loosemore <sandra@codesourcery.com>
Cc: cbiesinger@google.com, gdb-patches@sourceware.org
Subject: Re: [patch] gdb/testsuite: Fix POSIX-isms in gdb.base/shell.exp
Date: Fri, 26 Jun 2020 10:08:41 +0300	[thread overview]
Message-ID: <83eeq2s3ra.fsf@gnu.org> (raw)
In-Reply-To: <acb5bef8-4a8a-1f41-5b30-af613ead5d1b@codesourcery.com> (message from Sandra Loosemore on Thu, 25 Jun 2020 13:35:45 -0600)

> CC: <cbiesinger@google.com>, <gdb-patches@sourceware.org>
> From: Sandra Loosemore <sandra@codesourcery.com>
> Date: Thu, 25 Jun 2020 13:35:45 -0600
> 
> >> I think the GDB manual doesn't accurately describe what GDB does in this
> >> situation, BTW.
> > 
> > Which part of the manual did you allude to here, and what is in your
> > opinion inaccurate there?
> 
> https://sourceware.org/gdb/current/onlinedocs/gdb/Shell-Commands.html#Shell-Commands
> 
> "If it exists, the environment variable SHELL determines which shell to 
> run. Otherwise GDB uses the default shell (/bin/sh on Unix systems, 
> COMMAND.COM on MS-DOS, etc.). "
> 
> The SHELL environment variable is not consulted on Windows hosts.  It 
> just uses whatever shell the system() call uses -- look at the 
> implementation of shell_escape in gdb/cli/cli-cmds.c.

It isn't factually wrong: $SHELL isn't supposed to be set on non-Posix
hosts.  However, I made the text more accurate with the patch below,
which I just installed.

> The references to MS-DOS and COMMAND.COM are certainly bit-rotten. 
> COMMAND.COM was replaced by CMD.EXE in Windows NT, 25+ years ago now. 
> And do you really expect to be able to build a modern GDB to run on a 
> 16-bit MS-DOS host?  :-P

You'd be surprised:

  ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/gdb801b.zip
  https://groups.google.com/forum/#!msg/comp.os.msdos.djgpp/MIm6bIlJ8b8/yNuLXDoxBQAJ

The DJGPP project has MS-DOS ports of all the main GNU utilities, most
of them of fairly recent versions (the above is GDB 8.0.1).

As for the 16-bit nature of MS-DOS and the ability to run a modern GDB
on it, you remind me of a short dialogue between RMS and DJ Delorie,
which happened more than 30 years ago and started the DJGPP project;
see the first paragraphs on this page:

  http://www.delorie.com/djgpp/history.html

Here's the patch I installed on the master branch:

diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 4b1a4c0..c591934 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,8 @@
+2020-06-26  Eli Zaretskii  <eliz@gnu.org>
+
+	* gdb.texinfo (Shell Commands): More accurate description of use
+	of $SHELL.  Reported by Sandra Loosemore <sandra@codesourcery.com>.
+
 2020-06-23  Andrew Burgess  <andrew.burgess@embecosm.com>
 
 	* gdb.texinfo (Maintenance Commands): Document new 'maint print
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 7f8c77a..fbe9f85 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -1451,9 +1451,10 @@
 @itemx !@var{command-string}
 Invoke a standard shell to execute @var{command-string}.
 Note that no space is needed between @code{!} and @var{command-string}.
-If it exists, the environment variable @code{SHELL} determines which
-shell to run.  Otherwise @value{GDBN} uses the default shell
-(@file{/bin/sh} on Unix systems, @file{COMMAND.COM} on MS-DOS, etc.).
+On GNU and Unix systems, the environment variable @code{SHELL}, if it
+exists, determines which shell to run.  Otherwise @value{GDBN} uses
+the default shell (@file{/bin/sh} on GNU and Unix systems,
+@file{cmd.exe} on MS-Windows, @file{COMMAND.COM} on MS-DOS, etc.).
 @end table
 
 The utility @code{make} is often needed in development environments.


  reply	other threads:[~2020-06-26  7:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-25  1:35 Sandra Loosemore
2020-06-25 17:32 ` Christian Biesinger
2020-06-25 17:57   ` Sandra Loosemore
2020-06-25 18:07     ` Eli Zaretskii
2020-06-25 19:35       ` Sandra Loosemore
2020-06-26  7:08         ` Eli Zaretskii [this message]
2020-06-26 22:22           ` Sandra Loosemore
2020-06-25 22:36     ` Christian Biesinger
2020-07-15 19:53 ` [ping] " Sandra Loosemore
2020-07-16  2:41   ` Simon Marchi
2020-07-16 16:44     ` Eli Zaretskii

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=83eeq2s3ra.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=cbiesinger@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sandra@codesourcery.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