From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 48581 invoked by alias); 29 Sep 2017 15:21:22 -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 48570 invoked by uid 89); 29 Sep 2017 15:21:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-16.9 required=5.0 tests=BAYES_00,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=composed, tweaked, instruct X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 29 Sep 2017 15:21:20 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4A6483680F; Fri, 29 Sep 2017 15:21:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4A6483680F Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves@redhat.com Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 67F6682302; Fri, 29 Sep 2017 15:21:15 +0000 (UTC) Subject: Re: [PATCH v4 3/3] Extend "set cwd" to work on gdbserver To: Sergio Durigan Junior , GDB Patches References: <20170912042325.14927-1-sergiodj@redhat.com> <20170928041046.5468-1-sergiodj@redhat.com> <20170928041046.5468-4-sergiodj@redhat.com> Cc: Eli Zaretskii From: Pedro Alves Message-ID: <199971a4-0bfe-c2a2-ef81-5836a3ab22dc@redhat.com> Date: Fri, 29 Sep 2017 15:21:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20170928041046.5468-4-sergiodj@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-09/txt/msg00909.txt.bz2 On 09/28/2017 05:10 AM, Sergio Durigan Junior wrote: > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -26,6 +26,14 @@ > > * New features in the GDB remote stub, GDBserver > > + ** GDBserver is now able to set the inferior's current working > + directory. That's confusing IMO, because it sounds like you're saying you can change the inferior's current working directory at any time, even on inferiors that are already running... I'd go for: ** GDBserver is now able to start inferior processes with a specified initial working directory. > + > + The user can set the desired working directory to be used by the > + remote inferior on GDB, using the new "set cwd" command, which > + will instruct GDB to tell GDBserver about this directory change > + the next time an inferior is run. And instead of the above, say: The user can set the desired working directory to be used from GDB using the new "set cwd" command. Note "on" -> "from". I think that conveys it better. The "which will instruct" part is distracting and unnecessary implementation detail, IMO. > +@item QSetWorkingDir:@r{[}@var{directory}@r{]} > +@anchor{QSetWorkingDir packet} > +@cindex set working directory, remote request > +@cindex @samp{QSetWorkingDir} packet > +This packet is used to inform the remote server of the intended > +current working directory for programs that are going to be executed. > + > +The packet is composed by @var{directory}, an hex encoded > +representation of the directory that the remote inferior will use as > +its current working directory. If @var{directory} is an empty string, > +the remote server should reset the inferior's current working > +directory to its original, empty value. > + > +This packet is always transmitted when the inferior is run. If the > +user has not explcitly specified a directory with the @kbd{set cwd} typo: explicitly > +command, then an empty packet will be sent to the remote server, which Not an empty packet, and empty directory. Really-empty packets are special in the remote protocol. > +will have no effect. WDYM will have no effect, when just above you've explained that empty means reset ? I think you should just remove this paragraph starting with "This packet is always transmitted". That's implementation detail. GDB could for example not resend the packet if the value didn't change between runs, no? > Otherwise, the specified inferior's working > +directory will be transmitted (@pxref{Working Directory, ,Your > +Program's Working Directory}). This too should be tweaked accordingly. > + > +This packet is only available in extended mode (@pxref{extended > +mode}). > + Thanks, Pedro Alves