}
}
+void PRVM_ShortStackTrace(char *buf, size_t bufsize)
+{
+ mfunction_t *f;
+ int i;
+
+ if(prog)
+ {
+ dpsnprintf(buf, bufsize, "(%s) ", prog->name);
+ }
+ else
+ {
+ strlcpy(buf, "<NO PROG>", sizeof(buf));
+ return;
+ }
+
+ prog->stack[prog->depth].s = prog->xstatement;
+ prog->stack[prog->depth].f = prog->xfunction;
+ for (i = prog->depth;i > 0;i--)
+ {
+ f = prog->stack[i].f;
+
+ if(strlcat(buf,
+ f
+ ? va("%s:%s(%i) ", PRVM_GetString(f->s_file), PRVM_GetString(f->s_name), prog->stack[i].s - f->first_statement)
+ : "<NULL> ",
+ bufsize
+ ) >= bufsize)
+ break;
+ }
+}
+
void PRVM_CallProfile ()
{
}
extern sizebuf_t vm_tempstringsbuf;
+extern cvar_t prvm_errordump;
+void Host_Savegame_to (const char *name);
void PRVM_Crash(void)
{
if (prog == NULL)
PRVM_PrintState();
}
+ if(prvm_errordump.integer)
+ {
+ // make a savegame
+ Host_Savegame_to(va("crash-%s.dmp", PRVM_NAME));
+ }
+
// dump the stack so host_error can shutdown functions
prog->depth = 0;
prog->localstack_used = 0;