Add environment variables to skip global and vtable initialization

develop
lethosor 2015-07-23 23:25:01 -04:00
parent 27295a9b6f
commit 03aa2399a0
1 changed files with 4 additions and 0 deletions

@ -81,6 +81,8 @@ VersionInfo * VersionInfoFactory::getVersionInfoByPETimestamp(uint32_t timestamp
void VersionInfoFactory::ParseVersion (TiXmlElement* entry, VersionInfo* mem) void VersionInfoFactory::ParseVersion (TiXmlElement* entry, VersionInfo* mem)
{ {
bool no_vtables = getenv("DFHACK_NO_VTABLES");
bool no_globals = getenv("DFHACK_NO_GLOBALS");
TiXmlElement* pMemEntry; TiXmlElement* pMemEntry;
const char *cstr_name = entry->Attribute("name"); const char *cstr_name = entry->Attribute("name");
if (!cstr_name) if (!cstr_name)
@ -136,6 +138,8 @@ void VersionInfoFactory::ParseVersion (TiXmlElement* entry, VersionInfo* mem)
cerr << "Dummy symbol table entry: " << cstr_key << endl; cerr << "Dummy symbol table entry: " << cstr_key << endl;
continue; continue;
} }
if ((is_vtable && no_vtables) || (!is_vtable && no_globals))
continue;
uint32_t addr = strtol(cstr_value, 0, 0); uint32_t addr = strtol(cstr_value, 0, 0);
if (is_vtable) if (is_vtable)
mem->setVTable(cstr_key, addr); mem->setVTable(cstr_key, addr);