Next: Tools
Up: Debugging Tips
Previous: Identifying the source of
There are several methods that are commonly used to determine sources of
errors:
- Verbose inline messages: Obliterate your code with if statements and
attempt to detect various errors.
- assert(...). In C and C++, you can use the assert(...) macro to halt
your program if the specified condition is not met. A valid use of
assert(...) might be
assert(x==5);
- Use a debugger to step through your code.
- Use a memory profiler to detect bad uses of heap memory.
- Use a ``Instrumentation system'', ie. Valgrind to detect various errors.
Subsections
Spencer Eugene Olson
2005-01-19