Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Follow an object state in Visual Studio debug mode

Say I have a WinForm, in which I have a private int selectedObjectsCount.

Is there a way in debug mode to "follow" this object state through the debug session?

Or, other case, I have a myFont instance. I want to see in what moment its property IsBold changes (is modified)

I need a trace, because an object became "bad valued" and I don't understand where that happens.

Is something similar possible in VS 2010?

like image 236
serhio Avatar asked Mar 25 '26 03:03

serhio


1 Answers

Make a breakpoint wherever suitable to see when object changes, right click breakpoint and select "When hit..." here you can print the object content in a debug window -- effectively seeing when the object changes and to what.

At any breakpoint you will have a full trace in the "Call stack" debug window.

The art of debugging is something you should value and learn (it will pay off). See this page for a very simple overview of debugging alternatives in VS.

like image 58
Tedd Hansen Avatar answered Mar 27 '26 17:03

Tedd Hansen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!