From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 153723851C34 for ; Fri, 26 Jun 2020 07:09:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 153723851C34 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=eliz@gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]:51959) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joiTu-00066j-8G; Fri, 26 Jun 2020 03:09:02 -0400 Received: from [176.228.60.248] (port=3808 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1joiTs-0006vI-IY; Fri, 26 Jun 2020 03:09:01 -0400 Date: Fri, 26 Jun 2020 10:08:41 +0300 Message-Id: <83eeq2s3ra.fsf@gnu.org> From: Eli Zaretskii To: Sandra Loosemore Cc: cbiesinger@google.com, gdb-patches@sourceware.org In-Reply-To: (message from Sandra Loosemore on Thu, 25 Jun 2020 13:35:45 -0600) Subject: Re: [patch] gdb/testsuite: Fix POSIX-isms in gdb.base/shell.exp References: <6bc2b01e-3807-77b9-7d1e-d7f6a7875e49@codesourcery.com> <83k0zvrpdk.fsf@gnu.org> X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jun 2020 07:09:06 -0000 > CC: , > From: Sandra Loosemore > 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 + + * gdb.texinfo (Shell Commands): More accurate description of use + of $SHELL. Reported by Sandra Loosemore . + 2020-06-23 Andrew Burgess * 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.