This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: environment for 'shell' command
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Andrew Cagney <ac131313 at ges dot redhat dot com>
- Cc: kraftche at cae dot wisc dot edu, gdb at sources dot redhat dot com
- Date: Mon, 9 Sep 2002 16:23:06 -0400
- Subject: Re: environment for 'shell' command
- References: <3D359FDE.4453EA90@cae.wisc.edu> <3D7CEC52.3000504@ges.redhat.com>
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