From: Andy D. <kha...@us...> - 2005-06-18 23:07:13
|
Update of /cvsroot/planeshift/planeshift/src/client/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22500/src/client/win32 Modified Files: mdump.cpp Log Message: Made the windows crash dialog box more informative. Index: mdump.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/win32/mdump.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** mdump.cpp 6 Apr 2005 18:04:45 -0000 1.12 --- mdump.cpp 18 Jun 2005 23:07:03 -0000 1.13 *************** *** 182,191 **** if (hDll) { MINIDUMPWRITEDUMP pDump = (MINIDUMPWRITEDUMP)::GetProcAddress( hDll, "MiniDumpWriteDump" ); if (pDump) { ! char crashMsg[1024]; ! sprintf(crashMsg, "Something unexpected happened in PlaneShift: Crystal Blue\nException at address: %p, Exception code: %X\n\nWould you like to save a diagnostic file?", ! pExceptionInfo->ExceptionRecord->ExceptionAddress, pExceptionInfo->ExceptionRecord->ExceptionCode); // ask the user if they want to save a dump file unless the crash action is to always generate a dump --- 182,268 ---- if (hDll) { + char exceptionNum[30]; MINIDUMPWRITEDUMP pDump = (MINIDUMPWRITEDUMP)::GetProcAddress( hDll, "MiniDumpWriteDump" ); if (pDump) { ! const char* exceptionType; ! switch(pExceptionInfo->ExceptionRecord->ExceptionCode) ! { ! case EXCEPTION_ACCESS_VIOLATION: ! exceptionType = "EXCEPTION_ACCESS_VIOLATION"; ! break; ! case EXCEPTION_DATATYPE_MISALIGNMENT: ! exceptionType = "EXCEPTION_DATATYPE_MISALIGNMENT"; ! break; ! case EXCEPTION_BREAKPOINT: ! exceptionType = "EXCEPTION_BREAKPOINT"; ! break; ! case EXCEPTION_SINGLE_STEP: ! exceptionType = "EXCEPTION_SINGLE_STEP"; ! break; ! case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: ! exceptionType = "EXCEPTION_ARRAY_BOUNDS_EXCEEDED"; ! break; ! case EXCEPTION_FLT_DENORMAL_OPERAND: ! exceptionType = "EXCEPTION_FLT_DENORMAL_OPERAND"; ! break; ! case EXCEPTION_FLT_DIVIDE_BY_ZERO: ! exceptionType = "EXCEPTION_FLT_DIVIDE_BY_ZERO"; ! break; ! case EXCEPTION_FLT_INEXACT_RESULT: ! exceptionType = "EXCEPTION_FLT_INEXACT_RESULT"; ! break; ! case EXCEPTION_FLT_INVALID_OPERATION: ! exceptionType = "EXCEPTION_FLT_INVALID_OPERATION"; ! break; ! case EXCEPTION_FLT_OVERFLOW: ! exceptionType = "EXCEPTION_FLT_OVERFLOW"; ! break; ! case EXCEPTION_FLT_STACK_CHECK: ! exceptionType = "EXCEPTION_FLT_STACK_CHECK"; ! break; ! case EXCEPTION_FLT_UNDERFLOW: ! exceptionType = "EXCEPTION_FLT_UNDERFLOW"; ! break; ! case EXCEPTION_INT_DIVIDE_BY_ZERO: ! exceptionType = "EXCEPTION_INT_DIVIDE_BY_ZERO"; ! break; ! case EXCEPTION_INT_OVERFLOW: ! exceptionType = "EXCEPTION_INT_OVERFLOW"; ! break; ! case EXCEPTION_PRIV_INSTRUCTION: ! exceptionType = "EXCEPTION_PRIV_INSTRUCTION"; ! break; ! case EXCEPTION_IN_PAGE_ERROR: ! exceptionType = "EXCEPTION_IN_PAGE_ERROR"; ! break; ! case EXCEPTION_ILLEGAL_INSTRUCTION: ! exceptionType = "EXCEPTION_ILLEGAL_INSTRUCTION"; ! break; ! case EXCEPTION_NONCONTINUABLE_EXCEPTION: ! exceptionType = "EXCEPTION_NONCONTINUABLE_EXCEPTION"; ! break; ! case EXCEPTION_STACK_OVERFLOW: ! exceptionType = "EXCEPTION_STACK_OVERFLOW"; ! break; ! case EXCEPTION_INVALID_DISPOSITION: ! exceptionType = "EXCEPTION_INVALID_DISPOSITION"; ! break; ! case EXCEPTION_GUARD_PAGE: ! exceptionType = "EXCEPTION_GUARD_PAGE"; ! break; ! case EXCEPTION_INVALID_HANDLE: ! exceptionType = "EXCEPTION_INVALID_HANDLE"; ! break; ! default: ! sprintf(exceptionNum, "Unknown code %X", pExceptionInfo->ExceptionRecord->ExceptionCode); ! exceptionType = exceptionNum; ! } ! ! ! ! char crashMsg[512]; ! sprintf(crashMsg, "Something unexpected happened in PlaneShift: Crystal Blue\nDetails: %s at %p\n\nWould you like to save a diagnostic file?", ! exceptionType, pExceptionInfo->ExceptionRecord->ExceptionAddress); // ask the user if they want to save a dump file unless the crash action is to always generate a dump |