#ifndef __UNWIND_H__
#define __UNWIND_H__
#include <stdint.h>
#include <stddef.h>
#include <Availability.h>
typedef enum {
_URC_NO_REASON = 0,
_URC_FOREIGN_EXCEPTION_CAUGHT = 1,
_URC_FATAL_PHASE2_ERROR = 2,
_URC_FATAL_PHASE1_ERROR = 3,
_URC_NORMAL_STOP = 4,
_URC_END_OF_STACK = 5,
_URC_HANDLER_FOUND = 6,
_URC_INSTALL_CONTEXT = 7,
_URC_CONTINUE_UNWIND = 8
} _Unwind_Reason_Code;
typedef enum {
_UA_SEARCH_PHASE = 1,
_UA_CLEANUP_PHASE = 2,
_UA_HANDLER_FRAME = 4,
_UA_FORCE_UNWIND = 8,
_UA_END_OF_STACK = 16 } _Unwind_Action;
struct _Unwind_Context; struct _Unwind_Exception;
struct _Unwind_Exception {
uint64_t exception_class;
void (*exception_cleanup)(_Unwind_Reason_Code reason, struct _Unwind_Exception* exc);
uintptr_t private_1; uintptr_t private_2; #if !__LP64__
uint32_t reserved[3];
#endif
};
typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)
(int version,
_Unwind_Action actions,
uint64_t exceptionClass,
struct _Unwind_Exception* exceptionObject,
struct _Unwind_Context* context,
void* stop_parameter );
typedef _Unwind_Reason_Code (*__personality_routine)
(int version,
_Unwind_Action actions,
uint64_t exceptionClass,
struct _Unwind_Exception* exceptionObject,
struct _Unwind_Context* context);
#ifdef __cplusplus
extern "C" {
#endif
#if __arm__
extern _Unwind_Reason_Code _Unwind_SjLj_RaiseException(struct _Unwind_Exception* exception_object);
extern void _Unwind_SjLj_Resume(struct _Unwind_Exception* exception_object);
#else
extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception* exception_object);
extern void _Unwind_Resume(struct _Unwind_Exception* exception_object);
#endif
extern void _Unwind_DeleteException(struct _Unwind_Exception* exception_object);
extern uintptr_t _Unwind_GetGR(struct _Unwind_Context* context, int index);
extern void _Unwind_SetGR(struct _Unwind_Context* context, int index, uintptr_t new_value);
extern uintptr_t _Unwind_GetIP(struct _Unwind_Context* context);
extern void _Unwind_SetIP(struct _Unwind_Context*, uintptr_t new_value);
extern uintptr_t _Unwind_GetRegionStart(struct _Unwind_Context* context);
extern uintptr_t _Unwind_GetLanguageSpecificData(struct _Unwind_Context* context);
#if __arm__
extern _Unwind_Reason_Code _Unwind_SjLj_ForcedUnwind(struct _Unwind_Exception* exception_object, _Unwind_Stop_Fn stop, void* stop_parameter );
#else
extern _Unwind_Reason_Code _Unwind_ForcedUnwind(struct _Unwind_Exception* exception_object, _Unwind_Stop_Fn stop, void* stop_parameter );
#endif
#if __arm__
typedef struct _Unwind_FunctionContext* _Unwind_FunctionContext_t;
extern void _Unwind_SjLj_Register(_Unwind_FunctionContext_t fc);
extern void _Unwind_SjLj_Unregister(_Unwind_FunctionContext_t fc);
#endif
#if __arm__
extern _Unwind_Reason_Code _Unwind_SjLj_Resume_or_Rethrow(struct _Unwind_Exception* exception_object);
#else
extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct _Unwind_Exception* exception_object);
#endif
typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn)(struct _Unwind_Context*, void*);
extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void*);
extern uintptr_t _Unwind_GetCFA(struct _Unwind_Context*);
extern uintptr_t _Unwind_GetIPInfo(struct _Unwind_Context* context, int* ipBefore);
extern void __register_frame(const void* fde);
extern void __deregister_frame(const void* fde);
struct dwarf_eh_bases
{
uintptr_t tbase;
uintptr_t dbase;
uintptr_t func;
};
extern const void* _Unwind_Find_FDE(const void* pc, struct dwarf_eh_bases*);
extern void* _Unwind_FindEnclosingFunction(void* pc);
extern uintptr_t _Unwind_GetDataRelBase(struct _Unwind_Context* context) __attribute__((unavailable));
extern uintptr_t _Unwind_GetTextRelBase(struct _Unwind_Context* context) __attribute__((unavailable));
extern void __register_frame_info_bases(const void* fde, void* ob, void* tb, void* db) __attribute__((unavailable));
extern void __register_frame_info(const void* fde, void* ob) __attribute__((unavailable));
extern void __register_frame_info_table_bases(const void* fde, void* ob,void* tb, void* db) __attribute__((unavailable));
extern void __register_frame_info_table(const void* fde, void* ob) __attribute__((unavailable));
extern void __register_frame_table(const void* fde) __attribute__((unavailable));
extern void* __deregister_frame_info(const void* fde) __attribute__((unavailable));
extern void* __deregister_frame_info_bases(const void* fde) __attribute__((unavailable));
#ifdef __cplusplus
}
#endif
#endif // __UNWIND_H__