1#ifndef YAZE_APP_EMU_DEBUG_SYMBOL_PROVIDER_H_
2#define YAZE_APP_EMU_DEBUG_SYMBOL_PROVIDER_H_
10#include "absl/status/status.h"
11#include "absl/status/statusor.h"
29 Symbol(
const std::string& n, uint32_t addr)
31 Symbol(
const std::string& n, uint32_t addr,
const std::string& f,
int l)
127 std::optional<Symbol>
GetSymbol(uint32_t address)
const;
138 std::optional<Symbol>
FindSymbol(
const std::string& name)
const;
168 uint32_t max_offset = 0x100)
const;
188 const std::string& filename);
195 const std::string& extension)
const;
Provider for symbol (label) resolution in disassembly.
std::function< std::string(uint32_t)> CreateResolver() const
Create a symbol resolver function for the disassembler.
std::vector< Symbol > GetSymbolsInRange(uint32_t start, uint32_t end) const
Get all symbols in an address range.
bool HasSymbols() const
Check if any symbols are loaded.
std::string FormatAddress(uint32_t address, uint32_t max_offset=0x100) const
Format an address with symbol info.
void AddSymbol(const Symbol &symbol)
Add a single symbol manually.
std::map< std::string, Symbol > symbols_by_name_
size_t GetSymbolCount() const
Get total number of loaded symbols.
std::vector< Symbol > GetSymbolsAtAddress(uint32_t address) const
Get all symbols at an address (there may be multiple)
void AddAsarSymbols(const std::vector< Symbol > &symbols)
Add symbols from Asar patch results.
absl::Status ParseBsnesSymFile(const std::string &content)
absl::Status LoadAsarAsmDirectory(const std::string &directory_path)
Load symbols from a directory of ASM files.
absl::Status ParseWlaDxSymFile(const std::string &content)
std::multimap< uint32_t, Symbol > symbols_by_address_
absl::Status LoadAsarAsmFile(const std::string &path)
Load symbols from an Asar-style ASM file (usdasm format)
SymbolFormat DetectFormat(const std::string &content, const std::string &extension) const
absl::Status LoadSymbolFile(const std::string &path, SymbolFormat format=SymbolFormat::kAuto)
Load symbols from a .sym file (various formats)
std::string GetSymbolName(uint32_t address) const
Get symbol name for an address.
void Clear()
Clear all loaded symbols.
std::optional< Symbol > GetNearestSymbol(uint32_t address) const
Get nearest symbol at or before an address.
absl::Status ParseAsarAsmContent(const std::string &content, const std::string &filename)
absl::Status ParseMesenMlbFile(const std::string &content)
std::optional< Symbol > GetSymbol(uint32_t address) const
Get full symbol info for an address.
std::optional< Symbol > FindSymbol(const std::string &name) const
Find symbol by name.
std::vector< Symbol > FindSymbolsMatching(const std::string &pattern) const
Find symbols matching a pattern (supports wildcards)
SymbolFormat
Supported symbol file formats.
Information about a symbol (label, constant, or address)
Symbol(const std::string &n, uint32_t addr, const std::string &f, int l)
Symbol(const std::string &n, uint32_t addr)