From d634ac06383b4927e3354605e5261902eed22e99 Mon Sep 17 00:00:00 2001 From: havoc Date: Thu, 12 Sep 2002 12:20:01 +0000 Subject: [PATCH] added pr_traceqc cvar, to enable serious spew (printing every opcode executed to console) for extreme debugging git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2365 d7cf8633-e32d-0410-b094-e92efae38249 --- pr_edict.c | 3 +++ pr_exec.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pr_edict.c b/pr_edict.c index 4fc99507..8520ede0 100644 --- a/pr_edict.c +++ b/pr_edict.c @@ -68,6 +68,8 @@ cvar_t nehx18 = {0, "nehx18", "0"};cvar_t nehx19 = {0, "nehx19", "0"}; cvar_t cutscene = {0, "cutscene", "1"}; // LordHavoc: optional runtime bounds checking (speed drain, but worth it for security, on by default - breaks most QCCX features (used by CRMod and others)) cvar_t pr_boundscheck = {0, "pr_boundscheck", "1"}; +// LordHavoc: prints every opcode as it executes - warning: this is significant spew +cvar_t pr_traceqc = {0, "pr_traceqc", "0"}; #define MAX_FIELD_LEN 64 #define GEFV_CACHESIZE 2 @@ -1539,6 +1541,7 @@ void PR_Init (void) Cvar_RegisterVariable (&cutscene); // for Nehahra but useful to other mods as well // LordHavoc: optional runtime bounds checking (speed drain, but worth it for security, on by default - breaks most QCCX features (used by CRMod and others)) Cvar_RegisterVariable (&pr_boundscheck); + Cvar_RegisterVariable (&pr_traceqc); progs_mempool = Mem_AllocPool("progs.dat"); edictstring_mempool = Mem_AllocPool("edict strings"); diff --git a/pr_exec.c b/pr_exec.c index 2481b1b3..a631a7e3 100644 --- a/pr_exec.c +++ b/pr_exec.c @@ -365,6 +365,7 @@ PR_ExecuteProgram #define OPB ((eval_t *)&pr_globals[(unsigned short) st->b]) #define OPC ((eval_t *)&pr_globals[(unsigned short) st->c]) extern cvar_t pr_boundscheck; +extern cvar_t pr_traceqc; void PR_ExecuteProgram (func_t fnum, const char *errormessage) { dstatement_t *st; @@ -382,7 +383,7 @@ void PR_ExecuteProgram (func_t fnum, const char *errormessage) f = &pr_functions[fnum]; - pr_trace = false; + pr_trace = pr_traceqc.integer; // we know we're done when pr_depth drops to this exitdepth = pr_depth; -- 2.39.2