Add a log type for Symbols and move symbols related logs to it

This fix the awkwardness of having the symbols detection, parsing and loading related logs be in OS HLE while they don't have anything to do with that.
This commit is contained in:
aldelaro5 2018-03-22 03:18:25 -04:00
commit c54e56793a
No known key found for this signature in database
GPG key ID: 054DD3E6FF48DB71
9 changed files with 48 additions and 45 deletions

View file

@ -331,7 +331,7 @@ void RSOView::LoadImports()
{
std::size_t size = m_header.GetImportsSize();
if (size % sizeof(RSOImport) != 0)
WARN_LOG(OSHLE, "RSO Imports Table has an incoherent size (%08zx)", size);
WARN_LOG(SYMBOLS, "RSO Imports Table has an incoherent size (%08zx)", size);
m_imports.Load(m_header.GetImportsOffset(), size / sizeof(RSOImport));
}
@ -339,7 +339,7 @@ void RSOView::LoadExports()
{
std::size_t size = m_header.GetExportsSize();
if (size % sizeof(RSOExport) != 0)
WARN_LOG(OSHLE, "RSO Exports Table has an incoherent size (%08zx)", size);
WARN_LOG(SYMBOLS, "RSO Exports Table has an incoherent size (%08zx)", size);
m_exports.Load(m_header.GetExportsOffset(), size / sizeof(RSOExport));
}
@ -347,7 +347,7 @@ void RSOView::LoadInternals()
{
std::size_t size = m_header.GetInternalsSize();
if (size % sizeof(RSOInternalsEntry) != 0)
WARN_LOG(OSHLE, "RSO Internals Relocation Table has an incoherent size (%08zx)", size);
WARN_LOG(SYMBOLS, "RSO Internals Relocation Table has an incoherent size (%08zx)", size);
m_imports.Load(m_header.GetInternalsOffset(), size / sizeof(RSOInternalsEntry));
}
@ -355,7 +355,7 @@ void RSOView::LoadExternals()
{
std::size_t size = m_header.GetExternalsSize();
if (size % sizeof(RSOExternalsEntry) != 0)
WARN_LOG(OSHLE, "RSO Externals Relocation Table has an incoherent size (%08zx)", size);
WARN_LOG(SYMBOLS, "RSO Externals Relocation Table has an incoherent size (%08zx)", size);
m_imports.Load(m_header.GetExternalsOffset(), size / sizeof(RSOExternalsEntry));
}
@ -393,7 +393,7 @@ void RSOView::Apply(PPCSymbolDB* symbol_db) const
}
}
}
DEBUG_LOG(OSHLE, "RSO(%s): %zu symbols applied", GetName().c_str(), GetExportsCount());
DEBUG_LOG(SYMBOLS, "RSO(%s): %zu symbols applied", GetName().c_str(), GetExportsCount());
}
u32 RSOView::GetNextEntry() const
@ -530,9 +530,9 @@ u32 RSOView::GetProlog() const
{
u32 section_index = m_header.GetPrologSectionIndex();
if (section_index == 0)
WARN_LOG(OSHLE, "RSO doesn't have a prolog function");
WARN_LOG(SYMBOLS, "RSO doesn't have a prolog function");
else if (section_index >= m_sections.Count())
WARN_LOG(OSHLE, "RSO prolog section index out of bound");
WARN_LOG(SYMBOLS, "RSO prolog section index out of bound");
else
return GetSection(section_index).offset + m_header.GetPrologSectionOffset();
return 0;
@ -542,9 +542,9 @@ u32 RSOView::GetEpilog() const
{
u32 section_index = m_header.GetEpilogSectionIndex();
if (section_index == 0)
WARN_LOG(OSHLE, "RSO doesn't have an epilog function");
WARN_LOG(SYMBOLS, "RSO doesn't have an epilog function");
else if (section_index >= m_sections.Count())
WARN_LOG(OSHLE, "RSO epilog section index out of bound");
WARN_LOG(SYMBOLS, "RSO epilog section index out of bound");
else
return GetSection(section_index).offset + m_header.GetEpilogSectionOffset();
return 0;
@ -554,9 +554,9 @@ u32 RSOView::GetUnresolved() const
{
u32 section_index = m_header.GetUnresolvedSectionIndex();
if (section_index == 0)
WARN_LOG(OSHLE, "RSO doesn't have a unresolved function");
WARN_LOG(SYMBOLS, "RSO doesn't have a unresolved function");
else if (section_index >= m_sections.Count())
WARN_LOG(OSHLE, "RSO unresolved section index out of bound");
WARN_LOG(SYMBOLS, "RSO unresolved section index out of bound");
else
return GetSection(section_index).offset + m_header.GetUnresolvedSectionOffset();
return 0;
@ -567,7 +567,7 @@ bool RSOChainView::Load(u32 address)
// Load node
RSOView node;
node.LoadHeader(address);
DEBUG_LOG(OSHLE, "RSOChain node name: %s", node.GetName().c_str());
DEBUG_LOG(SYMBOLS, "RSOChain node name: %s", node.GetName().c_str());
m_chain.emplace_front(std::move(node));
if (LoadNextChain(m_chain.front()) && LoadPrevChain(m_chain.front()))
@ -613,8 +613,8 @@ bool RSOChainView::LoadNextChain(const RSOView& view)
if (prev_address != next_node.GetPrevEntry())
{
ERROR_LOG(OSHLE, "RSOChain has an incoherent previous link %08x != %08x in %s", prev_address,
next_node.GetPrevEntry(), next_node.GetName().c_str());
ERROR_LOG(SYMBOLS, "RSOChain has an incoherent previous link %08x != %08x in %s",
prev_address, next_node.GetPrevEntry(), next_node.GetName().c_str());
return false;
}
@ -638,7 +638,7 @@ bool RSOChainView::LoadPrevChain(const RSOView& view)
if (next_address != prev_node.GetNextEntry())
{
ERROR_LOG(OSHLE, "RSOChain has an incoherent next link %08x != %08x in %s", next_address,
ERROR_LOG(SYMBOLS, "RSOChain has an incoherent next link %08x != %08x in %s", next_address,
prev_node.GetNextEntry(), prev_node.GetName().c_str());
return false;
}