Any way to peek at the exception currently being thrown?

Steven Schveighoffer schveiguy at gmail.com
Fri Jun 4 22:06:32 UTC 2021


On 6/4/21 5:24 PM, deadalnix wrote:
> On Friday, 4 June 2021 at 13:42:31 UTC, Steven Schveighoffer wrote:
>> Doesn't that mean that throwing an exception has to stuff the 
>> exception somewhere in TLS while in flight?
>>
>> I assumed it was just something stored as a local variable.
>>
> 
> Where would that local variable be, on stack? It has to be on TLS.

Why wouldn't it be on the stack?

catch(Exception e)
{
   // is e on the stack or TLS?
}

Honestly though, stack unwinding is black magic to me. I don't know how 
it works, but I'm pretty sure it worked before TLS was a thing in D.

-Steve


More information about the Digitalmars-d mailing list