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.
This commit is contained in:
TryTwo
2025-05-19 23:13:00 -07:00
parent 5eb61024c6
commit 040d9a4336
5 changed files with 122 additions and 5 deletions

View File

@ -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