/// <summary> /// Steps into the function if possible. /// </summary> public void StepInto() { if (m_State == LuaDebuggerState.Stoped) { m_Action = DebuggerActions.StepInto; m_State = LuaDebuggerState.Running; } }
/// <summary> /// Continues execution until the next breakpoint. /// </summary> public void Run() { if (m_State == LuaDebuggerState.Stoped) { m_Action = DebuggerActions.Run; m_State = LuaDebuggerState.Running; } }
/// <summary> /// Steps out of the current function. /// </summary> public void StepOut() { if (m_State == LuaDebuggerState.Stoped) { m_Action = DebuggerActions.StepOut; m_StepStackLevel = m_StackLevel - 1; m_State = LuaDebuggerState.Running; } }
/// <summary> /// Stops execution. /// </summary> /// <param name="luaDebug">LuaDebug from debug hook.</param> /// <param name="action">Current Debugger Action.</param> /// <param name="breakpoint">Brekpoint. Can be null.</param> /// <remarks> /// The WaitingForAction event is called as long as State == Stoped. /// </remarks> private void StopExecution(LuaDebug luaDebug, DebuggerActions action, LuaDebugBreakpoint breakpoint) { m_State = LuaDebuggerState.Stoped; try { OnStopping(new StopingEventArgs( luaDebug, luaDebug.shortsrc, luaDebug.eventCode == EventCodes.LUA_HOOKCALL ? luaDebug.linedefined : luaDebug.currentline, action, breakpoint)); do { OnWaitingForAction(new EventArgs()); } while (m_State == LuaDebuggerState.Stoped); } finally { m_State = LuaDebuggerState.Running; } }
/// <summary> /// Executes the next line of code. /// </summary> public void StepOver() { if (m_State == LuaDebuggerState.Stoped) { m_Action = DebuggerActions.StepOver; m_StepStackLevel = m_StackLevel; m_State = LuaDebuggerState.Running; } }