While developing mysql-proxy I sometimes have to step-by-step refactoring that usually result in unstable code for a while until the unit-tests are happy again. When a unit-test fails I usually use gdb as a wrapper and let it create a stack-trace for me: $ gdb --command=backtrace.gdb --args /path/to/my/testcase The --command option is used to automate gdb: run thread apply all bt quit If the test