static basic_stacktrace from_current_exception(const allocator_type& alloc = allocator_type()) noexcept;
I am wondering, if there should then also be a function like this:static basic_stacktrace from_exception(std::exception_ptr p, const allocator_type& alloc = allocator_type()) noexcept;
Such that you are not only able to query the stacktrace from the
current exception, but from any exception that was thrown in the
past.Hi again!
We benchmarked the prototype in its current form to estimate the overhead that the trace capture adds when an exception is thrown.
It seems that it slows down a lot, so we edited the paper and now it proposed to regulate the stacktrace capture with the runtime option `std::this_thread::capture_stacktraces_at_throw`, which is disabled by default.
New version of proposal with full motivation can be found here - https://htmlpreview.github.io/?https://github.com/axolm/libsfe/blob/master/paper/stacktrace_from_exception.html
What do you think about this?