Welcome to MSDN Blogs Sign in | Join | Help

$env=0

Winning the award for the least understandable UI metaphor: the ability to view the environment variables in the target when native debugging.  This is yet another tiny undocumented feature of the native expression evaluator in VS.  $env falls under the same extravagant disclaimer from the @clk post.

 

Place $env in the watch window and you get … the size in bytes of your environment block. 

 

Wow.

 

Far more useful is to type "$env=0", which evaluates to "0", and dumps all the Environment Variables to the output window.  If you use the Immediate window "?$env=0" you get everything inline.  The feature requires you to be native (or interop) debugging and to evaluate it from a native frame.  

 

Despite the insane UI interaction, the end result is very useful information.

Published Saturday, October 15, 2005 3:18 PM by SteveJS
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: $env=0

How come it doesn't work when I do it in VS2005?

It says: The name '$env' does not exist in the current context.

Thanks!

Noli
Tuesday, March 21, 2006 11:53 PM by Noli San Jose

# Viewing Debugee Environment ariablesV « Ofek’s Visual C++ stuff

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker