Using a Debugger (cont)
Once you have an idea where the bug might be:
- set breakpoints slightly earlier in the code
- run the program again (supplying the same data)
- single-step through the suspect region of code
- check the values of suspect variables after each step
This will eventually reveal a variable which has an incorrect value.
|