]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
added pr_traceqc cvar, to enable serious spew (printing every opcode executed to...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 12 Sep 2002 12:20:01 +0000 (12:20 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 12 Sep 2002 12:20:01 +0000 (12:20 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2365 d7cf8633-e32d-0410-b094-e92efae38249

pr_edict.c
pr_exec.c

index 4fc995070fa0e6c8db93f5efc35688c28ebac861..8520ede01ac44f24623ef63cf23292e506ce6f5e 100644 (file)
@@ -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"};
 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
 
 #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 (&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");
 
        progs_mempool = Mem_AllocPool("progs.dat");
        edictstring_mempool = Mem_AllocPool("edict strings");
index 2481b1b32248af1e2344d271dc00897c6a149814..a631a7e3259ac66d5aa3f34da98c4631998caea7 100644 (file)
--- 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;
 #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;
 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];
 
 
        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;
 
        // we know we're done when pr_depth drops to this
        exitdepth = pr_depth;