PPCSymbolDB: Remove biased address check
The appropriate check is already done by PPCAnalyst::AnalyzeFunction.
This commit is contained in:
parent
8be41d3b7c
commit
e0231d0b30
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
|
@ -38,28 +39,21 @@ PPCSymbolDB::~PPCSymbolDB()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adds the function to the list, unless it's already there
|
// 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;
|
return nullptr;
|
||||||
XFuncMap::iterator iter = functions.find(startAddr);
|
|
||||||
if (iter != functions.end())
|
Symbol symbol;
|
||||||
{
|
if (!PPCAnalyst::AnalyzeFunction(start_addr, symbol))
|
||||||
// it's already in the list
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
|
||||||
else
|
functions[start_addr] = std::move(symbol);
|
||||||
{
|
Symbol* ptr = &functions[start_addr];
|
||||||
Symbol tempFunc; // the current one we're working on
|
ptr->type = Symbol::Type::Function;
|
||||||
u32 targetEnd = PPCAnalyst::AnalyzeFunction(startAddr, tempFunc);
|
checksumToFunction[ptr->hash].insert(ptr);
|
||||||
if (targetEnd == 0)
|
return ptr;
|
||||||
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];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PPCSymbolDB::AddKnownSymbol(u32 startAddr, u32 size, const std::string& name,
|
void PPCSymbolDB::AddKnownSymbol(u32 startAddr, u32 size, const std::string& name,
|
||||||
|
|
|
@ -25,7 +25,7 @@ public:
|
||||||
PPCSymbolDB();
|
PPCSymbolDB();
|
||||||
~PPCSymbolDB();
|
~PPCSymbolDB();
|
||||||
|
|
||||||
Symbol* AddFunction(u32 startAddr) override;
|
Symbol* AddFunction(u32 start_addr) override;
|
||||||
void AddKnownSymbol(u32 startAddr, u32 size, const std::string& name,
|
void AddKnownSymbol(u32 startAddr, u32 size, const std::string& name,
|
||||||
Symbol::Type type = Symbol::Type::Function);
|
Symbol::Type type = Symbol::Type::Function);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue