From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 103828 invoked by alias); 31 Aug 2017 21:26:37 -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 103462 invoked by uid 89); 31 Aug 2017 21:26:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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, 31 Aug 2017 21:26:35 +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 9A7A57F6BA; Thu, 31 Aug 2017 21:26:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9A7A57F6BA Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.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 6E2D75D6A6; Thu, 31 Aug 2017 21:26:34 +0000 (UTC) From: Sergio Durigan Junior To: Simon Marchi Cc: GDB Patches , Pedro Alves Subject: Re: [PATCH v5] Implement the ability to set/unset environment variables to GDBserver when starting the inferior References: <20170629194106.23070-1-sergiodj@redhat.com> <20170831204932.25219-1-sergiodj@redhat.com> Date: Thu, 31 Aug 2017 21:26:00 -0000 In-Reply-To: (Simon Marchi's message of "Thu, 31 Aug 2017 23:02:46 +0200") Message-ID: <87o9qv5sza.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-08/txt/msg00549.txt.bz2 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 -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/