1 /* ---------------------------------------------- */
4 /* ---------------------------------------------- */
6 /* ---------------------------------------------- */
11 xchg (%esp),%ebp /* store ebp, get ret.addr */
12 push %ebp /* push ret.addr */
13 lea 4(%esp),%ebp /* setup frame ptr */
14 push %ecx /* save ecx */
27 mov (%eax),%ecx /* restore ecx */
30 /* ---------------------------------------------- */
32 /* ---------------------------------------------- */
37 xchg (%rsp),%rbp /* store ebp, get ret.addr */
38 push %rbp /* push ret.addr */
39 lea 8(%rsp),%rbp /* setup frame ptr */
40 push %rcx /* save ecx */
54 mov (%rax),%rcx /* restore ecx */
57 /* ---------------------------------------------- */
58 /* setjmp/longjmp support */
65 /* ---------------------------------------------- */
67 /* ---------------------------------------------- */
70 /* ---------------------------------------------- */
72 /* ---------------------------------------------- */
76 PEXCEPTION_RECORD exception_record,
77 PEXCEPTION_REGISTRATION registration,
79 PEXCEPTION_REGISTRATION dispatcher
82 int __cdecl _XcptFilter(
83 unsigned long xcptnum,
84 PEXCEPTION_POINTERS pxcptinfoptrs
89 void *exception_pointers; // 1
92 void *scopetable; // 4
97 // this is what the assembler code below means:
102 __except (_XcptFilter(GetExceptionCode(), GetExceptionInformation()))
104 exit(GetExceptionCode());
108 .globl _exception_info
110 mov 1*4-24(%ebp),%eax
113 .globl _exception_code
130 mov 0*4-24(%ebp),%esp
135 // msvcrt wants scopetables aligned and in read-only segment (using .text)
156 // void *exception_pointers;
165 mov $ seh_handler,%eax
169 mov $ seh_scopetable,%eax
183 /* ---------------------------------------------- */
185 /* ---------------------------------------------- */
187 /* SEH on x86-64 not implemented */
189 /* ---------------------------------------------- */
191 /* ---------------------------------------------- */