Fixing analysis regression: don't analyze on gets during analysis pass.

This commit is contained in:
Ben Vanik 2013-05-26 02:11:08 -07:00
parent f94256aaaf
commit 6b851da9d7
3 changed files with 6 additions and 4 deletions

View File

@ -153,7 +153,7 @@ int ExecModule::Init() {
} }
FunctionSymbol* ExecModule::FindFunctionSymbol(uint32_t address) { FunctionSymbol* ExecModule::FindFunctionSymbol(uint32_t address) {
return sdb_->GetFunction(address); return sdb_->GetFunction(address, true);
} }
void ExecModule::Dump() { void ExecModule::Dump() {

View File

@ -147,7 +147,7 @@ VariableSymbol* SymbolDatabase::GetOrInsertVariable(uint32_t address) {
return var; return var;
} }
FunctionSymbol* SymbolDatabase::GetFunction(uint32_t address) { FunctionSymbol* SymbolDatabase::GetFunction(uint32_t address, bool analyze) {
SymbolMap::iterator i = symbols_.find(address); SymbolMap::iterator i = symbols_.find(address);
if (i != symbols_.end() && i->second->symbol_type == Symbol::Function) { if (i != symbols_.end() && i->second->symbol_type == Symbol::Function) {
return static_cast<FunctionSymbol*>(i->second); return static_cast<FunctionSymbol*>(i->second);
@ -161,7 +161,9 @@ FunctionSymbol* SymbolDatabase::GetFunction(uint32_t address) {
symbols_.insert(SymbolMap::value_type(address, fn)); symbols_.insert(SymbolMap::value_type(address, fn));
scan_queue_.push_back(fn); scan_queue_.push_back(fn);
FlushQueue(); if (analyze) {
FlushQueue();
}
return fn; return fn;
} }

View File

@ -39,7 +39,7 @@ public:
FunctionSymbol* GetOrInsertFunction( FunctionSymbol* GetOrInsertFunction(
uint32_t address, FunctionSymbol* opt_call_source = NULL); uint32_t address, FunctionSymbol* opt_call_source = NULL);
VariableSymbol* GetOrInsertVariable(uint32_t address); VariableSymbol* GetOrInsertVariable(uint32_t address);
FunctionSymbol* GetFunction(uint32_t address); FunctionSymbol* GetFunction(uint32_t address, bool analyze = false);
VariableSymbol* GetVariable(uint32_t address); VariableSymbol* GetVariable(uint32_t address);
int GetAllVariables(std::vector<VariableSymbol*>& variables); int GetAllVariables(std::vector<VariableSymbol*>& variables);