fix Issue 15886 - Add an uncaught exception handler #1533
Conversation
Thanks for your pull request, @CyberShadow! Bugzilla references
|
8726582
to
8a8687b
Compare
For some reason the exception passed to the handler doesn't have a stack trace (when printed with |
If you are asking me about win32, you are barking at the wrong tree :) |
So in Linux, if no special handler is used, |
Ah, git-blame pointed me to 04e29d1, sorry. @donc? :)
Well, if there are no exception frames, there is nowhere to unwind to. Normally there is a top-level frame in |
As far as I can tell that is not true, output of a small test:
Not sure why I see |
https://github.com/D-Programming-Language/druntime/blob/master/src/rt/dwarfeh.d#L223-L224 which calls https://github.com/D-Programming-Language/druntime/blob/master/src/rt/dwarfeh.d#L805-L809 |
Ah, makes sense now. |
SetUnhandledExceptionFilter will probably help, see https://msdn.microsoft.com/en-us/library/ms680634.aspx |
8a8687b
to
d41dc8a
Compare
d41dc8a
to
639878d
Compare
Thanks. That's probably going too far for this pull request, so it's probably better to declare that this feature is unsupported on Win32. |
A test would be much easier to write once #1538 is in. |
639878d
to
446e4b9
Compare
See how I got the test for the same functionality, albeit only for dwarfeh: https://github.com/dlang/druntime/pull/1673/files#diff-eb6feae96258d70e7e610bffc21427bc I was not aware of this PR when writing my own, I guess we shouldn't leave them too long to rot :(. |
@CyberShadow Care to take another look at this? |
This would be nice to have for certain situations but does need some more thinking (especially how to approach the platform disparity). |
https://issues.dlang.org/show_bug.cgi?id=15886
I'm not sure how to do the win32 part. @llucax?