mirror of
https://github.com/hedge-dev/XenonRecomp.git
synced 2025-10-30 07:11:38 +00:00
Revert "Added ability to alias function names to ease of debugging and reversing."
This reverts commit 8782d4dbd7.
This commit is contained in:
parent
0ddb5e5eb7
commit
bd25a87929
3 changed files with 2 additions and 32 deletions
|
|
@ -171,19 +171,7 @@ void Recompiler::Analyse()
|
||||||
for (auto& [address, size] : config.functions)
|
for (auto& [address, size] : config.functions)
|
||||||
{
|
{
|
||||||
functions.emplace_back(address, size);
|
functions.emplace_back(address, size);
|
||||||
// Check if there's a function alias for this address
|
image.symbols.emplace(fmt::format("sub_{:X}", address), address, size, Symbol_Function);
|
||||||
auto aliasIt = config.functionAliases.find(address);
|
|
||||||
std::string symbolName;
|
|
||||||
if (aliasIt != config.functionAliases.end())
|
|
||||||
{
|
|
||||||
symbolName = aliasIt->second;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
symbolName = fmt::format("sub_{:X}", address);
|
|
||||||
}
|
|
||||||
|
|
||||||
image.symbols.emplace(symbolName, address, size, Symbol_Function);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto& pdata = *image.Find(".pdata");
|
auto& pdata = *image.Find(".pdata");
|
||||||
|
|
@ -2796,13 +2784,7 @@ bool Recompiler::Recompile(const Function& fn)
|
||||||
|
|
||||||
auto symbol = image.symbols.find(fn.base);
|
auto symbol = image.symbols.find(fn.base);
|
||||||
std::string name;
|
std::string name;
|
||||||
auto aliasIt = config.functionAliases.find(fn.base);
|
if (symbol != image.symbols.end())
|
||||||
|
|
||||||
if (aliasIt != config.functionAliases.end())
|
|
||||||
{
|
|
||||||
name = aliasIt->second;
|
|
||||||
}
|
|
||||||
else if (symbol != image.symbols.end())
|
|
||||||
{
|
{
|
||||||
name = symbol->name;
|
name = symbol->name;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,17 +58,6 @@ void RecompilerConfig::Load(const std::string_view& configFilePath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (auto functionAliasesArray = main["function_aliases"].as_array())
|
|
||||||
{
|
|
||||||
for (auto& alias : *functionAliasesArray)
|
|
||||||
{
|
|
||||||
auto& aliasTable = *alias.as_table();
|
|
||||||
uint32_t address = *aliasTable["address"].value<uint32_t>();
|
|
||||||
std::string name = fmt::format("_gfn_{}", *aliasTable["name"].value<std::string>());
|
|
||||||
functionAliases.emplace(address, std::move(name));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (auto invalidArray = main["invalid_instructions"].as_array())
|
if (auto invalidArray = main["invalid_instructions"].as_array())
|
||||||
{
|
{
|
||||||
for (auto& instr : *invalidArray)
|
for (auto& instr : *invalidArray)
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,6 @@ struct RecompilerConfig
|
||||||
std::unordered_map<uint32_t, uint32_t> functions;
|
std::unordered_map<uint32_t, uint32_t> functions;
|
||||||
std::unordered_map<uint32_t, uint32_t> invalidInstructions;
|
std::unordered_map<uint32_t, uint32_t> invalidInstructions;
|
||||||
std::unordered_map<uint32_t, RecompilerMidAsmHook> midAsmHooks;
|
std::unordered_map<uint32_t, RecompilerMidAsmHook> midAsmHooks;
|
||||||
std::unordered_map<uint32_t, std::string> functionAliases;
|
|
||||||
|
|
||||||
void Load(const std::string_view& configFilePath);
|
void Load(const std::string_view& configFilePath);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue