//----------------------------------------------------------------------------- // Purpose: Catches and writes out any exception throw by the specified function //----------------------------------------------------------------------------- void CatchAndWriteMiniDump( FnWMain pfn, int argc, tchar *argv[] ) { if ( Plat_IsInDebugSession() ) { // don't mask exceptions when running in the debugger pfn( argc, argv ); } else { try { _set_se_translator( g_pfnWriteMiniDump ); pfn( argc, argv ); } catch (...) { g_bInException = true; DMsg( "console", 1, _T("Fatal exception caught, minidump written\n") ); // handle everything and just quit, we've already written out our minidump } } }
static int luasrc_DMsg (lua_State *L) { DMsg(luaL_checkstring(L, 1), luaL_checkint(L, 2), luaL_checkstring(L, 3)); return 0; }