21.2. Using the Visual Studio debugger

A typical debugging situation you face is that your program crashes. Your first problem is to find the line in your code which precipitates the crash.

First of all, make sure to press F5 so as to run the program in the debugger with all the debugging tools turned on. (In order to run outside the debugger to see how fast it can run, you use Ctrl+F5.) Breakpoints won’t work, for instance, unless you are running a Debug build with the debugging tools turned on. Note that a simple Build | Execute will not invoke all the debugging tools, even if you are running the Debug build. You can use the F5 key to invoke the Debug | Run when you want to run your program and have it notice the breakpoints.

Finding the ...

Get Software Engineering and Computer Games now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.