On Thu, Jul 07, 2005 at 02:27:18PM +0100, Jonathan Haslam wrote:
> I hadn't actually noticed as I'd never tried to use the
> ::getenv dcmd before but, by default, it doesn't operate
> on the target process. This kind of surprised me.
> 
> I understand the need to be able to prepare an environment
> for a process that I'm going to ::run but I'd have expected
> that the default when I'm attached to a process or debugging
> a core would be the target I'm currently debugging. Maybe
> it's just me.

The ::getenv and ::setenv dcmds were designed to be consistent in their
behavior.  Because ::getenv must operate on idle targets, and ::setenv
cannot modify the target's environment, it would be disconcerting to
have ::getenv behave differently based on the target's state.  Not to
mention that if you ran ::setenv, you would not see your changes
reflected by ::getenv.  The '-t' option to ::getenv does what you want,
but we didn't make it the default for the reasons outlined above.

> The ::getenv and ::setenv dcmd didn't seem to make it
> into the mdb guide for Solaris 10 so I'll log a doc bug.
> I'll also log an rfe for a more descriptive help message
> on ::getenv.

The help message would be a useful addition, and a nice oss-bite-size
RFE.

- Eric

--
Eric Schrock, Solaris Kernel Development.

Reply via email to