// howmany = atoi(Cmd_Argv(1));
if(Cmd_Argc() != 2)
{
- Con_Print("prvm_profile <program name>\n");
+ Con_Printf("prvm_profile <program name>\n");
return;
}
void PRVM_CrashAll()
{
int i;
- PRVM_Begin;
+ prvm_prog_t *oldprog = prog;
+
for(i = 0; i < PRVM_MAXPROGS; i++)
{
if(!PRVM_ProgLoaded(i))
PRVM_SetProg(i);
PRVM_Crash();
}
- PRVM_End;
+
+ prog = oldprog;
}
-void PRVM_Crash()
+void PRVM_PrintState(void)
{
int i;
-
- if (prog->depth < 1)
- {
- // kill the stack just to be sure
- prog->depth = 0;
- prog->localstack_used = 0;
- return;
- }
-
- Con_Printf("QuakeC crash report for %s:\n", PRVM_NAME);
if (prog->xfunction)
{
for (i = -4;i <= 0;i++)
else
Con_Printf("null function executing??\n");
PRVM_StackTrace ();
+}
+
+void PRVM_Crash()
+{
+ if (prog->depth < 1)
+ {
+ // kill the stack just to be sure
+ prog->depth = 0;
+ prog->localstack_used = 0;
+ return;
+ }
+
+ Con_Printf("QuakeC crash report for %s:\n", PRVM_NAME);
+ PRVM_PrintState();
// dump the stack so host_error can shutdown functions
prog->depth = 0;