From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15983 invoked by alias); 31 Aug 2017 21:03:07 -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 15948 invoked by uid 89); 31 Aug 2017 21:03:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 31 Aug 2017 21:03:04 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id v7VL2uQH020763 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 31 Aug 2017 17:03:01 -0400 Received: by simark.ca (Postfix, from userid 112) id C3E461EA24; Thu, 31 Aug 2017 17:02:56 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 2B3191E5DA; Thu, 31 Aug 2017 17:02:46 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 31 Aug 2017 21:03:00 -0000 From: Simon Marchi To: Sergio Durigan Junior Cc: GDB Patches , Pedro Alves Subject: Re: [PATCH v5] Implement the ability to set/unset environment variables to GDBserver when starting the inferior In-Reply-To: <20170831204932.25219-1-sergiodj@redhat.com> References: <20170629194106.23070-1-sergiodj@redhat.com> <20170831204932.25219-1-sergiodj@redhat.com> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 31 Aug 2017 21:02:56 +0000 X-IsSubscribed: yes X-SW-Source: 2017-08/txt/msg00547.txt.bz2 On 2017-08-31 22:49, Sergio Durigan Junior wrote: > Changes from v4: > > - Applied Simon's patch to refactor the unittest. Thanks, Simon! > > > This patch implements the ability to set/unset environment variables > on the remote target, mimicking what GDB already offers to the user. > There are two features present here: user-set and user-unset > environment variables. > > User-set environment variables are only the variables that are > explicitly set by the user, using the 'set environment' command. This > means that variables that were already present in the environment when > starting GDB/GDBserver are not transmitted/considered by this feature. > > User-unset environment variables are variables that are explicitly > unset by the user, using the 'unset environment' command. > > The idea behind this patch is to store user-set and user-unset > environment variables in two separate sets, both part of gdb_environ. > Then, when extended_remote_create_inferior is preparing to start the > inferior, it will iterate over the two sets and set/unset variables > accordingly. Three new packets are introduced: > > - QEnvironmentHexEncoded, which is used to set environment variables, > and contains an hex-encoded string in the format "VAR=VALUE" (VALUE > can be empty if the user set a variable with a null value, by doing > 'set environment VAR='). > > - QEnvironmentUnset, which is used to unset environment variables, and > contains an hex-encoded string in the format "VAR". > > - QEnvironmentReset, which is always the first packet to be > transmitted, and is used to reset the environment, i.e., discard any > changes made by the user on previous runs. > > The QEnvironmentHexEncoded packet is inspired on LLDB's extensions to > the RSP. Details about it can be seen here: > > > > > I decided not to implement the QEnvironment packet because it is > considered deprecated by LLDB. This packet, on LLDB, serves the same > purpose of QEnvironmentHexEncoded, but sends the information using a > plain text, non-hex-encoded string. > > The other two packets are new. > > This patch also includes updates to the documentation, testsuite, and > unit tests, without introducing regressions. That version LGTM. Thanks, Simon