Examining Program State
A vital tool for debugging is a mechanism to display state.
One method: diagnostic printf statements of "suspect" variables.
Problems with this approach:
- it changes the program
(so you're not debugging quite the same thing)
- you may guess wrong about what the suspect variables are
- generally too much is printed
(e.g. printing to trace execution of a loop)
|