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

Demonstrates memory debugging capabilities for AI agents. More...

Collaboration diagram for yaze::cli::agent::MemoryDebuggingExample:

Public Member Functions

 MemoryDebuggingExample (emu::Emulator *emulator)
 
absl::Status TrackPlayerHealth ()
 
absl::Status MonitorInventory ()
 
absl::Status DebugSpriteData ()
 
absl::Status TrackDMATransfers ()
 
absl::Status AnalyzeWatchpointData ()
 
absl::Status ExportWatchpointHistory (const std::string &filename)
 
void ClearDebugging ()
 
absl::Status RunMemoryDebuggingSession ()
 

Private Attributes

emu::Emulatoremulator_
 
emu::BreakpointManagerbreakpoint_mgr_
 
emu::WatchpointManagerwatchpoint_mgr_
 

Detailed Description

Demonstrates memory debugging capabilities for AI agents.

This example shows how to:

  1. Set memory breakpoints to pause on specific memory access
  2. Use watchpoints to track memory changes over time
  3. Analyze memory access patterns
  4. Export watchpoint data for analysis

Definition at line 32 of file memory_debugging_example.cc.

Constructor & Destructor Documentation

◆ MemoryDebuggingExample()

yaze::cli::agent::MemoryDebuggingExample::MemoryDebuggingExample ( emu::Emulator * emulator)
inline

Definition at line 34 of file memory_debugging_example.cc.

Member Function Documentation

◆ TrackPlayerHealth()

absl::Status yaze::cli::agent::MemoryDebuggingExample::TrackPlayerHealth ( )
inline

Example 1: Track writes to the player's health address

Definition at line 42 of file memory_debugging_example.cc.

References yaze::emu::BreakpointManager::AddBreakpoint(), yaze::emu::WatchpointManager::AddWatchpoint(), breakpoint_mgr_, yaze::emu::BreakpointManager::CPU_65816, LOG_INFO, watchpoint_mgr_, and yaze::emu::BreakpointManager::WRITE.

Referenced by RunMemoryDebuggingSession().

Here is the call graph for this function:

◆ MonitorInventory()

absl::Status yaze::cli::agent::MemoryDebuggingExample::MonitorInventory ( )
inline

Example 2: Monitor item inventory changes

Definition at line 77 of file memory_debugging_example.cc.

References yaze::emu::WatchpointManager::AddWatchpoint(), LOG_INFO, and watchpoint_mgr_.

Referenced by RunMemoryDebuggingSession().

Here is the call graph for this function:

◆ DebugSpriteData()

absl::Status yaze::cli::agent::MemoryDebuggingExample::DebugSpriteData ( )
inline

Example 3: Debug sprite corruption by tracking sprite data

Definition at line 100 of file memory_debugging_example.cc.

References yaze::emu::WatchpointManager::AddWatchpoint(), LOG_INFO, and watchpoint_mgr_.

Referenced by RunMemoryDebuggingSession().

Here is the call graph for this function:

◆ TrackDMATransfers()

absl::Status yaze::cli::agent::MemoryDebuggingExample::TrackDMATransfers ( )
inline

Example 4: Track DMA transfers

Definition at line 123 of file memory_debugging_example.cc.

References yaze::emu::WatchpointManager::AddWatchpoint(), LOG_INFO, and watchpoint_mgr_.

Referenced by RunMemoryDebuggingSession().

Here is the call graph for this function:

◆ AnalyzeWatchpointData()

absl::Status yaze::cli::agent::MemoryDebuggingExample::AnalyzeWatchpointData ( )
inline

Analyze collected watchpoint data

Definition at line 146 of file memory_debugging_example.cc.

References yaze::emu::WatchpointManager::GetAllWatchpoints(), yaze::emu::WatchpointManager::GetHistory(), LOG_INFO, and watchpoint_mgr_.

Referenced by RunMemoryDebuggingSession().

Here is the call graph for this function:

◆ ExportWatchpointHistory()

absl::Status yaze::cli::agent::MemoryDebuggingExample::ExportWatchpointHistory ( const std::string & filename)
inline

Export watchpoint data for external analysis

Definition at line 193 of file memory_debugging_example.cc.

References yaze::emu::WatchpointManager::ExportHistoryToCSV(), LOG_INFO, and watchpoint_mgr_.

Referenced by RunMemoryDebuggingSession().

Here is the call graph for this function:

◆ ClearDebugging()

void yaze::cli::agent::MemoryDebuggingExample::ClearDebugging ( )
inline

Clear all debugging state

Definition at line 204 of file memory_debugging_example.cc.

References breakpoint_mgr_, yaze::emu::BreakpointManager::ClearAll(), yaze::emu::WatchpointManager::ClearAll(), LOG_INFO, and watchpoint_mgr_.

Referenced by RunMemoryDebuggingSession().

Here is the call graph for this function:

◆ RunMemoryDebuggingSession()

absl::Status yaze::cli::agent::MemoryDebuggingExample::RunMemoryDebuggingSession ( )
inline

Member Data Documentation

◆ emulator_

emu::Emulator* yaze::cli::agent::MemoryDebuggingExample::emulator_
private

Definition at line 242 of file memory_debugging_example.cc.

Referenced by RunMemoryDebuggingSession().

◆ breakpoint_mgr_

emu::BreakpointManager& yaze::cli::agent::MemoryDebuggingExample::breakpoint_mgr_
private

Definition at line 243 of file memory_debugging_example.cc.

Referenced by ClearDebugging(), and TrackPlayerHealth().

◆ watchpoint_mgr_

emu::WatchpointManager& yaze::cli::agent::MemoryDebuggingExample::watchpoint_mgr_
private

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