From patchwork Sat Aug 17 21:28:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandra Loosemore X-Patchwork-Id: 34160 Received: (qmail 28274 invoked by alias); 17 Aug 2019 21:29:06 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 28264 invoked by uid 89); 17 Aug 2019 21:29:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, SPF_PASS autolearn=ham version=3.3.1 spammy=H*Ad:U*sandra, reliably, harder X-HELO: esa4.mentor.iphmx.com Received: from esa4.mentor.iphmx.com (HELO esa4.mentor.iphmx.com) (68.232.137.252) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 17 Aug 2019 21:29:04 +0000 IronPort-SDR: 7FcCJHkkL8FxF7szvyIrmChC9LeX/hpOzKn+lVCXe5d2cSU9G7S9VjUs+L0sf5qGwf/MZOtOxw W7SgZVFSECFhUBwiefkHgSrFT+WzfXm0XKY6kWHgfd4hdXa7XC9Bj3k7wRBfhb6BSkXuFc3lj2 THCczyw4ac1MpaVQ5t3tws8SFa/9mISb2coHiwH01CSHCaxPNI1HGRG6vM9+JTS6kDAAZz8sfv XEEvsIefPQwzHAGyQKc49wsMoyyPjc0a09oWFRV9LvKfUb+24ma7Nu6jGXKbDqE5M5MCJMSuf2 fGA= Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 17 Aug 2019 13:29:02 -0800 IronPort-SDR: 33PUzGD4tCrP/ABdB1axePaX5EvTZ8oV7A+sOGxgW6PLKViYUkm2ovPEGyuU9ahDDJyTFz2kPL /Il9Iv5TU1MgxHp6IdG5Rt+eyyj46C+2arHp4N+hQvl21PzGyueLenxYtTNbL2UM+lpuKkoLWX pMzLeLZCTN+uOySeGOXqHB+Aoys/GF0RJiPqx6jI4rtMM5zr9gw00FBOsO+YOUO/aRR75iGdwK oK48t83EeBH5H1aWD/tcQ9zC3lu4lqccgSnuQi+4YVp0qS3xwb4gMPlvYRIalnw8ay21Yr1guC xdk= To: "gdb-patches@sourceware.org" From: Sandra Loosemore Subject: [patch, testsuite] Run argv0-symlink.exp only on native target and local host. Message-ID: <2e66524e-9409-f50c-7df3-e9dbe71d9072@codesourcery.com> Date: Sat, 17 Aug 2019 15:28:56 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 Return-Path: sandra@codesourcery.com I've been continuing to look into bogus test failures seen on remote Windows host, and it turns out gdb.base/argv0-symlink.exp is somewhat more broken than that. This testcase was originally added for gdb/15415, a problem with the "run" command expanding symlinks in the name of the program being run. This test incorrectly uses pathnames on build to create symbolic links on host: set status [remote_exec host "ln -sf ${testfile} [standard_output_file $filelink]"] and expects the test program running on target to see those symbolic links: gdb_test {print argv[0]} "/$filelink\"" $test I see there have been some attempts over the years to try to make this testcase not fail on bare-metal or gdbserver targets but nothing has really fixed the build/host/target filesystem confusion. It's probably possible to do that somehow, but given that this was for a bug in the "run" command I'm not sure what the value is of attempting to run the test on targets that don't use "run". (It wasn't a target-specific bug and GDB surely gets plenty of testing on targets that do use "run".) So this patch just disables it on targets that are going to trip over the remote-host or remote-target problems unless there is something magic going on in the test environment (like, say, a shared network filesystem). So, is this patch OK, or do we need to try harder to fix the testcase? -Sandra commit 145663b08d5a6610e5a90b807ce44ff2d41916d3 Author: Sandra Loosemore Date: Sat Aug 17 13:44:17 2019 -0700 Run argv0-symlink.exp only on native target and local host. This testcase was originally for PR gdb/15415, a problem with the "run" command expanding symlinks in the name of the program being run. It does not correctly distinguish between files on build, host, and target, and it is not clear if it would be testing anything useful in configurations where "run" is not being used. 2019-08-17 Sandra Loosemore gdb/testsuite/ * gdb.base/argv0-symlink.exp: Run only on native target and local host. diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index edf7d17..b41d879 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-08-17 Sandra Loosemore + + * gdb.base/argv0-symlink.exp: Run only on native target + and local host. + 2019-08-16 Tom de Vries * gdb.base/compare-sections.exp ("after run to main"): Allow diff --git a/gdb/testsuite/gdb.base/argv0-symlink.exp b/gdb/testsuite/gdb.base/argv0-symlink.exp index cce6ca6..33301bd 100644 --- a/gdb/testsuite/gdb.base/argv0-symlink.exp +++ b/gdb/testsuite/gdb.base/argv0-symlink.exp @@ -13,6 +13,23 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# This testcase was originally for PR gdb/15415, a problem with the "run" +# command expanding symlinks in the name of the program being run. +# This test uses pathnames on build to create symbolic links on host and +# expects the test program running on target to see those symbolic links. +# Therefore, it can't work reliably on anything other than configurations +# where build/host/target are all the same. + +if { ![isnative] } { + unsupported "argv0-symlink.exp not supported on non-native target" + return -1 +} + +if { [is_remote host] } { + unsupported "argv0-symlink.exp not supported on remote host" + return -1 +} + standard_testfile set has_argv0 [gdb_has_argv0]