Original stacktrace from std::exception_ptr is not possible currently. std::current_exception() makes a copy of current exception object into returned std::exception_ptr. So the tracking of the original exception object and its stacktrace are lost.
Support for nested exceptions ~is not much meaningful IMO, it~ complicates the implementation (see the last commit). Without nested exceptions support, one can always get stacktrace from current exception immediately after entering catch block, but it loses the original stacktrace for rethrow_after_other_exception case.
The exception object is destroyed by __DestructExceptionObject exported from vcruntime.dll, there is no simple way to cleanup stored traces in time unless override __DestructExceptionObject.
coverage: 86.308%. remained the same
when pulling f76e128ab300abdff687590a075aac9e21844247 on huangqinjin:msvc-stacktrace-from-current-exception
into 351b03d5220510a1b6738cc378659b6d85c8a4da on boostorg:develop.
Original stacktrace from
std::exception_ptr
is not possible currently.std::current_exception()
makes a copy of current exception object into returnedstd::exception_ptr
. So the tracking of the original exception object and its stacktrace are lost.Support for nested exceptions ~is not much meaningful IMO, it~ complicates the implementation (see the last commit). Without nested exceptions support, one can always get stacktrace from current exception immediately after entering
catch
block, but it loses the original stacktrace forrethrow_after_other_exception
case.The exception object is destroyed by
__DestructExceptionObject
exported fromvcruntime.dll
, there is no simple way to cleanup stored traces in time unless override__DestructExceptionObject
.