diff options
Diffstat (limited to 'source/creator')
-rw-r--r-- | source/creator/CMakeLists.txt | 14 | ||||
-rw-r--r-- | source/creator/creator_signals.c | 102 |
2 files changed, 87 insertions, 29 deletions
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index cdfd40b996a..4b51f9738b3 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -687,14 +687,6 @@ elseif(WIN32) ) endif() - if(WITH_WINDOWS_PDB) - if(WITH_WINDOWS_STRIPPED_PDB) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/blender_public.pdb DESTINATION . RENAME blender.pdb) - else() - install(FILES $<TARGET_PDB_FILE:blender> DESTINATION . RENAME blender.pdb) - endif() - endif() - if(WITH_PYTHON) string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION}) @@ -1093,12 +1085,6 @@ endif() # the use of vcpkg if(WIN32) set_target_properties(blender PROPERTIES VS_GLOBAL_VcpkgEnabled "false") - set_target_properties(blender PROPERTIES - PDB_NAME "blender_private" - PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>") - if (WITH_WINDOWS_PDB AND WITH_WINDOWS_STRIPPED_PDB) - target_link_options(blender PRIVATE "/PDBSTRIPPED:${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/blender_public.pdb") - endif() endif() # ----------------------------------------------------------------------------- diff --git a/source/creator/creator_signals.c b/source/creator/creator_signals.c index 0ffa374a0ff..7f7a03f0465 100644 --- a/source/creator/creator_signals.c +++ b/source/creator/creator_signals.c @@ -190,25 +190,97 @@ static void sig_handle_crash(int signum) } # ifdef WIN32 -extern LONG WINAPI windows_exception_handler(EXCEPTION_POINTERS *ExceptionInfo) +LONG WINAPI windows_exception_handler(EXCEPTION_POINTERS *ExceptionInfo) { - /* If this is a stack overflow then we can't walk the stack, so just try to show + switch (ExceptionInfo->ExceptionRecord->ExceptionCode) { + case EXCEPTION_ACCESS_VIOLATION: + fputs("Error : EXCEPTION_ACCESS_VIOLATION\n", stderr); + break; + case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: + fputs("Error : EXCEPTION_ARRAY_BOUNDS_EXCEEDED\n", stderr); + break; + case EXCEPTION_BREAKPOINT: + fputs("Error : EXCEPTION_BREAKPOINT\n", stderr); + break; + case EXCEPTION_DATATYPE_MISALIGNMENT: + fputs("Error : EXCEPTION_DATATYPE_MISALIGNMENT\n", stderr); + break; + case EXCEPTION_FLT_DENORMAL_OPERAND: + fputs("Error : EXCEPTION_FLT_DENORMAL_OPERAND\n", stderr); + break; + case EXCEPTION_FLT_DIVIDE_BY_ZERO: + fputs("Error : EXCEPTION_FLT_DIVIDE_BY_ZERO\n", stderr); + break; + case EXCEPTION_FLT_INEXACT_RESULT: + fputs("Error : EXCEPTION_FLT_INEXACT_RESULT\n", stderr); + break; + case EXCEPTION_FLT_INVALID_OPERATION: + fputs("Error : EXCEPTION_FLT_INVALID_OPERATION\n", stderr); + break; + case EXCEPTION_FLT_OVERFLOW: + fputs("Error : EXCEPTION_FLT_OVERFLOW\n", stderr); + break; + case EXCEPTION_FLT_STACK_CHECK: + fputs("Error : EXCEPTION_FLT_STACK_CHECK\n", stderr); + break; + case EXCEPTION_FLT_UNDERFLOW: + fputs("Error : EXCEPTION_FLT_UNDERFLOW\n", stderr); + break; + case EXCEPTION_ILLEGAL_INSTRUCTION: + fputs("Error : EXCEPTION_ILLEGAL_INSTRUCTION\n", stderr); + break; + case EXCEPTION_IN_PAGE_ERROR: + fputs("Error : EXCEPTION_IN_PAGE_ERROR\n", stderr); + break; + case EXCEPTION_INT_DIVIDE_BY_ZERO: + fputs("Error : EXCEPTION_INT_DIVIDE_BY_ZERO\n", stderr); + break; + case EXCEPTION_INT_OVERFLOW: + fputs("Error : EXCEPTION_INT_OVERFLOW\n", stderr); + break; + case EXCEPTION_INVALID_DISPOSITION: + fputs("Error : EXCEPTION_INVALID_DISPOSITION\n", stderr); + break; + case EXCEPTION_NONCONTINUABLE_EXCEPTION: + fputs("Error : EXCEPTION_NONCONTINUABLE_EXCEPTION\n", stderr); + break; + case EXCEPTION_PRIV_INSTRUCTION: + fputs("Error : EXCEPTION_PRIV_INSTRUCTION\n", stderr); + break; + case EXCEPTION_SINGLE_STEP: + fputs("Error : EXCEPTION_SINGLE_STEP\n", stderr); + break; + case EXCEPTION_STACK_OVERFLOW: + fputs("Error : EXCEPTION_STACK_OVERFLOW\n", stderr); + break; + default: + fputs("Error : Unrecognized Exception\n", stderr); + break; + } + + fflush(stderr); + + /* If this is a stack overflow then we can't walk the stack, so just show * where the error happened */ - if (ExceptionInfo->ExceptionRecord->ExceptionCode == EXCEPTION_STACK_OVERFLOW) { - HMODULE mod; - CHAR modulename[MAX_PATH]; - LPVOID address = ExceptionInfo->ExceptionRecord->ExceptionAddress; - fprintf(stderr, "Error : EXCEPTION_STACK_OVERFLOW\n"); - fprintf(stderr, "Address : 0x%p\n", address); - if (GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, address, &mod)) { - if (GetModuleFileName(mod, modulename, MAX_PATH)) { - fprintf(stderr, "Module : %s\n", modulename); - } + if (EXCEPTION_STACK_OVERFLOW != ExceptionInfo->ExceptionRecord->ExceptionCode) { + HMODULE mod; + CHAR modulename[MAX_PATH]; + LPVOID address = ExceptionInfo->ExceptionRecord->ExceptionAddress; + + fprintf(stderr, "Address : 0x%p\n", address); + if (GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, address, &mod)) { + if (GetModuleFileName(mod, modulename, MAX_PATH)) { + fprintf(stderr, "Module : %s\n", modulename); } - } - else { - BLI_windows_handle_exception(ExceptionInfo); + } + + fflush(stderr); + +# ifdef NDEBUG + TerminateProcess(GetCurrentProcess(), SIGSEGV); +# else sig_handle_crash(SIGSEGV); +# endif } return EXCEPTION_EXECUTE_HANDLER; |