Entry point for exception handling support routines.
There are three style of exception handling being supported by DMD:
DWARF, Win32, and Win64. The Win64 code also supports POSIX.
Support for those scheme is in
rt, respectively, and publicly imported here.
When an exception is thrown by the user, the compiler translates
throw e; into either
_d_throwdwarf (for DWARF exceptions)
_d_throwc (Win32 / Win64), with the
Exception object as argument.
During those functions' handling, they eventually call
which will store inside the
Exception object the return of
_d_traceContext, which is an object implementing
_d_traceContext is a configurable hook, and by default will call
core, which itself will call
or something similar to store an array of stack frames (
in the object it returns.
defaultTraceHandler returns a GC-allocated instance,
hence a GC allocation can happen in the middle of throwing an
Throwable-implementing should not resolves function names,
file and line number until its
opApply function is called, avoiding the
overhead of reading the debug infos until the user call
If the user only calls
Throwable (or use
only the overhead of
backtrace will be paid, which is minimal enouh.
Distributed under the Boost Software License 1.0. (See accompanying file LICENSE)