yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::cli::agent::tools::MemoryInspectorBase Class Reference

Base class for memory inspection tools. More...

#include <memory_inspector_tool.h>

Inherits yaze::cli::resources::CommandHandler.

Inherited by yaze::cli::agent::tools::MemoryAnalyzeTool, yaze::cli::agent::tools::MemoryCheckTool, yaze::cli::agent::tools::MemoryCompareTool, yaze::cli::agent::tools::MemoryRegionsTool, and yaze::cli::agent::tools::MemorySearchTool.

Collaboration diagram for yaze::cli::agent::tools::MemoryInspectorBase:

Protected Member Functions

std::string DescribeAddress (uint32_t address) const
 Get description for a memory address.
 
std::string IdentifyDataType (uint32_t address) const
 Identify data type at address.
 
std::vector< MemoryRegionInfoGetKnownRegions () const
 Get known memory regions.
 
std::string FormatHex (const std::vector< uint8_t > &data, int bytes_per_line=16) const
 Format bytes as hex string.
 
std::string FormatAscii (const std::vector< uint8_t > &data) const
 Format bytes as ASCII (printable chars only)
 
absl::StatusOr< uint32_t > ParseAddress (const std::string &addr_str) const
 Parse address from string (supports hex with $ or 0x prefix)
 
- Protected Member Functions inherited from yaze::cli::resources::CommandHandler
virtual absl::Status ValidateArgs (const ArgumentParser &parser)=0
 Validate command arguments.
 
virtual absl::Status Execute (Rom *rom, const ArgumentParser &parser, OutputFormatter &formatter)=0
 Execute the command business logic.
 
virtual std::string GetDefaultFormat () const
 Get the default output format ("json" or "text")
 
virtual std::string GetOutputTitle () const
 Get the output title for formatting.
 

Additional Inherited Members

- Public Member Functions inherited from yaze::cli::resources::CommandHandler
virtual ~CommandHandler ()=default
 
absl::Status Run (const std::vector< std::string > &args, Rom *rom_context, std::string *captured_output=nullptr)
 Execute the command.
 
virtual std::string GetName () const =0
 Get the command name.
 
virtual Descriptor Describe () const
 Provide metadata for TUI/help summaries.
 
virtual std::string GetUsage () const =0
 Get the command usage string.
 
virtual bool RequiresRom () const
 Check if the command requires a loaded ROM.
 
virtual bool RequiresLabels () const
 Check if the command requires ROM labels.
 
virtual void SetProjectContext (project::YazeProject *project)
 Set the YazeProject context. Default implementation does nothing, override if tool needs project info.
 
virtual void SetAsarWrapper (core::AsarWrapper *asar_wrapper)
 Set the AsarWrapper context. Default implementation does nothing, override if tool needs Asar access.
 
virtual void SetRomContext (Rom *rom)
 Set the ROM context for tools that need ROM access. Default implementation stores the ROM pointer for subclass use.
 
virtual void SetAssemblySymbolTable (const std::map< std::string, core::AsarSymbol > *table)
 Optional Asar symbol table for assembly-aware tools.
 
virtual void SetSymbolProvider (emu::debug::SymbolProvider *provider)
 Set the SymbolProvider context.
 
- Protected Attributes inherited from yaze::cli::resources::CommandHandler
Romrom_ = nullptr
 
emu::debug::SymbolProvidersymbol_provider_ = nullptr
 
project::YazeProjectproject_ = nullptr
 
core::AsarWrapperasar_wrapper_ = nullptr
 
const std::map< std::string, core::AsarSymbol > * assembly_symbol_table_
 

Detailed Description

Base class for memory inspection tools.

Definition at line 120 of file memory_inspector_tool.h.

Member Function Documentation

◆ DescribeAddress()

◆ IdentifyDataType()

◆ GetKnownRegions()

◆ FormatHex()

std::string yaze::cli::agent::tools::MemoryInspectorBase::FormatHex ( const std::vector< uint8_t > & data,
int bytes_per_line = 16 ) const
protected

Format bytes as hex string.

Definition at line 197 of file memory_inspector_tool.cc.

◆ FormatAscii()

std::string yaze::cli::agent::tools::MemoryInspectorBase::FormatAscii ( const std::vector< uint8_t > & data) const
protected

Format bytes as ASCII (printable chars only)

Definition at line 210 of file memory_inspector_tool.cc.

◆ ParseAddress()

absl::StatusOr< uint32_t > yaze::cli::agent::tools::MemoryInspectorBase::ParseAddress ( const std::string & addr_str) const
protected

Parse address from string (supports hex with $ or 0x prefix)

Definition at line 220 of file memory_inspector_tool.cc.

Referenced by yaze::cli::agent::tools::MemoryAnalyzeTool::Execute(), and yaze::cli::agent::tools::MemoryCompareTool::Execute().


The documentation for this class was generated from the following files: