How to continuously update VS2008 Watch Window (without stopping execution)?

"YOU AND THE ART OF ONLINE DATING" is the only product on the market that will take you step-by-step through the process of online dating, provide you with the resources to help ensure success. Get it now!

If there's a particular value of a variable that you want to watch for you can use a conditional breakpoint: msdn.microsoft.com/en-us/library/7sye83c... And of course there's always the trusty ASSERT() macro for that as well If you have really complicated debugging needs you may need to write custom code in your application just for debugging. Typically that sort of thing gets wrapped inside of #ifdef _DEBUG/#endif statements so that the release builds are not affected. You can support everything from the old standby of log file debugging up to writing a custom watch window that displays the current values that you need to see.

If there's a particular value of a variable that you want to watch for you can use a conditional breakpoint: msdn.microsoft.com/en-us/library/7sye83c... And of course there's always the trusty ASSERT() macro for that as well. If you have really complicated debugging needs you may need to write custom code in your application just for debugging. Typically that sort of thing gets wrapped inside of #ifdef _DEBUG/#endif statements so that the release builds are not affected.

You can support everything from the old standby of log file debugging up to writing a custom watch window that displays the current values that you need to see.

Hmmm... I'm looking to watch arbitrary objects that contain dozens of varialbles that update countinuously (like framerate) which change many times per second. I'd like to watch these change while the program as running as opposed to stopping the program completely and just getting a snapshot of things at one moment in time. – Adam Kane May 18 '09 at 1:50 You could set up some custom performance counters and watch them using Perfmon.

Or you could write a small custom app that you update using Names Pipes to show whatever data you wanted. – onedozenbagels May 18 '09 at 12:44.

This might help: msdn.microsoft.com/en-us/library/z4ecfxd... To turn automatic property evaluation on or off On the Tools menu, click Options. In the Options dialog box, open the Debugging node, and click General. Depending on your IDE settings, you may need to select Show all settings to see the Debugging node.

Select or clear Enable property evaluation and other implicit function calls. Click OK.

Hmm. I've got "Enable property evaluation" enabled. Still, elements in the watch window only update if/when a breakpoint is set and then hit.

– Adam Kane May 9 '09 at 21:07.

I'm not aware of a method of watching without being broken into the debugger however you could use a couple of different approaches. I would personally use trace for this with Trace. Writeline or something similar (I use a custom library).

However you could also get a quick solution using Tracepoints, which are breakpoints that output content to the output window. I had a brief google and this article seems to give an overview of how to set them, you put your variable names within { } and they are output to the output window, seemingly without breaking into the debugger (although behind the scenes that's exactly what it does) Hope that helps.

No luck. This approach writes thousands of lines of trace text to the output window per minute. I'm really looking for something that presents an updating treeview control of arbitrary object instances.

– Adam Kane May 9 '09 at 21:37.

Create a breakpoint, right click it, select on hit event, and setup printing of the variable there. This works.

No good. I need to observe a number of variables for a number of objects while things are running. Thanks though.

– Adam Kane Aug 8 '09 at 22:18.

I'm not sure it's possible to set the debug watch window continuously updating like you describe. Have you considered using the TRACE macro that will output content to the output panel as your application runs? TRACE(_T("m_LocationX: %d\n"), m_LocationX); TRACE(_T("m_LocationY: %d\n"), m_LocationY); Depending on how frequently the TRACE statements are executed your output window might get flooded, however it should at least give you the information you require at runtime.

Edit 1: If you're not using MFC, then take a look at this StackOverflow answer that explains an alternative method. Edit 2: Looking at this question again, it's not clear whether you're using C++ or . Net - If you're using C#, then you can achieve a similar result by using the Debug and Trace classes - a good article describing their use can be found here.

Hmmm, writing the values of dozens of object variables to the output window which are changing at 60fps isn't really practical as a way to monitor the values at runtime. Thanks though. – Adam Kane Aug 11 '09 at 16:33.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions