public bool ShouldStopAtThisLine(string module, ExecutionFrame currentFrame) { bool mustStop = false; switch (_currentState) { case DebugState.Running: mustStop = HitBreakpointOnLine(module, currentFrame); break; case DebugState.SteppingIn: mustStop = true; break; case DebugState.SteppingOut: case DebugState.SteppingOver: mustStop = FrameIsInStopList(currentFrame); // по пути следования все равно может встретиться breakpoint if (!mustStop && HitBreakpointOnLine(module, currentFrame)) { _currentState = DebugState.Running; //для правильной причины останова (см. ниже) mustStop = true; } break; } if (mustStop) { // здесь мы уже останавливались if (_lastStopPoint.frame != currentFrame || _lastStopPoint.line != currentFrame.LineNumber) { if (_currentState == DebugState.Running) { LastStopReason = MachineStopReason.Breakpoint; } else { LastStopReason = MachineStopReason.Step; } _lastStopPoint = new StopPoint() { frame = currentFrame, line = currentFrame.LineNumber }; _currentState = DebugState.Running; } else { mustStop = false; } } return(mustStop); }
internal void StepOut(ExecutionFrame currentFrame) { _currentState = DebugState.SteppingOut; _stopFrames = _machine.GetExecutionFrames().Select(x => x.FrameObject).Skip(1).ToArray(); }
private bool FrameIsInStopList(ExecutionFrame currentFrame) { return(_stopFrames != null && _stopFrames.Contains(currentFrame)); }
public void StepOver(ExecutionFrame currentFrame) { _currentState = DebugState.SteppingOver; _stopFrames = _machine.GetExecutionFrames().Select(x => x.FrameObject).ToArray(); }
private bool HitBreakpointOnLine(string module, ExecutionFrame currentFrame) { return(_breakpoints.Find(module, currentFrame.LineNumber)); }