Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Sandra Loosemore <sandra@codesourcery.com>
To: Christian Biesinger <cbiesinger@google.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [patch] gdb/testsuite: Fix POSIX-isms in gdb.base/shell.exp
Date: Thu, 25 Jun 2020 11:57:08 -0600	[thread overview]
Message-ID: <a114b54e-c3b2-6327-e108-073cdafaca13@codesourcery.com> (raw)
In-Reply-To: <CAPTJ0XHBAXpqj-5e=Z1Xu9qjK09PK6BJvkrF=0O8eCWaVyV-Ng@mail.gmail.com>

On 6/25/20 11:32 AM, Christian Biesinger wrote:
> On Wed, Jun 24, 2020 at 8:35 PM Sandra Loosemore
> <sandra@codesourcery.com> wrote:
>>
>> This patch fixes a group of failures in gdb.base/shell.exp on Windows
>> host due to assumptions that GDB is launching a POSIX-like shell.  On
>> Windows, we get CMD.EXE instead.
> 
> Hmm, if I call runtest/make check from an msys2 shell, do I really get
> cmd.exe here? I ask because i wonder how many people run this from
> cmd.exe as opposed to msys's shell, so it may be better to check for
> cmd more specifically somehow (maybe $SHELL?)

I'm not familiar with the msys2 shell, but....

On Windows host GDB uses the system() function provided by the host C 
library to launch a shell and does not consult $SHELL at all.  This is 
in shell_escape in gdb/cli/cli-cmds.c.

Here is the documentation I found via Google for system() in the Windows 
library:

https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/system-wsystem?view=vs-2019

"system uses the COMSPEC and PATH environment variables to locate the 
command-interpreter file CMD.exe."

I think the GDB manual doesn't accurately describe what GDB does in this 
situation, BTW.

-Sandra


  reply	other threads:[~2020-06-25 17:57 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 [this message]
2020-06-25 18:07     ` Eli Zaretskii
2020-06-25 19:35       ` Sandra Loosemore
2020-06-26  7:08         ` Eli Zaretskii
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=a114b54e-c3b2-6327-e108-073cdafaca13@codesourcery.com \
    --to=sandra@codesourcery.com \
    --cc=cbiesinger@google.com \
    --cc=gdb-patches@sourceware.org \
    /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