[GD-Windows] RE: [Algorithms] Crash helper
Brought to you by:
vexxed72
From: Jon W. <hp...@mi...> - 2004-04-09 00:15:12
|
I'm copying this to gd-windows, which is where the question should be asked. (gam...@li...) We wrap our game loop in __try / __except and do a crash dump in the except handler: static BOOL (WINAPI * MyMiniDumpWriteDump)( HANDLE, DWORD, HANDLE, MINIDUMP_TYPE, PMINIDUMP_EXCEPTION_INFORMATION, PMINIDUMP_USER_STREAM_INFORMATION, PMINIDUMP_CALLBACK_INFORMATION ); static HMODULE hDbgHelp = (HMODULE)INVALID_HANDLE_VALUE; void InitExceptionSupportAtProgramStart() { hDbgHelp = LoadLibrary( "DbgHelp.dll" ); if( hDbgHelp != (HMODULE)INVALID_HANDLE_VALUE ) { *(FARPROC *)&MyMiniDumpWriteDump = GetProcAddress( hDbgHelp, "MiniDumpWriteDump" ); } } DWORD ExceptionHandler() { if( MyMiniDumpWriteDump ) { HANDLE hFile = CreateFile( ... ); ... GetExceptionInformation() ... (*MyMiniDumpWriteDump)( ... ); CloseHandle( hFile ); } else { // walk the stack from esp up to stack base, looking // for things that returns like return addresses into // our executables and DLLS, using the ImageHelp library // and address/code sniffing; dump into a text-mode file } return EXCEPTION_EXECUTE_HANDLER; } __try { while( 1 ) { GameLoop(); } } __except( ExceptionHandler() ) { UserMessage( "The computer hates you." ); ExitProcess( -1 ); } -----Original Message----- From: gda...@li... [mailto:gda...@li...]On Behalf Of Tom Vykruta Sent: Thursday, April 08, 2004 4:48 PM To: gda...@li... Subject: [Algorithms] Crash helper I apologize for a slightly off topic question, but it's advanced and hopefully someone has ideas. I'm currently in the midst of running a PC game (The Suffering) through QA. Unfortunately when it crashes, there is nothing helpful besides "Crashed to desktop". I want a crash report generated. I can ship the PDB along with the game, or not. The ideal thing would be to dump the stack, registers, and perhaps even disassembly at the crash site. Are there any existing ways to do this? I'm compiling under .NET 7.1 + D3D9, pretty standard setup. Thanks all. Tomas Vykruta Project Lead, The Suffering PC ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=ick _______________________________________________ GDAlgorithms-list mailing list GDA...@li... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list Archives: http://sourceforge.net/mailarchive/forum.php?forum_ida88 |