summaryrefslogtreecommitdiff
path: root/Source/Core/Common
diff options
context:
space:
mode:
authorTryTwo <taolas@gmail.com>2025-05-19 23:13:00 -0700
committerTryTwo <taolas@gmail.com>2025-06-19 17:55:35 -0700
commit040d9a43367f4e2a3aa57ddb47c41d5d13b5b39e (patch)
treefd38ce078e8bf2842e5350a195bee18da122d614 /Source/Core/Common
parent5eb61024c6e94b949ce21eac81003b43587fc155 (diff)
Debugger symbols: Add new symbol type: Notes.. Notes are for naming single instructions, or small groups of instructions.
Notes are separate from function symbols, and can be searched separately. Unlike functions, notes of different length can overlap each other. In the instruction window, a note will always display over the function symbol.
Diffstat (limited to 'Source/Core/Common')
-rw-r--r--Source/Core/Common/SymbolDB.cpp1
-rw-r--r--Source/Core/Common/SymbolDB.h13
2 files changed, 14 insertions, 0 deletions
diff --git a/Source/Core/Common/SymbolDB.cpp b/Source/Core/Common/SymbolDB.cpp
index f9d352b415..bfdd9f57db 100644
--- a/Source/Core/Common/SymbolDB.cpp
+++ b/Source/Core/Common/SymbolDB.cpp
@@ -51,6 +51,7 @@ void SymbolDB::Clear(const char* prefix)
{
// TODO: honor prefix
m_functions.clear();
+ m_notes.clear();
m_checksum_to_function.clear();
}
diff --git a/Source/Core/Common/SymbolDB.h b/Source/Core/Common/SymbolDB.h
index 255994b3c2..8930b95996 100644
--- a/Source/Core/Common/SymbolDB.h
+++ b/Source/Core/Common/SymbolDB.h
@@ -29,6 +29,16 @@ struct SCall
u32 call_address;
};
+struct Note
+{
+ std::string name;
+ u32 address = 0;
+ u32 size = 0;
+ int layer = 0;
+
+ Note() = default;
+};
+
struct Symbol
{
enum class Type
@@ -71,6 +81,7 @@ class SymbolDB
{
public:
using XFuncMap = std::map<u32, Symbol>;
+ using XNoteMap = std::map<u32, Note>;
using XFuncPtrMap = std::map<u32, std::set<Symbol*>>;
SymbolDB();
@@ -86,6 +97,7 @@ public:
std::vector<Symbol*> GetSymbolsFromHash(u32 hash);
const XFuncMap& Symbols() const { return m_functions; }
+ const XNoteMap& Notes() const { return m_notes; }
XFuncMap& AccessSymbols() { return m_functions; }
bool IsEmpty() const;
void Clear(const char* prefix = "");
@@ -94,6 +106,7 @@ public:
protected:
XFuncMap m_functions;
+ XNoteMap m_notes;
XFuncPtrMap m_checksum_to_function;
};
} // namespace Common