[Dlang-internal] Dlang structured exception handling on Windows

KytoDragon kytodragon at e.mail.de
Tue Mar 20 17:14:02 UTC 2018


On Monday, 19 March 2018 at 19:09:01 UTC, Adam D. Ruppe wrote:
> Look in druntime src/rt/dmain2.d for "trapExceptions". It is 
> set to true except "IsDebuggerPresent". That catches everything.
>
> With this overridden we can get some code running without the 
> exception catch wrapper. Works on 32 bit windows at least.
>
>
> Ideally, we'd just get the commandline/envvar switch to 
> disable... and the PR stalled for ages then the author moved on 
> https://github.com/dlang/druntime/pull/1538 we just should 
> revive that and get it up ASAP. Much better solution than the 
> filthy hack above.

I think you missunderstood my problem. I don't mean D-Exceptions, 
I mean Windows SEH-Exceptions. These are not caught by D's try 
... catch and even your example shows the exact same behaviour. 
(on DMD at least, LDC complains about the redefined symbol 
"_d_run_main")

EDIT: Ignore everything. It was my IDE that was swallowing 
exceptions not the compiler.


More information about the Dlang-internal mailing list