C++ Logo

std-proposals

Advanced search

Re: Stacktrace from exception

From: Kilian Henneberger <kilis-mail_at_[hidden]>
Date: Fri, 21 May 2021 22:41:05 +0200
Hi,
you propose following function:

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.

Thanks a lot for putting your time and energy into this!
Regards,
Kilian


Am 21.05.2021 um 16:00 schrieb Андрей Некрашевич via Std-Proposals:
> 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
> <https://htmlpreview.github.io/?https://github.com/axolm/libsfe/blob/master/paper/stacktrace_from_exception.html>
>
> What do you think about this?
>


Received on 2021-05-21 15:41:10