From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 88873 invoked by alias); 28 Feb 2018 16:29:40 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 88864 invoked by uid 89); 28 Feb 2018 16:29:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,KAM_SHORT,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 Feb 2018 16:29:38 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A062C8182D20; Wed, 28 Feb 2018 16:29:36 +0000 (UTC) Received: from localhost (unused-10-15-17-196.yyz.redhat.com [10.15.17.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A1F32024CA8; Wed, 28 Feb 2018 16:29:36 +0000 (UTC) From: Sergio Durigan Junior To: Simon Marchi Cc: GDB Patches , Pedro Alves , Joel Brobecker Subject: Re: [PATCH v3 2/2] Make gdbserver work with filename-only binaries References: <20180210014241.19278-3-sergiodj@redhat.com> <20180228032708.19670-1-sergiodj@redhat.com> <20180228032708.19670-3-sergiodj@redhat.com> <8f56c11a-09ba-dd9e-7c89-56dfcb25c1cf@ericsson.com> Date: Wed, 28 Feb 2018 16:29:00 -0000 In-Reply-To: <8f56c11a-09ba-dd9e-7c89-56dfcb25c1cf@ericsson.com> (Simon Marchi's message of "Wed, 28 Feb 2018 00:45:41 -0500") Message-ID: <87k1uxm61b.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg00466.txt.bz2 On Wednesday, February 28 2018, Simon Marchi wrote: > On 2018-02-27 10:27 PM, Sergio Durigan Junior wrote: >> diff --git a/gdb/testsuite/gdb.server/abspath.exp b/gdb/testsuite/gdb.server/abspath.exp >> new file mode 100644 >> index 0000000000..beb1d96209 >> --- /dev/null >> +++ b/gdb/testsuite/gdb.server/abspath.exp >> @@ -0,0 +1,51 @@ >> +# This testcase is part of GDB, the GNU debugger. >> + >> +# Copyright 2018 Free Software Foundation, Inc. >> + >> +# This program is free software; you can redistribute it and/or modify >> +# it under the terms of the GNU General Public License as published by >> +# the Free Software Foundation; either version 3 of the License, or >> +# (at your option) any later version. >> +# >> +# This program is distributed in the hope that it will be useful, >> +# but WITHOUT ANY WARRANTY; without even the implied warranty of >> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> +# GNU General Public License for more details. >> +# >> +# You should have received a copy of the GNU General Public License >> +# along with this program. If not, see . >> + >> +# Test that gdbserver performs path expansion/adjustment when we >> +# provide just a filename (without any path specifications) to it. >> + >> +load_lib gdbserver-support.exp >> + >> +standard_testfile normal.c >> + >> +if { [skip_gdbserver_tests] } { >> + return 0 >> +} >> + >> +if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } { >> + return -1 >> +} >> + >> +# Make sure we're disconnected, in case we're testing with an >> +# extended-remote board, therefore already connected. >> +gdb_test "disconnect" ".*" >> + >> +set target_exec [gdbserver_download_current_prog] >> + >> +# Switch to where $target_exec lives, and execute gdbserver from >> +# there. >> +with_cwd "[file dirname $target_exec]" { >> + set target_execname [file tail $target_exec] >> + set res [gdbserver_start "" $target_execname] >> + >> + set gdbserver_protocol [lindex $res 0] >> + set gdbserver_gdbport [lindex $res 1] >> + gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport >> + >> + gdb_breakpoint main >> + gdb_test "continue" "Breakpoint $decimal.* main.*" "continue to main" >> +} > > The patch LGTM, just a note about the test. > > I think this won't work when testing with a remote target (wher gdbserver > is started on another machine. with_cwd will try to cd into an directory > that exists on the other machine, or an "empty string" directory (I am not sure > what gdbserver_download_current_prog returns), so it will probably crash. > > It would complicate the test quite a bit to make it work with a remote > target, and wouldn't add much value: when testing with a remote target, > gdbserver is started with a filename-only argument (that's how I > stumbled on the issue). So if that breaks, all the other tests will fail. > > A counter argument for that would be that the remote board file is subject > to change. if we change it so that it invokes gdbserver by passing > non-filename-only paths, the feature would not be tested anymore... > > At the minimum, I think we need to skip this test is target is a remote > one ([is_remote target]). If you want to go further and make the test > work with a remote target, then go ahead, but I would be fine with > just skipping it. Thanks, Simon. I'll skip the test for remote targets for now. I'll push it afterwards. Thanks, -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/