1
0
forked from mirrors/0ad

MICROLOG function for high-speed logging of everything that happened just before a crash

This was SVN commit r761.
This commit is contained in:
Ykkrosh
2004-07-15 19:29:56 +00:00
parent af9cf31691
commit 82de48832e
8 changed files with 92 additions and 8 deletions
+9
View File
@@ -2,6 +2,7 @@
#include "ScriptGlue.h"
#include "CConsole.h"
#include "CLogger.h"
#include "CStr.h"
#include "EntityHandles.h"
#include "Entity.h"
@@ -32,6 +33,7 @@ JSFunctionSpec ScriptFunctionTable[] =
{"getGlobal", getGlobal, 0, 0, 0 },
{"getGUIGlobal", getGUIGlobal, 0, 0, 0 },
{"exit", exitProgram, 0, 0, 0 },
{"crash", crash, 0, 0, 0 },
{0, 0, 0, 0, 0},
};
@@ -145,3 +147,10 @@ JSBool exitProgram(JSContext* context, JSObject* globalObject, unsigned int argc
kill_mainloop();
return JS_TRUE;
}
JSBool crash(JSContext* context, JSObject* globalObject, unsigned int argc, jsval* argv, jsval* rval)
{
MICROLOG(L"Crashing.");
uintptr_t ptr = 0xDEADC0DE;
return *(JSBool*) ptr;
}