Examining Program State (cont)
An alternative for obtaining access to program state:
- a tool that allows you to stop program execution at a certain point
- and then allows you to inspect the state (preferably selectively)
This is precisely what debuggers such as gdb provide.
Debuggers also allow you to inspect the state of a program that has
crashed due to a run-time error.
Often, this takes you straight to the point where the bug occurred.
|