32 struct _Unwind_Context
50 private_personality(
_Unwind_Action action, _Unwind_Context *context)
52 if (
auto pl = context->fde.cie().personality_function())
54 if (
auto pr = *(reinterpret_cast<__personality_routine *>(pl)))
57 context->exception_object->exception_class,
58 context->exception_object, context);
70 find_and_store_fde(_Unwind_Context *context)
79 private_phase1(_Unwind_Context *context)
83 result = find_and_store_fde(context);
91 result = find_and_store_fde(context);
95 switch (private_personality(_UA_SEARCH_PHASE, context))
98 context->exception_object->private_1 = context->fde.pc_begin();
105 ABORT(
"phase 1 personality routine failed");
113 private_phase2(_Unwind_Context *context)
117 result = find_and_store_fde(context);
125 auto action = _UA_CLEANUP_PHASE;
127 result = find_and_store_fde(context);
131 if (context->exception_object->private_1 == context->fde.pc_begin())
132 action |= _UA_HANDLER_FRAME;
134 switch (private_personality(action, context))
137 context->state->resume(); __builtin_unreachable();
143 ABORT(
"phase 2 personality routine failed");
162 auto context = _Unwind_Context(&state, exception_object);
164 ret = private_phase1(&context);
169 context = _Unwind_Context(&state, exception_object);
171 ret = private_phase2(&context);
185 auto context = _Unwind_Context(&state, exception_object);
187 private_phase2(&context);
201 return context->state->get(static_cast<uint64_t>(index));
207 context->state->set(static_cast<uint64_t>(index), value);
208 context->state->commit();
214 return context->state->get_ip();
220 context->state->set_ip(value);
221 context->state->commit();
227 return context->fde.lsda();
233 return context->fde.pc_begin();
239 if (ip_before_insn ==
nullptr)
240 ABORT(
"ip_before_insn == 0");
static void unwind(const fd_entry &fde, register_state *state=nullptr)
void __store_registers_intel_x64(registers_intel_x64_t *state)
uintptr_t _Unwind_GetIP(_Unwind_Context *context)
_Unwind_Exception_Cleanup_Fn exception_cleanup
uintptr_t _Unwind_GetRegionStart(_Unwind_Context *context)
uintptr_t _Unwind_GetGR(_Unwind_Context *context, int index)
auto index(const T virt, const F from)
static fd_entry find_fde(register_state *state)
void _Unwind_SetIP(_Unwind_Context *context, uintptr_t value)
void _Unwind_SetGR(_Unwind_Context *context, int index, uintptr_t value)
void _Unwind_DeleteException(_Unwind_Exception *exception_object)
void _Unwind_Resume(_Unwind_Exception *exception_object)
uintptr_t _Unwind_GetIPInfo(_Unwind_Context *context, int *ip_before_insn)
_Unwind_Reason_Code _Unwind_RaiseException(_Unwind_Exception *exception_object)
uintptr_t _Unwind_GetLanguageSpecificData(_Unwind_Context *context)