c++ stacktrace from the function an exception is thrown?
问题 I can make use of gcc's backtrace to obtain a stack trace at any given point of a program, but I would like to obtain the trace from whatever frame the stack was in at the time an exception is thrown, ie prior to the stack unwinding. For instance, the following block func() { throw std::exception(); } try { func(); } catch ( std::exception ) { std::cout << print_trace(); //do stuff } ought to still be able to retain a frame for func() somehow. This has been asked before, but it involved an