Esempio n. 1
0
        public ExecutionResults StepOver()
        {
            if (State == WamMachineStates.Halt)
            {
                return(ExecutionResults.Failure);
            }

            PerformanceStatistics.Start();

            var stepEventArgsState = new WamMachineStepEventArgsState();
            var stepEventArgs      = new WamMachineStepEventArgs(stepEventArgsState);

            var results = ExecutionResults.None;

            var initialStackIndex = StackIndex;
            var loop = true;

            while (loop)
            {
                results = Step();

                if (results == ExecutionResults.Failure || results == ExecutionResults.Success)
                {
                    loop = false;
                }
                else if (StackIndex <= initialStackIndex)
                {
                    loop = false;
                }
                else
                {
                    stepEventArgsState.InstructionPointer = InstructionPointer;
                    RaiseStepped(stepEventArgs);
                    if (stepEventArgs.Breakpoint)
                    {
                        loop = false;
                    }
                }
            }
            PerformanceStatistics.Stop();
            return(results);
        }
 public WamMachineStepEventArgs(WamMachineStepEventArgsState state)
 {
     _state = state;
 }
Esempio n. 3
0
        public ExecutionResults StepOver()
        {
            if (State == WamMachineStates.Halt)
            {
                return ExecutionResults.Failure;
            }

            PerformanceStatistics.Start();

            WamMachineStepEventArgsState stepEventArgsState = new WamMachineStepEventArgsState();
            WamMachineStepEventArgs stepEventArgs = new WamMachineStepEventArgs(stepEventArgsState);

            ExecutionResults results = ExecutionResults.None;

            int initialStackIndex = StackIndex;
            bool loop = true;
            while (loop)
            {
                results = Step();

                if (results == ExecutionResults.Failure
                    || results == ExecutionResults.Success)
                {
                    loop = false;
                }
                else if (StackIndex <= initialStackIndex)
                {
                    loop = false;
                }
                else
                {
                    stepEventArgsState.InstructionPointer = InstructionPointer;
                    RaiseStepped(stepEventArgs);
                    if (stepEventArgs.Breakpoint)
                    {
                        loop = false;
                    }
                }
            }

            PerformanceStatistics.Stop();

            return results;
        }
Esempio n. 4
0
 public WamMachineStepEventArgs(WamMachineStepEventArgsState state)
 {
     _state = state;
 }
Esempio n. 5
0
        public ExecutionResults RunToSuccess()
        {
            if (State == WamMachineStates.Halt)
            {
                return ExecutionResults.Failure;
            }

            PerformanceStatistics.Start();

            var stepEventArgsState = new WamMachineStepEventArgsState();
            var stepEventArgs = new WamMachineStepEventArgs(stepEventArgsState);

            var results = ExecutionResults.None;

            var loop = true;
            while (loop)
            {
                results = Step();

                if (results == ExecutionResults.Failure || results == ExecutionResults.Success)
                {
                    loop = false;
                }
                else
                {
                    stepEventArgsState.InstructionPointer = InstructionPointer;
                    RaiseStepped(stepEventArgs);
                    if (stepEventArgs.Breakpoint)
                    {
                        loop = false;
                    }
                }
            }
            PerformanceStatistics.Stop();
            return results;
        }