C++ Logo

std-proposals

Advanced search

Re: Adding stacktrace to std::exception

From: Marcin Jaczewski <marcinjaczewski86_at_[hidden]>
Date: Fri, 13 Nov 2020 09:56:39 +0100
pt., 13 lis 2020 o 07:54 Thiago Macieira via Std-Proposals
<std-proposals_at_[hidden]> napisaƂ(a):
>
> On Thursday, 12 November 2020 06:14:52 PST Antony Polukhin via Std-Proposals
> wrote:
> > 1) Implement __cxa_allocate_exception2 that allocates (see note 0)
> > additional space (see note 1) to store the stacktrace AND puts a mark
> > (see note 2) into the allocated memory, that this is an exception with
> > a stacktrace
>
> Another note: one condition for throwing exceptions is being out of memory. So
> the implementation must figure out how to throw an exception when it can't
> allocate space for the stack trace.
>
> Also, stack traces' size are not known at compile time, unlike exceptions
> classes.
>

Do we need a full stack trace to be this useful?
Let say that Standard guarantees only last 20 positions from it.
Rest will be available only if there is free memory for it.

> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
> Software Architect - Intel DPG Cloud Engineering
>
>
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2020-11-13 02:56:50