gdb/2210: 'set env' and 'shell' Underlying Environments are Different

Daniel Jacobowitz drow@false.org
Thu Dec 7 15:28:00 GMT 2006


The following reply was made to PR gdb/2210; it has been noted by GNATS.

From: Daniel Jacobowitz <drow@false.org>
To: mbgdbgnu@bytnar.net
Cc: gdb-gnats@sources.redhat.com
Subject: Re: gdb/2210: 'set env' and 'shell' Underlying Environments are Different
Date: Thu, 7 Dec 2006 10:17:58 -0500

 On Mon, Dec 04, 2006 at 05:38:57PM -0000, mbgdbgnu@bytnar.net wrote:
 > set env CURTIME=1165253337
 > show env CURTIME
 > shell date -d '1970-01-01 $CURTIME sec'
 
 Your quoting is wrong; this will use a literal '$CURTIME'.
 
 > The third command fails, because the 'set env' and 'shell' do not share the same environment.
 
 (gdb) help set env
 Set environment variable value to give the program.
 Arguments are VAR VALUE where VAR is variable name and VALUE is value.
 VALUES of environment variables are uninterpreted strings.
 This does not affect the program until the next "run" command.
 
 Right or wrong, that's at least what they're documented to do; set env
 only affects run.  The opposite behavior would, I think, be very
 confusing.  Suppose you set an LD_PRELOAD for the program you
 wanted to debug; it shouldn't apply to "shell grep".
 
 -- 
 Daniel Jacobowitz
 CodeSourcery



More information about the Gdb-prs mailing list