Sunday, February 6, 2011

Debugging: Setting Breakpoints

What is a Breakpoint?
A breakpoint is a specified point in the program where program execution pauses. During this pause, the values of variables, parameters and other objects may be examined.

How do I set a Breakpoint?
Place your cursor in the margin of the code editor and double-click. You will now see a red bullet in the margin, this represents the breakpoint. Double-click to remove.


Run your project. When program execution reaches the breakpoint, the program will enter break mode. You will notice that the current  breakpoint is highlighted with a yellow background.



While in break mode, use your mouse to hover over the names of variables, parameters and other objects to see the value they currently store.





If you have multiple break points, click the play button to reach each subsequent breakpoint.

Further reading:
MSDN: Debugging basics. Breakpoints http://msdn.microsoft.com/en-us/library/4607yxb0.aspx
Wikipedia: Breakpoints http://en.wikipedia.org/wiki/Breakpoint

No comments:

Post a Comment