Updated context definitions for the latest Darwin/x86.
This commit is contained in:
parent
e87fe3a17f
commit
a63acd71c8
|
@ -298,29 +298,32 @@ typedef struct
|
||||||
|
|
||||||
typedef ucontext_t SIGCONTEXT;
|
typedef ucontext_t SIGCONTEXT;
|
||||||
|
|
||||||
#define EAX_sig(context) ((context)->uc_mcontext->sc.sc_eax)
|
#define EAX_sig(context) ((context)->uc_mcontext->ss.eax)
|
||||||
#define EBX_sig(context) ((context)->uc_mcontext->sc.sc_ebx)
|
#define EBX_sig(context) ((context)->uc_mcontext->ss.ebx)
|
||||||
#define ECX_sig(context) ((context)->uc_mcontext->sc.sc_ecx)
|
#define ECX_sig(context) ((context)->uc_mcontext->ss.ecx)
|
||||||
#define EDX_sig(context) ((context)->uc_mcontext->sc.sc_edx)
|
#define EDX_sig(context) ((context)->uc_mcontext->ss.edx)
|
||||||
#define ESI_sig(context) ((context)->uc_mcontext->sc.sc_esi)
|
#define ESI_sig(context) ((context)->uc_mcontext->ss.esi)
|
||||||
#define EDI_sig(context) ((context)->uc_mcontext->sc.sc_edi)
|
#define EDI_sig(context) ((context)->uc_mcontext->ss.edi)
|
||||||
#define EBP_sig(context) ((context)->uc_mcontext->sc.sc_ebp)
|
#define EBP_sig(context) ((context)->uc_mcontext->ss.ebp)
|
||||||
|
|
||||||
#define CS_sig(context) ((context)->uc_mcontext->sc.sc_cs)
|
#define CS_sig(context) ((context)->uc_mcontext->ss.cs)
|
||||||
#define DS_sig(context) ((context)->uc_mcontext->sc.sc_ds)
|
#define DS_sig(context) ((context)->uc_mcontext->ss.ds)
|
||||||
#define ES_sig(context) ((context)->uc_mcontext->sc.sc_es)
|
#define ES_sig(context) ((context)->uc_mcontext->ss.es)
|
||||||
#define FS_sig(context) ((context)->uc_mcontext->sc.sc_fs)
|
#define FS_sig(context) ((context)->uc_mcontext->ss.fs)
|
||||||
#define GS_sig(context) ((context)->uc_mcontext->sc.sc_gs)
|
#define GS_sig(context) ((context)->uc_mcontext->ss.gs)
|
||||||
#define SS_sig(context) ((context)->uc_mcontext->sc.sc_ss)
|
#define SS_sig(context) ((context)->uc_mcontext->ss.ss)
|
||||||
|
|
||||||
#define EFL_sig(context) ((context)->uc_mcontext->sc.sc_eflags)
|
#define EFL_sig(context) ((context)->uc_mcontext->ss.eflags)
|
||||||
|
|
||||||
#define EIP_sig(context) (*((unsigned long*)&(context)->uc_mcontext->sc.sc_eip))
|
#define EIP_sig(context) (*((unsigned long*)&(context)->uc_mcontext->ss.eip))
|
||||||
#define ESP_sig(context) (*((unsigned long*)&(context)->uc_mcontext->sc.sc_esp))
|
#define ESP_sig(context) (*((unsigned long*)&(context)->uc_mcontext->ss.esp))
|
||||||
|
|
||||||
#define HANDLER_DEF(name) void name( int __signal, siginfo_t *__siginfo, SIGCONTEXT *__context )
|
#define HANDLER_DEF(name) void name( int __signal, siginfo_t *__siginfo, SIGCONTEXT *__context )
|
||||||
#define HANDLER_CONTEXT (__context)
|
#define HANDLER_CONTEXT (__context)
|
||||||
|
|
||||||
|
#define TRAP_sig(context) ((context)->uc_mcontext->es.trapno)
|
||||||
|
#define ERROR_sig(context) ((context)->uc_mcontext->es.err)
|
||||||
|
|
||||||
#define FAULT_ADDRESS (__siginfo->si_addr)
|
#define FAULT_ADDRESS (__siginfo->si_addr)
|
||||||
|
|
||||||
#endif /* __APPLE__ */
|
#endif /* __APPLE__ */
|
||||||
|
@ -1300,9 +1303,6 @@ BOOL SIGNAL_Init(void)
|
||||||
ss.ss_sp = get_signal_stack();
|
ss.ss_sp = get_signal_stack();
|
||||||
ss.ss_size = signal_stack_size;
|
ss.ss_size = signal_stack_size;
|
||||||
ss.ss_flags = 0;
|
ss.ss_flags = 0;
|
||||||
#ifdef __APPLE__ /* work around MacOS bug */
|
|
||||||
ss.ss_sp = (char *)ss.ss_sp + ss.ss_size;
|
|
||||||
#endif
|
|
||||||
if (!sigaltstack(&ss, NULL)) have_sigaltstack = 1;
|
if (!sigaltstack(&ss, NULL)) have_sigaltstack = 1;
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
/* sigaltstack may fail because the kernel is too old, or
|
/* sigaltstack may fail because the kernel is too old, or
|
||||||
|
|
Loading…
Reference in New Issue