*/
void PRVM_PrintStatement (dstatement_t *s)
{
- int i;
+ size_t i;
+
+ if( prog->statement_linenums ) {
+ int opnum;
+
+ opnum = s - prog->statements;
+ Con_Printf( "%s:%i: ", PRVM_GetString( prog->xfunction->s_file ), prog->statement_linenums[ opnum ] );
+ }
if ( (unsigned)s->op < sizeof(prvm_opnames)/sizeof(prvm_opnames[0]))
{
Con_Print("prvm_profile <program name>\n");
return;
}
-
+
PRVM_Begin;
if(!PRVM_SetProgFromString(Cmd_Argv(1)))
return;
num++;
best->profile = 0;
best->builtinsprofile = 0;
+ best->callcount = 0;
}
} while (best);
PRVM_SetProg(i);
PRVM_Crash();
}
-
+
prog = oldprog;
}
void PRVM_Crash()
{
+ if (prog == NULL)
+ return;
+
if( prog->depth > 0 )
{
Con_Printf("QuakeC crash report for %s:\n", PRVM_NAME);
extern cvar_t prvm_boundscheck;
extern cvar_t prvm_traceqc;
extern int PRVM_ED_FindFieldOffset (const char *field);
-extern ddef_t* PRVM_ED_FindGlobal(const char *name);
+extern ddef_t* PRVM_ED_FindGlobal(const char *name);
void PRVM_ExecuteProgram (func_t fnum, const char *errormessage)
{
dstatement_t *st;