private void PauseExecution() { ExecutionState = PrgmExecutionState.Paused; m_PauseCtrl.PauseChildTaskExecution(); m_InstructionStepCmd.CanExecute = true; m_ResumeExecutionCmd.CanExecute = true; m_PauseExecutionCmd.CanExecute = false; }
private void ResumeExecution() { ExecutionState = PrgmExecutionState.Running; m_PauseCtrl.ResumeChildExecution(); m_InstructionStepCmd.CanExecute = false; m_ResumeExecutionCmd.CanExecute = false; m_PauseExecutionCmd.CanExecute = true; }
private void ExecuteUntilEnd() { var runTimer = new Stopwatch(); ExecutionState = PrgmExecutionState.Running; ResetProgramContext(); runTimer.Start(); try { while (IsRunning && !m_Ctx.EndOfFile) { // double check this here, to see if the user paused it // or there is a breakpoint at our current instruction. if the user // pauses this, a breakpoint will not be applied at the instruction so // we need to see the flag value (as the flag will be set). if (IsPaused || IsBreakpointAppliedAtInstruction(m_Ctx.UserRegisters[InterpreterCommon.PC_REGISTER].Value)) { // we set the pause flag here. if the user steps to the next instruction, we want to // once again reset the condition variable so we pause again. this is because the step needs // to happen in this task PauseExecution(); } m_PauseCtrl.WaitIfPauseCommanded(); ExecuteNextInstruction(); } runTimer.Stop(); m_Terminal.PrintString("\n\nINFO: Execution completed in " + runTimer.Elapsed); } catch (AbortSignal) { } m_Terminal.RequestOutputFlush(); m_ExecutionState = PrgmExecutionState.Stopped; m_InstructionStepCmd.CanExecute = false; m_TerminateExecutionCmd.CanExecute = false; m_ResumeExecutionCmd.CanExecute = false; m_PauseExecutionCmd.CanExecute = false; m_ExecuteFileCmd.CanExecute = true; }
private void CancelExecution() { ExecutionState = PrgmExecutionState.Stopped; m_PauseCtrl.AbortChildProcess(); m_Ctx.AbortUserInputOperation(); }