diff --git a/Source/Core/Core/PowerPC/SignatureDB/SignatureDB.cpp b/Source/Core/Core/PowerPC/SignatureDB/SignatureDB.cpp index a10cfc38a5..0f7e417612 100644 --- a/Source/Core/Core/PowerPC/SignatureDB/SignatureDB.cpp +++ b/Source/Core/Core/PowerPC/SignatureDB/SignatureDB.cpp @@ -18,7 +18,7 @@ #include "Core/PowerPC/SignatureDB/DSYSignatureDB.h" std::unique_ptr -SignatureDB::CreateFormatHandler(const std::string& file_path) +SignatureDB::CreateFormatHandler(const std::string& file_path) const { if (StringEndsWith(file_path, ".csv")) return std::make_unique(); @@ -31,7 +31,7 @@ bool SignatureDB::Load(const std::string& file_path) return handler->Load(file_path, m_database); } -bool SignatureDB::Save(const std::string& file_path) +bool SignatureDB::Save(const std::string& file_path) const { auto handler = CreateFormatHandler(file_path); return handler->Save(file_path, m_database); @@ -53,7 +53,7 @@ bool SignatureDB::Save(const std::string& file_path) return hash; }*/ -void SignatureDB::List() +void SignatureDB::List() const { for (const auto& entry : m_database) { @@ -68,7 +68,7 @@ void SignatureDB::Clear() m_database.clear(); } -void SignatureDB::Apply(PPCSymbolDB* symbol_db) +void SignatureDB::Apply(PPCSymbolDB* symbol_db) const { for (const auto& entry : m_database) { @@ -92,13 +92,13 @@ void SignatureDB::Apply(PPCSymbolDB* symbol_db) symbol_db->Index(); } -void SignatureDB::Initialize(PPCSymbolDB* symbol_db, const std::string& prefix) +void SignatureDB::Populate(const PPCSymbolDB* symbol_db, const std::string& filter) { for (const auto& symbol : symbol_db->Symbols()) { - if ((prefix.empty() && (!symbol.second.name.empty()) && + if ((filter.empty() && (!symbol.second.name.empty()) && symbol.second.name.substr(0, 3) != "zz_" && symbol.second.name.substr(0, 1) != ".") || - ((!prefix.empty()) && symbol.second.name.substr(0, prefix.size()) == prefix)) + ((!filter.empty()) && symbol.second.name.substr(0, filter.size()) == filter)) { DBFunc temp_dbfunc; temp_dbfunc.name = symbol.second.name; diff --git a/Source/Core/Core/PowerPC/SignatureDB/SignatureDB.h b/Source/Core/Core/PowerPC/SignatureDB/SignatureDB.h index d0f0c46231..0d64211de1 100644 --- a/Source/Core/Core/PowerPC/SignatureDB/SignatureDB.h +++ b/Source/Core/Core/PowerPC/SignatureDB/SignatureDB.h @@ -33,17 +33,17 @@ public: // Does not clear. Remember to clear first if that's what you want. bool Load(const std::string& file_path); - bool Save(const std::string& file_path); + bool Save(const std::string& file_path) const; + void List() const; void Clear(); - void List(); - void Initialize(PPCSymbolDB* func_db, const std::string& prefix = ""); - void Apply(PPCSymbolDB* func_db); + void Populate(const PPCSymbolDB* func_db, const std::string& filter = ""); + void Apply(PPCSymbolDB* func_db) const; static u32 ComputeCodeChecksum(u32 offsetStart, u32 offsetEnd); private: - std::unique_ptr CreateFormatHandler(const std::string& file_path); + std::unique_ptr CreateFormatHandler(const std::string& file_path) const; // Map from signature to function. We store the DB in this map because it optimizes the // most common operation - lookup. We don't care about ordering anyway. FuncDB m_database; diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index f271c8a979..c939126827 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -353,7 +353,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) if (!path.IsEmpty()) { SignatureDB db; - db.Initialize(&g_symbolDB, prefix); + db.Populate(&g_symbolDB, prefix); db.Save(WxStrToStr(path)); db.List(); } @@ -376,7 +376,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) if (!path.IsEmpty()) { SignatureDB db; - db.Initialize(&g_symbolDB, prefix); + db.Populate(&g_symbolDB, prefix); db.List(); db.Load(WxStrToStr(path)); db.Save(WxStrToStr(path));