From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42912 invoked by alias); 5 Sep 2017 15:33:05 -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 42338 invoked by uid 89); 5 Sep 2017 15:33:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=transmitted X-HELO: foss.arm.com Received: from usa-sjc-mx-foss1.foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 05 Sep 2017 15:33:00 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 86FB813D5; Tue, 5 Sep 2017 08:32:58 -0700 (PDT) Received: from [10.2.206.52] (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F1FB53F540; Tue, 5 Sep 2017 08:32:57 -0700 (PDT) Subject: Re: [PATCH v5] Implement the ability to set/unset environment variables to GDBserver when starting the inferior To: Sergio Durigan Junior Cc: GDB Patches References: <20170629194106.23070-1-sergiodj@redhat.com> <20170831204932.25219-1-sergiodj@redhat.com> <87o9qv5sza.fsf@redhat.com> From: Thomas Preudhomme Message-ID: <2aea3170-004a-bfe1-3e57-f7e3238167fb@foss.arm.com> Date: Tue, 05 Sep 2017 15:33:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <87o9qv5sza.fsf@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00090.txt.bz2 Hi Sergio, I noticed that the share-env-with-gdbserver.exp test you added is skipped if using a gdb stub. However the comment says the test is meaningless for native-gdbserver. Shouldn't the check also look whether this is a cross debugger? Best regards, Thomas On 31/08/17 22:26, Sergio Durigan Junior wrote: > On Thursday, August 31 2017, Simon Marchi wrote: > >> 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 for all the reviews. > > Pushed: > 0a2dde4a321d2f7bd2ded9a558b9ae92892de0e2 >