mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
- Improved gameloop unhandled exception handler to retrieve the line and source file (if PDB is available) and display in the fault screen instead of the location of the fault handler (by tazpn)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5166 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1862,15 +1862,25 @@ static void PopulateSectionFromCommandLine(vfs::PropertyContainer &oProps, vfs::
|
||||
static LONG __stdcall SGPExceptionFilter(int exceptionCount, EXCEPTION_POINTERS* pExceptInfo)
|
||||
{
|
||||
#ifdef ENABLE_EXCEPTION_HANDLING
|
||||
|
||||
extern BOOL ERGetFirstModuleException(EXCEPTION_POINTERS*, HMODULE, LPSTR, INT, LPSTR, INT, INT *);
|
||||
extern STR GetExceptionString( DWORD uiExceptionCode );
|
||||
CHAR funcName[64], sourceName[MAX_PATH];
|
||||
INT lineNum = 0;
|
||||
if (exceptionCount >= 1)
|
||||
{
|
||||
// the exception handler writer can fail with exceptions too
|
||||
__try
|
||||
{
|
||||
bool showAssert = true;
|
||||
__try{
|
||||
// the exception handler writer can fail with exceptions too
|
||||
RecordExceptionInfo(pExceptInfo);
|
||||
|
||||
LPCSTR exceptMsg = GetExceptionString(pExceptInfo->ExceptionRecord->ExceptionCode);
|
||||
if ( ERGetFirstModuleException(pExceptInfo, NULL, funcName, _countof(funcName), sourceName, _countof(sourceName), &lineNum ) )
|
||||
{
|
||||
_FailMessage(exceptMsg, lineNum, funcName, sourceName);
|
||||
showAssert = false;
|
||||
}
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {}
|
||||
AssertMsg(FALSE, "Unhanded exception processing GameLoop unable to recover.");
|
||||
if (showAssert) AssertMsg(FALSE, "Unhanded exception processing GameLoop unable to recover.");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user