44 return graphID * 100000 + nodeID;
53 return it->second.enabled;
61 const std::string& graphName,
62 const std::string& nodeName)
69 bp.graphName = graphName;
70 bp.nodeName = nodeName;
83 const std::string& graphName,
84 const std::string& nodeName)
98 bp.graphName = graphName;
99 bp.nodeName = nodeName;
118 it->second.enabled = enabled;
125 std::vector<BreakpointInfo> result;
128 if (
kv.second.graphID == graphID)
129 result.push_back(
kv.second);
137 std::vector<BreakpointInfo> result;
140 result.push_back(
kv.second);
317 std::this_thread::sleep_for(std::chrono::milliseconds(10));
323 const std::string& graphName,
324 const std::string& nodeName)
Runtime debug controller for ATS Visual Scripting (Phase 5).
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.
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.
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.
A single frame in the debugger's SubGraph call stack.
bool isCurrent
true for the top-most (active) frame