mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 13:57:57 -07:00
PPCSymbolDB: Save data symbols properly
Data symbols were previously saved as function symbols.
This commit is contained in:
parent
aed0ac0543
commit
0a301c0eec
@ -395,16 +395,36 @@ bool PPCSymbolDB::SaveSymbolMap(const std::string& filename) const
|
||||
if (!f)
|
||||
return false;
|
||||
|
||||
// Write ".text" at the top
|
||||
fprintf(f.GetHandle(), ".text\n");
|
||||
std::vector<const Symbol*> function_symbols;
|
||||
std::vector<const Symbol*> data_symbols;
|
||||
|
||||
// Write symbol address, size, virtual address, alignment, name
|
||||
for (const auto& function : functions)
|
||||
{
|
||||
const Symbol& symbol = function.second;
|
||||
fprintf(f.GetHandle(), "%08x %08x %08x %i %s\n", symbol.address, symbol.size, symbol.address, 0,
|
||||
symbol.name.c_str());
|
||||
if (symbol.type == Symbol::Type::Function)
|
||||
function_symbols.push_back(&symbol);
|
||||
else
|
||||
data_symbols.push_back(&symbol);
|
||||
}
|
||||
|
||||
// Write .text section
|
||||
fprintf(f.GetHandle(), ".text section layout\n");
|
||||
for (const auto& symbol : function_symbols)
|
||||
{
|
||||
// Write symbol address, size, virtual address, alignment, name
|
||||
fprintf(f.GetHandle(), "%08x %08x %08x %i %s\n", symbol->address, symbol->size, symbol->address,
|
||||
0, symbol->name.c_str());
|
||||
}
|
||||
|
||||
// Write .data section
|
||||
fprintf(f.GetHandle(), "\n.data section layout\n");
|
||||
for (const auto& symbol : data_symbols)
|
||||
{
|
||||
// Write symbol address, size, virtual address, alignment, name
|
||||
fprintf(f.GetHandle(), "%08x %08x %08x %i %s\n", symbol->address, symbol->size, symbol->address,
|
||||
0, symbol->name.c_str());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user