[Issue 15886] New: Add an uncaught exception handler
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Apr 6 09:54:43 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=15886
Issue ID: 15886
Summary: Add an uncaught exception handler
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P3
Component: druntime
Assignee: nobody at puremagic.com
Reporter: thecybershadow at gmail.com
The runtime should provide a hook for uncaught exceptions which will be
executed BEFORE the stack is unwound, when rt_trapExceptions is set to 0.
Currently, it is too difficult to get a debugger on a live program for an
uncaught exception before the stack has been unwound. Unwinding the stack means
that function arguments and local variables from the program's state at the
point when the exception is thrown is not accessible.
Currently, rt.dwarfeh calls terminate(__LINE__) which calls abort(),
rt.deh_win64_posix calls terminate() which halts, and deh_win32 passes the
exception to the OS (which shows the standard Windows "program has stopped
working" dialog). Although it's possible to trap these in a debugger by
breakpointing the relevant functions from Druntime, doing so is
platform-dependent and vulnerable to breaking due to changes in Druntime, such
as the recent dwarf EH switch.
--
More information about the Digitalmars-d-bugs
mailing list