RE: [Algorithms] Crash helper

"Jon Watte" <[email protected]>
Newsgroups gmane.games.devel.windows
Message-ID <[email protected]>
I'm copying this to gd-windows, which is where the question should be asked.
([email protected])

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: [email protected]
[mailto:[email protected]]On Behalf Of Tom
Vykruta
Sent: Thursday, April 08, 2004 4:48 PM
To: [email protected]
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_ida88



-------------------------------------------------------
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_id=1470&alloc_id=3638&op=click
_______________________________________________
Gamedevlists-windows mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_id=555
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.