示例#1
0
 void RaiseStepped(WamMachineStepEventArgs e)
 {
     if (Stepped != null)
     {
         Stepped(this, e);
     }
 }
示例#2
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);
        }
示例#3
0
 private void RaiseStepped(WamMachineStepEventArgs e)
 {
     if (Stepped != null)
     {
         Stepped(this, e);
     }
 }
示例#4
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;
        }
示例#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;
        }