I've modified llvm to emit vc++ compatible SEH structures for my personality on x86/Windows and my handler works fine, but the only thing I can't figure out is how to call these funclets, they look like:
For 32-bit x86, set EBP to the address of the end of the SEH registration node before calling any funclet. The prologue does ‘addl $12, %ebp’ to recompute the real frame pointer from that address. The return value of the catch handler is the label that you should jump to with EBP set in the same manner. The code at that label will take care of restoring other registers.
Also, unless you absolutely need to be compatible with MSVC exceptions, don’t use funclets for your new personality. Use landingpads. They are better and will get you better code.
For 32-bit x86, set EBP to the address of the end of the SEH
registration node before calling any funclet. The prologue does 'addl
$12, %ebp' to recompute the real frame pointer from that address. The
return value of the catch handler is the label that you should jump to
with EBP set in the same manner. The code at that label will take care
of restoring other registers.
thanks! that works.
Also, unless you absolutely need to be compatible with MSVC exceptions,
don't use funclets for your new personality. Use landingpads. They are
better and will get you better code.
ah ke, but landingpads won't let me catch SEH exceptions will they?
You can build a personality function similar to __gxx_personality_seh0 that
calls filter functions, and then resumes control at the appropriate
landingpad. You'd need to build out something similar to _Unwind_Resume or
use mingw's from libgcc to implement successive unwinding for finally.