From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 120812 invoked by alias); 28 Feb 2018 03:32:30 -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 120335 invoked by uid 89); 28 Feb 2018 03:32:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,T_RP_MATCHES_RCVD autolearn=no 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 03:32:28 +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 9F97A402243B; Wed, 28 Feb 2018 03:32:26 +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 857262024CA6; Wed, 28 Feb 2018 03:32:26 +0000 (UTC) From: Sergio Durigan Junior To: Pedro Alves Cc: GDB Patches , Simon Marchi Subject: Re: [PATCH v2 2/2] Make gdbserver work with filename-only binaries References: <20180210014241.19278-3-sergiodj@redhat.com> <20180212195733.23639-1-sergiodj@redhat.com> <20180212195733.23639-3-sergiodj@redhat.com> <87f198c5-3963-1c54-ff16-e3dcc8c9e632@redhat.com> <87371n1dwo.fsf@redhat.com> Date: Wed, 28 Feb 2018 03:32:00 -0000 In-Reply-To: <87371n1dwo.fsf@redhat.com> (Sergio Durigan Junior's message of "Mon, 26 Feb 2018 19:20:39 -0500") Message-ID: <877eqxpz5h.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/msg00443.txt.bz2 On Monday, February 26 2018, I wrote: > On Wednesday, February 21 2018, Pedro Alves wrote: >>> + >>> +if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } { >>> + return -1 >>> +} >>> + >>> +set target_exec [gdbserver_download_current_prog] >>> +set target_execname [file tail $target_exec] >>> +# We temporarily copy the file to our current directory >>> +file copy -force $target_exec [pwd] >>> +set res [gdbserver_start "" $target_execname] >> >> Please remind me -- is the current directory here usually >> the testcase's output dir? I.e., is it guaranteed that >> the current directory here is not going to be the same >> directory of another testcase running in parallel at >> the same time? > > No, [pwd] is actually the gdb/testsuite/ directory, from where the > Makefile runs. Which means that other tests running in parallel at the > same time will have the same value for [pwd]. I copied the file to > [pwd] because that's how I solved the problem of having the binary at > the same directory as the one I'm starting gdbserver from. > > Another solution that I thought was to cd into the the dirname of > the downloaded $target_exec, execute gdbserver from there, and the cd > back to the original directory. WDYT? I decided to go ahead and implement this idea. v3 is now out. Please let me know your thoughts. 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/