This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: environment for 'shell' command


On Mon, Sep 09, 2002 at 02:45:38PM -0400, Andrew Cagney wrote:
> >Hi,
> >
> >I would like the ability to pass the file name and line number of the
> >source corresponding to the selected stack frame to a program started
> >via the 'shell' command.  I could not find any way to do this in gdb. 
> >If there is a way to do this, please let me know (and disregard the rest
> >of this message.)  I decided to add this functionality but I am
> >unfimiliar with the internal workings of gdb.  The following is a
> >description of what I did to implement this.  I'd really appreciate any
> >suggestions on better ways to implement this, error conditions I'm not
> >handling, etc.
> 
> Off hand I can think of two ways to handle this:
> 
> -- extend what you've proposed by including commands to explicitly 
> manipulate the exported environment, vis:
> (gdb) command-to-set-shell-env VARIABLE VALUE
> (gdb) shell printenv VARIABLE
> VARIABLE=VALUE
> (gdb)
> where VALUE is something that GDB could evaluate.

Why not just use the inferior environment (set env, show env)?  It's
not always appropriate, but usually it would be... and it's much more
natural, I think.

Just a thought.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]