From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 118354 invoked by alias); 21 Feb 2018 06:15:50 -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 118150 invoked by uid 89); 21 Feb 2018 06:15:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,TIME_LIMIT_EXCEEDED,T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 spammy=beat, 1am 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, 21 Feb 2018 06:15:17 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 44AA88A9E8; Wed, 21 Feb 2018 06:15:09 +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 E82EC21411B6; Wed, 21 Feb 2018 06:15:08 +0000 (UTC) From: Sergio Durigan Junior To: Joel Brobecker Cc: GDB Patches , palves@redhat.com, Simon Marchi Subject: Re: [RFC] "gdbserver ... BASENAME_EXE" no longer works References: <1482464361-4068-1-git-send-email-sergiodj@redhat.com> <1482464361-4068-6-git-send-email-sergiodj@redhat.com> <20180221035827.ae265ol4k5jthhp2@adacore.com> Date: Wed, 21 Feb 2018 06:15:00 -0000 In-Reply-To: <20180221035827.ae265ol4k5jthhp2@adacore.com> (Joel Brobecker's message of "Wed, 21 Feb 2018 07:58:27 +0400") Message-ID: <87sh9u50nn.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/msg00282.txt.bz2 On Tuesday, February 20 2018, Joel Brobecker wrote: > Hello, > > I just noticed that the following patch... > > commit 2090129c36c7e582943b7d300968d19b46160d84 > Date: Thu Dec 22 21:11:11 2016 -0500 > Subject: Share fork_inferior et al with gdbserver > > ... caused a change of behavior in GDBserver, where the following > no longer works (unless '.' is in your PATH, but for me, that's > not a good idea): > > $ gdbserver --once :4444 simple_main > zsh:1: command not found: simple_main > During startup program exited with code 127. > Exiting > > Prior to the change we we able to start simple_main without problems: > > $ gdbserver --once :4444 simple_main > Process simple_main created; pid = 26579 > Listening on port 4444 > > Was that intentional? Reading the revision log, there is no mention > of this, and this was a fairly natural thing to be doing. This also > matches something we do with GDBserver as well, so it would make > the two tools consistent in that regard. > > Attached is a preliminary hack meant to help me explore what would > be needed to bring this feature back. If we agree we want the feature > back, and that I'm doing it at the right location, I'll split it, > finish the C++-ification of the execv_argv class, and then resubmit > as an official RFA. > > Comments on the code welcome, of course! (I feel like a C++ dummy, > sometimes). Hi, Joel, Thanks for the patch. Just a quick comment since it's past 1a.m. here. I am trying to tackle this problem from a different angle here: https://sourceware.org/ml/gdb-patches/2018-02/msg00178.html Simon's reply is here: https://sourceware.org/ml/gdb-patches/2018-02/msg00181.html I still have to address it; I intend to do it tomorrow (sorry about the delay). I took a different approach than your patch, in that I'm doing the path expansion before fork_inferior is even called. The reason for that is because we already take care of this on GDB by using openp, so I thought it'd make more sense to modify only gdbserver in this case. I confess I haven't looked deep into your code, but Simon has mentioned that he'd like to avoid expanding filename-only paths that contain a directory component on it. For example a file name "dir/file" shouldn't be expanded. Anyway, I don't know right now if your approach makes more sense than mine. I'll give it more thought when I wake up (probably Pedro and/or Simon will beat me to it). I'm also planning on submitting v3 of my current patch, unless the consensus is that your patch is better, of course. 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/