20#include <unordered_map>
23#include "../TaskSystem/LocalBlackboard.h"
24#include "../TaskSystem/TaskGraphTypes.h"
126 const std::string& graphName =
"",
127 const std::string& nodeName =
"");
139 const std::string& graphName =
"",
140 const std::string& nodeName =
"");
266 const std::string& graphName =
"",
267 const std::string& nodeName =
"");
ComponentTypeID GetComponentTypeID_Static()
Singleton that manages runtime debugging of VS graphs.
void StartDebugging(int graphID)
Starts a debug session for the given graph.
int GetCurrentNodeID() const
Returns the node being executed (-1 if none).
LocalBlackboard GetCurrentBlackboard() const
Returns a copy of the blackboard snapshot from the last OnNodeExecuting() call.
void Continue()
Resumes execution from Paused state.
void ClearBreakpoint(int graphID, int nodeID)
Removes the breakpoint at (graphID, nodeID) if it exists.
std::vector< BreakpointInfo > GetBreakpoints(int graphID) const
Returns all registered breakpoints for graphID.
void StepNext()
Executes the next node then pauses.
std::vector< SubGraphStackFrame > m_callStack
Call stack (index 0 = bottom / entry, back = current)
void PopCallFrame()
Pop the top SubGraph frame from the call stack.
int MakeBreakpointKey(int graphID, int nodeID) const
std::vector< SubGraphStackFrame > GetCallStack() const
Returns the current SubGraph call stack (most recent at front).
void StepOut()
Runs until the current SubGraph returns.
void ToggleBreakpoint(int graphID, int nodeID, const std::string &graphName="", const std::string &nodeName="")
Toggles the breakpoint at (graphID, nodeID).
void SetBreakpointEnabled(int graphID, int nodeID, bool enabled)
Enables or disables an existing breakpoint.
void SetHeadlessMode(bool headless)
When true, OnNodeExecuting() never busy-waits on Paused.
bool HasBreakpointLocked(int graphID, int nodeID) const
void ClearAllBreakpoints()
Removes all breakpoints.
DebugController & operator=(const DebugController &)=delete
static DebugController & Get()
Returns the singleton instance (Meyers pattern).
std::vector< BreakpointInfo > GetAllBreakpoints() const
Returns all registered breakpoints across all graphs.
void StopDebugging()
Stops the current debug session.
DebugState GetState() const
Returns the current debug state.
int GetCurrentGraphID() const
Returns the currently debugged graphID (-1 if none).
void Pause()
Pauses execution.
void PushCallFrame(int graphID, int nodeID, const std::string &graphName="", const std::string &nodeName="")
Push a SubGraph frame onto the call stack.
std::unordered_map< int, BreakpointInfo > m_breakpoints
Breakpoints keyed by (graphID * 100000 + nodeID)
void StepInto()
Steps into a SubGraph if the next node is a SubGraph node.
DebugController(const DebugController &)=delete
bool IsDebugging() const
Returns true when a debug session is active.
bool HasBreakpoint(int graphID, int nodeID) const
Returns true if an enabled breakpoint exists at (graphID, nodeID).
void SetBreakpoint(int graphID, int nodeID, const std::string &graphName="", const std::string &nodeName="")
Registers a breakpoint at (graphID, nodeID).
void OnNodeExecuting(int graphID, int nodeID, const LocalBlackboard *bb)
Called by VSGraphExecutor before executing a node.
LocalBlackboard m_bbSnapshot
Simple map-based blackboard for task graph runtime state.
< Provides AssetID and INVALID_ASSET_ID
DebugState
States of the debug controller state machine.
@ NotDebugging
No active debug session.
@ StepNext
Execute next node then pause.
@ StepOut
Run until the current SubGraph returns.
@ Running
Normal execution.
@ StepInto
Step into a SubGraph on next SubGraph node.
@ Paused
Stopped at a breakpoint or manual pause.
Describes a single breakpoint.
std::string graphName
Human-readable graph file name.
std::string nodeName
Human-readable node name.
Uniquely identifies a breakpoint by graphID + nodeID.
bool operator==(const BreakpointKey &o) const
A single frame in the debugger's SubGraph call stack.
bool isCurrent
true for the top-most (active) frame