Con_Printf("s%i: ", opnum);
if( prog->statement_linenums )
- Con_Printf( "%s:%i: ", PRVM_GetString( prog, prog->xfunction->s_file ), prog->statement_linenums[ opnum ] );
+ {
+ if ( prog->statement_columnnums )
+ Con_Printf( "%s:%i:%i: ", PRVM_GetString( prog, prog->xfunction->s_file ), prog->statement_linenums[ opnum ], prog->statement_columnnums[ opnum ] );
+ else
+ Con_Printf( "%s:%i: ", PRVM_GetString( prog, prog->xfunction->s_file ), prog->statement_linenums[ opnum ] );
+ }
if (prvm_statementprofiling.integer)
Con_Printf("%7.0f ", prog->statement_profile[s - prog->statements]);
if (!f)
Con_Print("<NULL FUNCTION>\n");
else
- Con_Printf("%12s : %s : statement %i\n", PRVM_GetString(prog, f->s_file), PRVM_GetString(prog, f->s_name), prog->stack[i].s - f->first_statement);
+ {
+ if (prog->statement_linenums)
+ {
+ if (prog->statement_columnnums)
+ Con_Printf("%12s:%i:%i : %s : statement %i\n", PRVM_GetString(prog, f->s_file), prog->statement_linenums[prog->stack[i].s], prog->statement_columnnums[prog->stack[i].s], PRVM_GetString(prog, f->s_name), prog->stack[i].s - f->first_statement);
+ else
+ Con_Printf("%12s:%i : %s : statement %i\n", PRVM_GetString(prog, f->s_file), prog->statement_linenums[prog->stack[i].s], PRVM_GetString(prog, f->s_name), prog->stack[i].s - f->first_statement);
+ }
+ else
+ Con_Printf("%12s : %s : statement %i\n", PRVM_GetString(prog, f->s_file), PRVM_GetString(prog, f->s_name), prog->stack[i].s - f->first_statement);
+ }
}
}
PRVM_Profile(prog, howmany, 0, 1);
}
-void PRVM_PrintState(prvm_prog_t *prog)
+void PRVM_PrintState(prvm_prog_t *prog, int stack_index)
{
int i;
+ mfunction_t *func = prog->xfunction;
+ int st = prog->xstatement;
+ if (stack_index > 0 && stack_index <= prog->depth)
+ {
+ func = prog->stack[prog->depth - stack_index].f;
+ st = prog->stack[prog->depth - stack_index].s;
+ }
if (prog->statestring)
{
Con_Printf("Caller-provided information: %s\n", prog->statestring);
}
- if (prog->xfunction)
+ if (func)
{
for (i = -7; i <= 0;i++)
- if (prog->xstatement + i >= prog->xfunction->first_statement)
- PRVM_PrintStatement(prog, prog->statements + prog->xstatement + i);
+ if (st + i >= func->first_statement)
+ PRVM_PrintStatement(prog, prog->statements + st + i);
}
- else
- Con_Print("null function executing??\n");
PRVM_StackTrace(prog);
}
if( prog->depth > 0 )
{
Con_Printf("QuakeC crash report for %s:\n", prog->name);
- PRVM_PrintState(prog);
+ PRVM_PrintState(prog, 0);
}
if(prvm_errordump.integer)
extern qboolean prvm_runawaycheck;
#ifdef PROFILING
+#ifdef CONFIG_MENU
/*
====================
MVM_ExecuteProgram
int restorevm_tempstringsbuf_cursize;
double calltime;
double tm, starttm;
+ prvm_vec_t tempfloat;
+ // these may become out of date when a builtin is called, and are updated accordingly
+ prvm_vec_t *cached_edictsfields = prog->edictsfields;
+ unsigned int cached_entityfields = prog->entityfields;
+ unsigned int cached_entityfields_3 = prog->entityfields - 3;
+ unsigned int cached_entityfieldsarea = prog->entityfieldsarea;
+ unsigned int cached_entityfieldsarea_entityfields = prog->entityfieldsarea - prog->entityfields;
+ unsigned int cached_entityfieldsarea_3 = prog->entityfieldsarea - 3;
+ unsigned int cached_entityfieldsarea_entityfields_3 = prog->entityfieldsarea - prog->entityfields - 3;
+ unsigned int cached_max_edicts = prog->max_edicts;
+ // these do not change
+ mstatement_t *cached_statements = prog->statements;
+ qboolean cached_allowworldwrites = prog->allowworldwrites;
+ unsigned int cached_flag = prog->flag;
calltime = Sys_DirtyTime();
chooseexecprogram:
cachedpr_trace = prog->trace;
- if (prvm_statementprofiling.integer || prog->trace)
+ if (prvm_statementprofiling.integer || prog->trace || prog->watch_global >= 0 || prog->watch_edict >= 0 || prog->break_statement >= 0)
{
#define PRVMSLOWINTERPRETER 1
if (prvm_timeprofiling.integer)
if (prog == SVVM_prog)
SV_FlushBroadcastMessages();
}
+#endif
/*
====================
int restorevm_tempstringsbuf_cursize;
double calltime;
double tm, starttm;
+ prvm_vec_t tempfloat;
+ // these may become out of date when a builtin is called, and are updated accordingly
+ prvm_vec_t *cached_edictsfields = prog->edictsfields;
+ unsigned int cached_entityfields = prog->entityfields;
+ unsigned int cached_entityfields_3 = prog->entityfields - 3;
+ unsigned int cached_entityfieldsarea = prog->entityfieldsarea;
+ unsigned int cached_entityfieldsarea_entityfields = prog->entityfieldsarea - prog->entityfields;
+ unsigned int cached_entityfieldsarea_3 = prog->entityfieldsarea - 3;
+ unsigned int cached_entityfieldsarea_entityfields_3 = prog->entityfieldsarea - prog->entityfields - 3;
+ unsigned int cached_max_edicts = prog->max_edicts;
+ // these do not change
+ mstatement_t *cached_statements = prog->statements;
+ qboolean cached_allowworldwrites = prog->allowworldwrites;
+ unsigned int cached_flag = prog->flag;
calltime = Sys_DirtyTime();
chooseexecprogram:
cachedpr_trace = prog->trace;
- if (prvm_statementprofiling.integer || prog->trace)
+ if (prvm_statementprofiling.integer || prog->trace || prog->watch_global >= 0 || prog->watch_edict >= 0 || prog->break_statement >= 0)
{
#define PRVMSLOWINTERPRETER 1
if (prvm_timeprofiling.integer)
int restorevm_tempstringsbuf_cursize;
double calltime;
double tm, starttm;
+ prvm_vec_t tempfloat;
+ // these may become out of date when a builtin is called, and are updated accordingly
+ prvm_vec_t *cached_edictsfields = prog->edictsfields;
+ unsigned int cached_entityfields = prog->entityfields;
+ unsigned int cached_entityfields_3 = prog->entityfields - 3;
+ unsigned int cached_entityfieldsarea = prog->entityfieldsarea;
+ unsigned int cached_entityfieldsarea_entityfields = prog->entityfieldsarea - prog->entityfields;
+ unsigned int cached_entityfieldsarea_3 = prog->entityfieldsarea - 3;
+ unsigned int cached_entityfieldsarea_entityfields_3 = prog->entityfieldsarea - prog->entityfields - 3;
+ unsigned int cached_max_edicts = prog->max_edicts;
+ // these do not change
+ mstatement_t *cached_statements = prog->statements;
+ qboolean cached_allowworldwrites = prog->allowworldwrites;
+ unsigned int cached_flag = prog->flag;
calltime = Sys_DirtyTime();
chooseexecprogram:
cachedpr_trace = prog->trace;
- if (prvm_statementprofiling.integer || prog->trace)
+ if (prvm_statementprofiling.integer || prog->trace || prog->watch_global >= 0 || prog->watch_edict >= 0 || prog->break_statement >= 0)
{
#define PRVMSLOWINTERPRETER 1
if (prvm_timeprofiling.integer)