From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id 278EE385B834 for ; Thu, 25 Jun 2020 17:57:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 278EE385B834 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Sandra_Loosemore@mentor.com IronPort-SDR: VfdwRgaRDr9iCR8TrblZcmaKSbCE/FO1AaFa2ePbQqdsyTPrQhHBWrsXZ8kSWwv0R5NBd7jBWm FHmSYhJCw4yVmoImjXv9Cg9DRKJ6azgbS4XxH9JEedFWvLlc8qRR7OMAYGBDktM9487L5dW5k6 auiFS8NnugvqsF5KnIsJxGJHBpiUjVAi8jg3pBUgUKSWq31S9JRdlYcUVRZQurTxtCklZJ6BYh LccRVSY0RY91gm7VjGgTODV8FkpT97bay+NfPRB+HyQAwb2oN0ZPmNueZiXR6FOvYGrpqTB9nH qQg= X-IronPort-AV: E=Sophos;i="5.75,280,1589270400"; d="scan'208";a="50193001" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 25 Jun 2020 09:57:14 -0800 IronPort-SDR: 5Bfzf9lOgXQmTFAZeiqwci93A2kMfGdkzKABKiQGnuyzB491E1dMvAHJpNzzs71xqhDPE27tzO UQplfV9on/uYsVCHxEI7kSRhFsgRP5U9/im6yuArF+ebFfbIma7deDhLVhk1LuFecWfsOE8pQj uaP2hhhY+HGWVIqK4Ei778w8l6LByH51DwGEY3AbvH7bplexvnesUw2qvYCKfjRrwZ4Wloe0pR 2lzY2OfkldF11PoD5J5A053WjZ1skAV2njWAkIjOlsuMZmLYK32ZLZRvhVnEiD0xxSlvm8c1KN WLg= Subject: Re: [patch] gdb/testsuite: Fix POSIX-isms in gdb.base/shell.exp To: Christian Biesinger CC: "gdb-patches@sourceware.org" References: <6bc2b01e-3807-77b9-7d1e-d7f6a7875e49@codesourcery.com> From: Sandra Loosemore Message-ID: Date: Thu, 25 Jun 2020 11:57:08 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, 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: Thu, 25 Jun 2020 17:57:17 -0000 On 6/25/20 11:32 AM, Christian Biesinger wrote: > On Wed, Jun 24, 2020 at 8:35 PM Sandra Loosemore > 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