From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17660 invoked by alias); 10 Jan 2014 15:18:48 -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 17647 invoked by uid 89); 10 Jan 2014 15:18:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 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, 10 Jan 2014 15:18:47 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0AFIj6c023766 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 10 Jan 2014 10:18:45 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s0AFIiKc005411 for ; Fri, 10 Jan 2014 10:18:45 -0500 Message-ID: <52D00F54.3060305@redhat.com> Date: Fri, 10 Jan 2014 15:18:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: GDB Patches Subject: [PATCH] [doc] Mention that "set environment" affects the shell too. Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-01/txt/msg00283.txt.bz2 Looking through my local branches, I found this leftover patch from when I made "set startup-with-shell" a runtime knob a while ago... OK? -------- Subject: [PATCH] [doc] Mention that "set environment" affects the shell too. gdb/doc/ 2014-01-10 Pedro Alves * gdb.texinfo (Your Program's Environment) : Mention the shell, and point at 'set exec-wrapper'. --- gdb/doc/gdb.texinfo | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 74ddcf5..e4cff84 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -2089,6 +2089,7 @@ your program too late, as the program would have already completed the elaboration phase. Under these circumstances, insert breakpoints in your elaboration code before running your program. +@anchor{set exec-wrapper} @kindex set exec-wrapper @item set exec-wrapper @var{wrapper} @itemx show exec-wrapper @@ -2279,9 +2280,10 @@ your program. You can abbreviate @code{environment} as @code{env}. @kindex set environment @item set environment @var{varname} @r{[}=@var{value}@r{]} Set environment variable @var{varname} to @var{value}. The value -changes for your program only, not for @value{GDBN} itself. @var{value} may -be any string; the values of environment variables are just strings, and -any interpretation is supplied by your program itself. The @var{value} +changes for your program (and the shell @value{GDBN} uses to launch +it), not for @value{GDBN} itself. @var{value} may be any string; the +values of environment variables are just strings, and any +interpretation is supplied by your program itself. The @var{value} parameter is optional; if it is eliminated, the variable is set to a null value. @c "any string" here does not include leading, trailing @@ -2298,6 +2300,12 @@ tells the debugged program, when subsequently run, that its user is named @samp{foo}. (The spaces around @samp{=} are used for clarity here; they are not actually required.) +Note that on Unix systems, @value{GDBN} runs your program via a shell, +which also inherits the environment set with @code{set environment}. +If necessary, you can avoid that by using the @samp{env} program as a +wrapper instead of using @code{set environment}. @xref{set +exec-wrapper}, for an example doing just that. + @kindex unset environment @item unset environment @var{varname} Remove variable @var{varname} from the environment to be passed to your -- 1.7.11.7