user1391118
user1391118

Reputation: 265

Watching a variable whose value keep on changing

my question is related to debugging in VS 2010.i am creating an App in OpenGL using Kinect,As the x,y,z cordinates keep on changing so i want to keep track of each x,y,z coordinate.If you put a breakpoint at a certain expression then You have to click some STEP OUT or STEP OVER to again see the next value of variable.Is this possible to get the value of a variable at each instance without stopping the program?

Upvotes: 2

Views: 781

Answers (1)

Joe
Joe

Reputation: 2976

Yes. It's a watchpoint.

Set the breakpoint like normal, right click and choose (look out - here's the magic): When Hit.

From that dialog: Print a message, and then set it to something like: Coords: {x}, {y}, {z}

Note the bracing is how you specify to sub in a symbol value.

All output will show up in the debug output window and now you can set these anywhere anytime without having to use an API or recompile.

Upvotes: 2

Related Questions