I want to inform you about a new debugging tool to sample. I give you its sourceforge short description:
This library, linked with C++ code, using GNU g++ on a POSIX platform, simulates the call stack for all threads with minimum overhead. When an exception is thrown one can print a stack trace (similar to Java's exception.printStackTrace() method), at any place in the code (most usually in the exception catch sections), showing the path the exception followed, unwinding the stack, from the throw point up to the point where the exception was caught and handled. The library automatically loads the symbol tables of the executable and any (chosen) dynamic libraries and demangles them to complete function signatures. The library automatically binds function names to addresses (even for dynamic library symbols). It has methods to report the call stack of all threads at any time. This is particularly useful in cases of fatal errors, before the program aborts/exits, such as segmentation faults. It can also be used as the base for your instrumentation code.