really work with mingw-w64 ?
Like I can throw G++ exceptions from the _se_translator_function ?!
At the moment it won't work, because we haven't support of SEH for x64 (nor for ia32) in gcc at the moment.
We plan to add this feature for x64 while gcc 4.5 phase 1/2.
Thank you !
It might not be a bad idea to put this in as a feature request so we don't forget about it. I would do it myself, but I think you know more about it than I do :)
> but I think you know more about it than I do :)
I wouldn't say I know that much about it.
From the programmer's prospective it will be somewhat
similar to being able to throw exceptions from a signal handler
(which is not possible).
I don't know how useful, but at least interesting :-)
That's why I asked :-)
Hello all. Great tools! Thanks.
I'm replying to this old thread wondering if set_se_translator is working yet. When I try to use it, my program compiles fine but I get the following link error:
undefined reference to `_imp___Z18_set_se_translatorPFvjP19_EXCEPTION_POINTERSE'
I did a strings search on all libraries, and the function does show up in libmsvcr90 and libmsvcr100. However, the mangling is different and I would say correct in the libs,but not correct for my project.
It seems as if from the point of view of my .cpp file it doesn't know the exact signature of the function.
Is this an include issue, a code generation issue, or something else? I'm including <eh.h>.
Any hints would be appreciated.
I've tried different tool chains from the download section all with the same results:
gcc version 4.5.2 (GCC)
gcc version 4.6.1 20110506 (prerelease) (GCC)
gcc version 4.7.0 20110517 (experimental) (GCC)
I looked in the source distribution .def files and it looks like it should be working.
The conversion between GNU mangling and the MSVCRT mangling looks fine.
; void (__cdecl*__cdecl _set_se_translator(void (__cdecl*)(unsigned int,struct _EXCEPTION_POINTERS * __ptr64)))(unsigned int,struct _EXCEPTION_POINTERS * __ptr64)
; GNU = __Z18_set_se_translatorPFvjP19_EXCEPTION_POINTERSE
Is there anything else I could be doing wrong?
_set_se_translator is a part of visual runtime and it doesn't work for me. you should use gcc-4.6+ and veh, e.g.:
::LONG CALLBACK vectoredExceptionHandler( ::PEXCEPTION_POINTERS ep )
std::printf( "entering vectorized ex. handler 0x%lx…\n",
::LONG WINAPI unhandledExecptionFilter( ::PEXCEPTION_POINTERS ep )
std::printf( "entering unhandled ex. filter 0x%lx…\n",
return EXCEPTION_EXECUTE_HANDLER; // should terminate process.
::AddVectoredExceptionHandler( 1, vectoredExceptionHandler );
::SetUnhandledExceptionFilter( unhandledExecptionFilter );
int i = 42;
std::printf( "throwing int %d…\n", i );
catch ( int i )
std::printf( "catching int %d…\n", i );
volatile int* p = 0;
std::printf( "accessing null pointer…\n" );
*p = 0;
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.