C++ Logo


Advanced search

Re: Adding stacktrace to std::exception

From: Thiago Macieira <thiago_at_[hidden]>
Date: Thu, 12 Nov 2020 22:53:49 -0800
On Thursday, 12 November 2020 06:14:52 PST Antony Polukhin via Std-Proposals
> 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

Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DPG Cloud Engineering

Received on 2020-11-13 00:53:54