Getting the backtrace from the catch block
I am using backtrace to get the information from where the exception is thrown. In the constructor of my exception, I am storing the backtrace in a std::string, and in the catch block for exceptions of this type, I am printing this backtrace. But I was wondering, is it possible to somehow get the same backtrace in the catch block for other exception types? I don't think so. When executons stops in catch block the stack is unwound, and all that has happened before is not in stack anymore. You might be interested in a Boost library under development: Portable Backtrace . Example: #include <boost