rt.dwarfeh

Exception handling support for Dwarf-style portable exceptions.

Members

Functions

__dmd_begin_catch
Throwable __dmd_begin_catch(_Unwind_Exception* exceptionObject)

The first thing a catch handler does is call this.

__dmd_personality_v0
_Unwind_Reason_Code __dmd_personality_v0(int ver, _Unwind_Action actions, _Unwind_Exception_Class exceptionClass, _Unwind_Exception* exceptionObject, _Unwind_Context* context)

"personality" function, specific to each language. This one, of course, is specific to DMD.

_d_eh_swapContextDwarf
void* _d_eh_swapContextDwarf(void* newContext)

Called when fibers switch contexts.

_d_throwdwarf
void _d_throwdwarf(Throwable o)

Called by D code to throw an exception via

actionTableLookup
int actionTableLookup(_Unwind_Exception* exceptionObject, uint actionRecordPtr, const(ubyte)* pActionTable, const(ubyte)* tt, ubyte TType, _Unwind_Exception_Class exceptionClass, const(ubyte)* lsda)

Look up classType in Action Table.

getClassInfo
ClassInfo getClassInfo(_Unwind_Exception* exceptionObject, const(ubyte)* currentLsd)

Look at the chain of inflight exceptions and pick the class type that'll be looked for in catch clauses.

getCppPtrToThrownObject
void* getCppPtrToThrownObject(_Unwind_Exception* exceptionObject, CppTypeInfo sti)

Get Pointer to Thrown Object if type of thrown object is implicitly convertible to the catch type.

sLEB128
_sleb128_t sLEB128(const(ubyte)** p)

Decode Signed LEB128.

scanLSDA
LsdaResult scanLSDA(const(ubyte)* lsda, _Unwind_Ptr ip, _Unwind_Exception_Class exceptionClass, bool cleanupsOnly, bool preferHandler, _Unwind_Exception* exceptionObject, _Unwind_Ptr landingPad, int handler)

Read and extract information from the LSDA (aka gcc_except_table section). The dmd Call Site Table is structurally different from other implementations. It is organized as nested ranges, and one ip can map to multiple ranges. The most nested candidate is selected when searched. Other implementations have one candidate per ip.

uLEB128
_uleb128_t uLEB128(const(ubyte)** p)

Decode Unsigned LEB128.

Interfaces

CppTypeInfo
interface CppTypeInfo

Access C++ std::type_info's virtual functions from D, being careful to not require linking with libstd++ or interfere with core.stdcpp.typeinfo. So, give it a different name.

Structs

CppExceptionHeader
struct CppExceptionHeader

The C++ version of D's ExceptionHeader wrapper

ExceptionHeader
struct ExceptionHeader

Wrap the unwinder's data with our own compiler specific struct with our own data.

Variables

cppExceptionClass
enum _Unwind_Exception_Class cppExceptionClass;

C++ Support ****************************

Meta

License

Distributed under the Boost Software License 1.0. (See accompanying file LICENSE)

Authors

Walter Bright