summaryrefslogtreecommitdiff
path: root/Source/Core/Common/SymbolDB.cpp
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2013-12-07 15:14:29 -0500
committerJasper St. Pierre <jstpierre@mecheye.net>2013-12-31 14:03:19 -0500
commit34692ab826abc8f8faa61bdb2280b742424528f1 (patch)
treeb0eedc645badbea316ff59c125eaf808b28777ec /Source/Core/Common/SymbolDB.cpp
parent43e618682e8093602fc83dfa902ee7ae3fd3a4f6 (diff)
Remove unnecessary Src/ folders
Diffstat (limited to 'Source/Core/Common/SymbolDB.cpp')
-rw-r--r--Source/Core/Common/SymbolDB.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/Source/Core/Common/SymbolDB.cpp b/Source/Core/Common/SymbolDB.cpp
new file mode 100644
index 0000000000..e7a716de0f
--- /dev/null
+++ b/Source/Core/Common/SymbolDB.cpp
@@ -0,0 +1,50 @@
+// Copyright 2013 Dolphin Emulator Project
+// Licensed under GPLv2
+// Refer to the license.txt file included.
+
+#include "SymbolDB.h"
+
+
+void SymbolDB::List()
+{
+ for (XFuncMap::iterator iter = functions.begin(); iter != functions.end(); ++iter)
+ {
+ DEBUG_LOG(OSHLE, "%s @ %08x: %i bytes (hash %08x) : %i calls",
+ iter->second.name.c_str(), iter->second.address,
+ iter->second.size, iter->second.hash,
+ iter->second.numCalls);
+ }
+ INFO_LOG(OSHLE, "%lu functions known in this program above.",
+ (unsigned long)functions.size());
+}
+
+void SymbolDB::Clear(const char *prefix)
+{
+ // TODO: honor prefix
+ functions.clear();
+ checksumToFunction.clear();
+}
+
+void SymbolDB::Index()
+{
+ int i = 0;
+ for (auto& func : functions)
+ {
+ func.second.index = i++;
+ }
+}
+
+Symbol *SymbolDB::GetSymbolFromName(const char *name)
+{
+ for (auto& func : functions)
+ {
+ if (!strcmp(func.second.name.c_str(), name))
+ return &func.second;
+ }
+ return 0;
+}
+
+void SymbolDB::AddCompleteSymbol(const Symbol &symbol)
+{
+ functions.insert(std::pair<u32, Symbol>(symbol.address, symbol));
+}