Structured Exception Handling (SEH) on Windows

Has any progress been made on structured exception handling on Windows? I saw a post by Duncan Sands back in September 2008, but haven't seen anything since. I'm trying to generate code to run on Windows, but would really prefer not to ship libgcc...

-- Joe Ranieri

I fail to see the connection between SEH support and libgcc; for C++
exceptions to work, you will need libgcc anyway.

-Eli

Well, I had thought that SEH was a superset of C++ exception handling, similar to how the unwind library is to the C++ exception handling with libgcc. Looking further into this, it seems not to be the case. What I'd like to end up with is exceptions compatible with DLLs generated with Visual Studio C++. I'm not much of a Windows person, so don't really know the best way to approach it.

However, this is a long term goal, and for now I just need an exception system to work inside of the code I generate with LLVM. Since I don't really have much time to spend on this, I think for now I'll implement something quick and dirty using setjmp/longjmp.

Anyone have better ideas?

-- Joe Ranieri

SEH is not a superset of C++ exception handling - it is Windows exception handling

I'm trying to generate code to run on
Windows, but would really prefer not to ship libgcc...

> What I'd like to end up with is exceptions compatible with DLLs
> generated with Visual Studio C++. I'm not much of a Windows person, so
> don't really know the best way to approach it.

I'm not fully versed on this topic either, but this article might be helpful to you.

http://www.microsoft.com/msj/0197/exception/exception.aspx

It covers the low level details of how SEH works at the compiler and OS level. This, plus an examination of what assembly code is generated by Visual Studio, will probably help you get to where you need to be.

HTH,
Christopher

Hello

What I'd like to end up with is exceptions compatible with DLLs
generated with Visual Studio C++. I'm not much of a Windows person, so
don't really know the best way to approach it.

Unfortunately this will hardly be possible regardless whether SEH
would be implemented or not. VCPP uses different (and undocumented!)
class layout, different name mangling, etc. So, the code generated is
simple not compatible at binary level.