• Advertisement
Sign in to follow this  

Tracing / Watching a variable in VS .Net

This topic is 3958 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey everyone :) I would just like to ask how would i go about tracing / watching a variable in VS .Net. In case it is called something else, what i am talking about it setting a breakpoint in my program, and then being able to see what, for example, the value of x is at the moment :) Thank you ^^

Share this post


Link to post
Share on other sites
Advertisement
In the Debug menu, you can open the Watch, Local, This, and Autos windows, which display variables. you can also put the mouse over a variable to get its value. The values don't update until the program hits a breakpoint. It only works if there is debug info (which is normally the case in a Debug configuration).

Share this post


Link to post
Share on other sites
Simply hover your mouse over any active varible to see it's contents. To monitor it easier, just right click on it, while the program is at a breakpoint, and hit "watch".

Share this post


Link to post
Share on other sites
Now, if you want to break each time the variable (or the memory pointing to this variable) is read and/or write, you can set a data breakpoint as well (unfortuately, it seems that VC++ 2005 EE doesn't support this feature. however, you can still get the same features using this small utility library).

Share this post


Link to post
Share on other sites
Thank you all very much :) This is exactly what i was looking for.
The irony is, i was looking at the right place, just not at the right window :)

And i am not using EE, thanks a lot for the tip Emmanuel, this will come in very useful.

Thanks again ^^

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement