]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
in PRVM state dumps, also dump a special extra string if prvm_backtraceforwarnings...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 23 Mar 2009 18:11:30 +0000 (18:11 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 23 Mar 2009 18:11:30 +0000 (18:11 +0000)
currently, this is used to be able to track down the invalid tempstrings in savegame saving

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8824 d7cf8633-e32d-0410-b094-e92efae38249

progsvm.h
prvm_edict.c
prvm_exec.c

index d53c6f42a654324c43c22f8e3a8f09814d12b514..4a13dd56586c5b9a3867b7bf6597d2c8c06c612b 100644 (file)
--- a/progsvm.h
+++ b/progsvm.h
@@ -431,6 +431,9 @@ typedef struct prvm_prog_s
        qboolean                        loaded;
        qboolean                        leaktest_active;
 
+       // printed together with backtraces
+       const char *statestring;
+
 //     prvm_builtin_mem_t  *mem_list;
 
 // now passed as parameter of PRVM_LoadProgs
@@ -458,7 +461,6 @@ typedef struct prvm_prog_s
        void                            (*reset_cmd)(void); // [INIT] used by PRVM_ResetProg
 
        void                            (*error_cmd)(const char *format, ...) DP_FUNC_PRINTF(1); // [INIT]
-
 } prvm_prog_t;
 
 extern prvm_prog_t * prog;
index f0ae041d9344a293125514fbc47ea25de2144168..cb1509cb18dc1954e4914332e0cd0e0dc4f5c210 100644 (file)
@@ -732,7 +732,9 @@ void PRVM_ED_Write (qfile_t *f, prvm_edict_t *ed)
                        continue;
 
                FS_Printf(f,"\"%s\" ",name);
+               prog->statestring = va("PRVM_ED_Write, ent=%d, name=%s", i, name);
                FS_Printf(f,"\"%s\"\n", PRVM_UglyValueString((etype_t)d->type, (prvm_eval_t *)v));
+               prog->statestring = NULL;
        }
 
        FS_Print(f, "}\n");
@@ -900,8 +902,10 @@ void PRVM_ED_WriteGlobals (qfile_t *f)
                if(developer_entityparsing.integer)
                        Con_Printf("PRVM_ED_WriteGlobals: at global %s\n", name);
 
+               prog->statestring = va("PRVM_ED_WriteGlobals, name=%s", name);
                FS_Printf(f,"\"%s\" ", name);
                FS_Printf(f,"\"%s\"\n", PRVM_UglyValueString((etype_t)type, (prvm_eval_t *)&prog->globals.generic[def->ofs]));
+               prog->statestring = NULL;
        }
        FS_Print(f,"}\n");
 }
index ae340eece405769163407311c0ece5420106518f..8bb0d77a6fb230ff6797dac7bb37565b7a418574 100644 (file)
@@ -452,6 +452,10 @@ void PRVM_PrintState(void)
        else
                Con_Print("null function executing??\n");
        PRVM_StackTrace ();
+       if(prog->statestring)
+       {
+               Con_Printf("Additional information: %s\n", prog->statestring);
+       }
 }
 
 extern sizebuf_t vm_tempstringsbuf;