qboolean PRVM_ED_ParseEpair(prvm_edict_t *ent, ddef_t *key, const char *s);
// 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 prvm_boundscheck = {0, "prvm_boundscheck", "1"};
+cvar_t prvm_boundscheck = {0, "prvm_boundscheck", "1", "enables detection of out of bounds memory access in the QuakeC code being run (in other words, prevents really exceedingly bad QuakeC code from doing nasty things to your computer)"};
// LordHavoc: prints every opcode as it executes - warning: this is significant spew
-cvar_t prvm_traceqc = {0, "prvm_traceqc", "0"};
+cvar_t prvm_traceqc = {0, "prvm_traceqc", "0", "prints every QuakeC statement as it is executed (only for really thorough debugging!)"};
//============================================================================
// mempool handling
Used for initial level load and for savegames.
====================
*/
+extern cvar_t developer_entityparsing;
const char *PRVM_ED_ParseEdict (const char *data, prvm_edict_t *ent)
{
ddef_t *key;
// parse key
if (!COM_ParseToken(&data, false))
PRVM_ERROR ("PRVM_ED_ParseEdict: EOF without closing brace");
+ if (developer_entityparsing.integer)
+ Con_Printf("Key: \"%s\"", com_token);
if (com_token[0] == '}')
break;
// parse value
if (!COM_ParseToken(&data, false))
PRVM_ERROR ("PRVM_ED_ParseEdict: EOF without closing brace");
+ if (developer_entityparsing.integer)
+ Con_Printf(" \"%s\"\n", com_token);
if (com_token[0] == '}')
PRVM_ERROR ("PRVM_ED_ParseEdict: closing brace without data");
<Spike> SafeWrite (h, statement_linenums, numstatements*sizeof(int));
*/
if( (unsigned) filesize < (6 + prog->progs->numstatements) * sizeof( int ) ) {
- return;
+ Mem_Free(lno);
+ return;
}
header = (unsigned int *) lno;
PRVM_ERROR("PRVM_LoadProgs: out of bounds global index (statement %d) in %s", i, PRVM_NAME);
break;
default:
- PRVM_ERROR("PRVM_LoadProgs: unknown opcode %d at statement %d in %s", st->op, i, PRVM_NAME);
+ Con_DPrintf("PRVM_LoadProgs: unknown opcode %d at statement %d in %s", st->op, i, PRVM_NAME);
break;
}
}
*/
void PRVM_Init (void)
{
- Cmd_AddCommand ("prvm_edict", PRVM_ED_PrintEdict_f);
- Cmd_AddCommand ("prvm_edicts", PRVM_ED_PrintEdicts_f);
- Cmd_AddCommand ("prvm_edictcount", PRVM_ED_Count_f);
- Cmd_AddCommand ("prvm_profile", PRVM_Profile_f);
- Cmd_AddCommand ("prvm_fields", PRVM_Fields_f);
- Cmd_AddCommand ("prvm_globals", PRVM_Globals_f);
- Cmd_AddCommand ("prvm_global", PRVM_Global_f);
- Cmd_AddCommand ("prvm_globalset", PRVM_GlobalSet_f);
- Cmd_AddCommand ("prvm_edictset", PRVM_ED_EdictSet_f);
+ Cmd_AddCommand ("prvm_edict", PRVM_ED_PrintEdict_f, "print all data about an entity number in the selected VM (server, client, menu)");
+ Cmd_AddCommand ("prvm_edicts", PRVM_ED_PrintEdicts_f, "set a property on an entity number in the selected VM (server, client, menu)");
+ Cmd_AddCommand ("prvm_edictcount", PRVM_ED_Count_f, "prints number of active entities in the selected VM (server, client, menu)");
+ Cmd_AddCommand ("prvm_profile", PRVM_Profile_f, "prints execution statistics about the most used QuakeC functions in the selected VM (server, client, menu)");
+ Cmd_AddCommand ("prvm_fields", PRVM_Fields_f, "prints usage statistics on properties (how many entities have non-zero values) in the selected VM (server, client, menu)");
+ Cmd_AddCommand ("prvm_globals", PRVM_Globals_f, "prints all global variables in the selected VM (server, client, menu)");
+ Cmd_AddCommand ("prvm_global", PRVM_Global_f, "prints value of a specified global variable in the selected VM (server, client, menu)");
+ Cmd_AddCommand ("prvm_globalset", PRVM_GlobalSet_f, "sets value of a specified global variable in the selected VM (server, client, menu)");
+ Cmd_AddCommand ("prvm_edictset", PRVM_ED_EdictSet_f, "changes value of a specified property of a specified entity in the selected VM (server, client, menu)");
// 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 (&prvm_boundscheck);
Cvar_RegisterVariable (&prvm_traceqc);