Getting stack backtrace for all instantiated threads
Hi All, I'm hoping someone can point me in the right direction ... I've got the bones of a stack trace based on backtrace, backtrace_symbols, and libcwd::demangle_symbol. This works fine as long as I'm only interested in the currently running thread's stack. But it would be really useful to get a picture (for an assert log) of the entire application. This means doing a stack trace on all created threads.
The path I'm dreading is getting each thread's stack (pthread_attr_getstack), and walking the stack "manually." Does anyone have an alternate direction that might yield a portable solution?
thanks in advance,
bcreane
|