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

Adobe Director has a viewport that is updated while my application is running. For example, if I have a game application and I look at an instance of a ball object, I can see all its values ​​(speed, height, state variables, etc.) in real time as the application starts. I can also add any other object to the window and expand it into variables without stopping execution.

Is there a way in Visual Studio (I am in 2008), in C #, to have the Debug> Clock window updated while my application is running? In other words, I want to monitor the various variables of this object while the application is running, and not to freeze everything and check the state of things at a certain point in time.

If this is not possible, is there a way to observe the values ​​of arbitrary objects (without hard coding). For example, for a tank object, we would have position, orientation, speed, etc. Suppose dozens of different types of game objects have a dozen or so values. These values ​​change 60 times per second.

The goal is to select a game object to “view” at run time, and then expand it into a hierarchy of variables (just like an observer panel). Again, this tool does not know about objects in advance, so it cannot be hard-coded for certain objects.

Thanks in advance!

Adam

+3
source share
6 answers

If there is a specific value for the variable that you want to see, you can use a conditional breakpoint: http://msdn.microsoft.com/en-us/library/7sye83ce.aspx

And, of course, there is always a trusted ASSERT () macro for this.

, . #ifdef _DEBUG/# endif, . , , , .

+1

, , . .

+1

.

+1

:

http://msdn.microsoft.com/en-us/library/z4ecfxd9.aspx

  • "" "".
  • "" "" node "". IDE , node.
  • .
  • "".
0

, , . Trace.Writeline - ( ). , Tracepoints, , .

google, , , , , {}, , , ( , )

,

0

, , . TRACE, ?

TRACE(_T("m_LocationX: %d\n"), m_LocationX);
TRACE(_T("m_LocationY: %d\n"), m_LocationY);

, TRACE, , .


Edit 1: If you are not using MFC, take a look at this StackOverflow answer explaining an alternative method.

Edit 2: Repeating this question, it is unclear whether you are using C ++ or .Net. If you use C #, then you can achieve a similar result using Debugand TRACE- a good article describing their use can be found here .

0
source

Source: https://habr.com/ru/post/1708009/


All Articles