
Dmitry Goncharov <dgoncharov <at> unison.com> writes:
On linux you can save your call stack in an exception object and read it in a catch block. Have a look at execinfo.h (usually /usr/include/execinfo.h). backtrace() is to obtain the backtrace. backtrace_symbols() is to get the function names of the addresses returned by backtrace(). backtrace_symbols() returns manged names, so you'll want to demangle the names with __cxa_demangle() (from cxxabi.h).
Br, Dmitry
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
This is very interesting, unfortunately backtrace() is not available on all systems (including mine, Solaris). Even if it was avaiable in mine, I don't think I would want to use it since I aim writing portable code in general. It would be great if a general, portable, standard way of retrieving the stacktrace was available, in the form of a library, since working with core-dumps is sometimes very impractical.