PPCSymbolDB: Remove biased address check

The appropriate check is already done by PPCAnalyst::AnalyzeFunction.
This commit is contained in:
Sepalani 2017-05-16 22:03:15 +01:00
parent 8be41d3b7c
commit e0231d0b30
2 changed files with 14 additions and 20 deletions

View File

@ -4,6 +4,7 @@
#include <map>
#include <string>
#include <utility>
#include <vector>
#include "Common/CommonTypes.h"
@ -38,28 +39,21 @@ PPCSymbolDB::~PPCSymbolDB()
}
// Adds the function to the list, unless it's already there
Symbol* PPCSymbolDB::AddFunction(u32 startAddr)
Symbol* PPCSymbolDB::AddFunction(u32 start_addr)
{
if (startAddr < 0x80000010)
// It's already in the list
if (functions.find(start_addr) != functions.end())
return nullptr;
XFuncMap::iterator iter = functions.find(startAddr);
if (iter != functions.end())
{
// it's already in the list
Symbol symbol;
if (!PPCAnalyst::AnalyzeFunction(start_addr, symbol))
return nullptr;
}
else
{
Symbol tempFunc; // the current one we're working on
u32 targetEnd = PPCAnalyst::AnalyzeFunction(startAddr, tempFunc);
if (targetEnd == 0)
return nullptr; // found a dud :(
// LOG(OSHLE, "Symbol found at %08x", startAddr);
functions[startAddr] = tempFunc;
tempFunc.type = Symbol::Type::Function;
checksumToFunction[tempFunc.hash].insert(&functions[startAddr]);
return &functions[startAddr];
}
functions[start_addr] = std::move(symbol);
Symbol* ptr = &functions[start_addr];
ptr->type = Symbol::Type::Function;
checksumToFunction[ptr->hash].insert(ptr);
return ptr;
}
void PPCSymbolDB::AddKnownSymbol(u32 startAddr, u32 size, const std::string& name,

View File

@ -25,7 +25,7 @@ public:
PPCSymbolDB();
~PPCSymbolDB();
Symbol* AddFunction(u32 startAddr) override;
Symbol* AddFunction(u32 start_addr) override;
void AddKnownSymbol(u32 startAddr, u32 size, const std::string& name,
Symbol::Type type = Symbol::Type::Function);