First page Back Continue Last page Overview Graphics
Some tips
Be careful of stdout buffering
- Different if redirected to a file - always use stderr
Always use a stable machine
- Debugging on a machine with bad hardware is confusing!
Some things different on different architectures
- Some tools less stable (e.g. Gdb)
- Some tools not available (e.g. Valgrind)
- Some things not valid (e.g. Unaligned access)
Notes:
Finally some tips. The normal destination of printf (stdout) is buffered differently when redirected to a file; so you might not see any debug messages you added. Always send debug messages to stderr.
Programs which randomly crash might be due to a faulty piece of hardware - so don't waste effort debugging on bad hardware.
Not all the tools are as stable on all architectures.