There is no single best approach to debugging. CodeView offers a variety of debugging tools that let you select a method appropriate for the program or for your work habits. This section describes some approaches to solving debugging problems.
Broadly speaking, two things can go wrong in a program:
The program doesn't manipulate the data the way you expected it to.
The flow of execution is incorrect.
These problems usually overlap. Incorrect execution can corrupt the data, and bad data can cause execution to take an unexpected turn. Because CodeView allows you to trace program execution while simultaneously displaying whatever combination of variables you want, you don't have to know ahead of time whether the problem is bad data manipulation, a bad execution path, or some combination of both.
CodeView has specific features that deal with the problems of bad data and incorrect execution:
You can view and modify any program variable, any section of memory, or any processor register. These features are explained in Section 15.3, “Viewing and Modifying Program Data.”
You can monitor the path of execution and precisely control where execution pauses. These features are explained in Section 15.4, “Controlling Execution.”