fix: fix fatal error of ExceptionHelper in x86 environemnt.
- fix a wrong placeholder of printf in ExceptionHelper which cause crash in unhandled exception handler. - improve format function in ExceptionHelper. - add a new debugging option and macro in CMake script and code for the convenience of debugging unhandled exception handler. - add docuementation about previous term.
This commit is contained in:
@ -349,8 +349,20 @@ namespace YYCCTestbench {
|
||||
});
|
||||
|
||||
// Perform a div zero exception.
|
||||
#if defined (YYCC_DEBUG_UE_FILTER)
|
||||
// Reference: https://stackoverflow.com/questions/20981982/is-it-possible-to-debug-unhandledexceptionfilters-with-a-debugger
|
||||
__try {
|
||||
// all of code normally inside of main or WinMain here...
|
||||
int i = 1, j = 0;
|
||||
int k = i / j;
|
||||
}
|
||||
__except (YYCC::ExceptionHelper::DebugCallUExceptionImpl(GetExceptionInformation())) {
|
||||
OutputDebugStringW(L"executed filter function\n");
|
||||
}
|
||||
#else
|
||||
int i = 1, j = 0;
|
||||
int k = i / j;
|
||||
#endif
|
||||
|
||||
YYCC::ExceptionHelper::Unregister();
|
||||
|
||||
|
Reference in New Issue
Block a user