From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 83959 invoked by alias); 21 Sep 2017 01:37:55 -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 83941 invoked by uid 89); 21 Sep 2017 01:37:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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; Thu, 21 Sep 2017 01:37:53 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C67CBC047B74 for ; Thu, 21 Sep 2017 01:37:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C67CBC047B74 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=sergiodj@redhat.com Received: from localhost (unused-10-15-17-193.yyz.redhat.com [10.15.17.193]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9B6C35D6A8; Thu, 21 Sep 2017 01:37:51 +0000 (UTC) From: Sergio Durigan Junior To: Pedro Alves Cc: GDB Patches Subject: Re: [PATCH v2 5/5] Extend "set cwd" to work on gdbserver References: <20170912042325.14927-1-sergiodj@redhat.com> <20170919042842.9210-1-sergiodj@redhat.com> <20170919042842.9210-6-sergiodj@redhat.com> <2a0b74f9-d0e8-cd82-dfcc-9b2459a79c53@redhat.com> <87shfh3p8y.fsf@redhat.com> Date: Thu, 21 Sep 2017 01:37:00 -0000 In-Reply-To: <87shfh3p8y.fsf@redhat.com> (Sergio Durigan Junior's message of "Wed, 20 Sep 2017 19:49:01 -0400") Message-ID: <87y3p8n85s.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00529.txt.bz2 On Wednesday, September 20 2017, I wrote: > On Wednesday, September 20 2017, Pedro Alves wrote: > >> On 09/19/2017 05:28 AM, Sergio Durigan Junior wrote: >>> This is the "natural" extension necessary for the "set cwd" command >>> (and the whole "set the inferior's cwd" logic) to work on gdbserver. >>> >>> The idea here is to have a new remote packet, QSetWorkingDir (name >>> adopted from LLDB's extension to the RSP, as can be seen at >>> ), >>> which sends an hex-encoded string representing the working directory >>> that gdbserver is supposed to cd into before executing the inferior. >>> The good thing is that since this feature is already implemented on >>> nat/fork-inferior.c, all gdbserver has to do is to basically implement >>> "set_inferior_cwd" and call it whenever such packet arrives. >>> >>> Aside from that, the patch consists basically of updates to the >>> testcase (making it available on remote targets) the documentation. >>> >>> No regressions found. >>> >>> gdb/ChangeLog: >>> yyyy-mm-dd Sergio Durigan Junior >>> >>> * NEWS (Changes since GDB 8.0): Add entry about new >>> 'set-cwd-on-gdbserver' feature. >>> (New remote packets): Add entry for QSetWorkingDir. >>> * common/common-inferior.h (set_inferior_cwd): New prototype. >>> * infcmd.c (set_inferior_cwd): Remove "static". >>> * remote.c: Add PACKET_QSetWorkingDir. >>> (remote_protocol_features) : New entry for >>> PACKET_QSetWorkingDir. >>> (extended_remote_handle_inferior_cwd): New function. >>> (extended_remote_create_inferior): Call >>> "extended_remote_handle_inferior_cwd". >>> (_initialize_remote): Call "add_packet_config_cmd" for >>> QSetWorkingDir. >>> >>> gdb/gdbserver/ChangeLog: >>> yyyy-mm-dd Sergio Durigan Junior >>> >>> * inferiors.c (set_inferior_cwd): New function. >>> * server.c (handle_general_set): Handle QSetWorkingDir packet. >>> (handle_query): Inform that QSetWorkingDir is supported. >>> * win32-low.c (create_process): Pass "inferior_cwd" to >>> CreateProcess. >>> >>> gdb/testsuite/ChangeLog: >>> yyyy-mm-dd Sergio Durigan Junior >>> >>> * gdb.base/set-cwd.exp: Make it available on gdbserver. >>> >>> gdb/doc/ChangeLog: >>> yyyy-mm-dd Sergio Durigan Junior >>> >>> * gdb.texinfo (Starting your Program) : >>> Mention remote debugging. >>> (Working Directory) : >>> Likewise. >>> (Connecting) : Add "set-working-dir" >>> and "QSetWorkingDir" to the table. >>> (Remote Protocol) : New item, explaining the >>> packet. >>> --- >>> gdb/NEWS | 11 ++++++++++ >>> gdb/common/common-inferior.h | 4 ++++ >>> gdb/doc/gdb.texinfo | 44 ++++++++++++++++++++++++++++++++++---- >>> gdb/gdbserver/inferiors.c | 9 ++++++++ >>> gdb/gdbserver/server.c | 18 +++++++++++++++- >>> gdb/gdbserver/win32-low.c | 5 +++-- >>> gdb/infcmd.c | 5 ++--- >>> gdb/remote.c | 35 ++++++++++++++++++++++++++++++ >>> gdb/testsuite/gdb.base/set-cwd.exp | 14 ++++++++---- >>> 9 files changed, 131 insertions(+), 14 deletions(-) >>> >>> diff --git a/gdb/NEWS b/gdb/NEWS >>> index 0dcfcc98af..a0f78e4c35 100644 >>> --- a/gdb/NEWS >>> +++ b/gdb/NEWS >>> @@ -39,6 +39,14 @@ >>> variables that are to be set or unset from GDB. These variables >>> will affect the environment to be passed to the inferior. >>> >>> + ** On Unix systems, GDBserver is now able to enter a directory >>> + before starting an inferior. >>> + >>> + This is done by using the "cd" command in GDB, which instructs it >>> + to tell GDBserver about this directory change the next time an >>> + inferior is run. If you want to make GDBserver enter the >>> + directory your GDB is currently in, you can do a "cd ." in GDB. >> >> This all looks stale to me. > > Indeed, sorry about this mistake. I will rewrite the entry as follows: > > * New features in the GDB remote stub, GDBserver > > ** GDBserver is now able to enter a directory before starting an > inferior. > > 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. Actually, the first sentence is still wrong. How about: ** GDBserver is now able to set the inferior's current 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. ? -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/