예제 #1
0
            public void MapPPStepSequencesOnActivites(Dictionary <string, ProcessPlan> processPlans)
            {
                if (processPlans.ContainsKey(ProductType))
                {
                    ProcessPlan = processPlans[ProductType];

                    foreach (LotActivityRaw activity in LotActivitiesRaw)
                    {
                        List <SingleStep> steps = ProcessPlan.Steps.Where(x => activity.Stepname == x.Stepname && activity.Techstage == x.Techstage && activity.Subplan == x.Subplan).ToList();

                        // One step of process plans matches the activity
                        if (steps.Count() == 1)
                        {
                            SingleStep step = steps.First();
                            activity.PPStepSequence = step.StepSequence;
                        }
                        // No step of process plan matches the acitivy, so PPStepSequence is set to -1
                        else if (!steps.Any())
                        {
                            activity.PPStepSequence = -1;
                        }
                        // Multiple steps of process plan match the activity, so exception is thrown
                        else if (steps.Count() > 1)
                        {
                            throw new Exception($"Multiple steps found in process plan {steps.First().Productname} with same Stepname {activity.Stepname}, " +
                                                $"Techstage {activity.Techstage} and Subplan {activity.Subplan} as activity {activity.LotId}");
                        }
                    }
                }
            }
예제 #2
0
            public void CheckCompleteness()
            {
                HasStart       = true;
                HasEnd         = true;
                HasProcessPlan = true;


                // Check whether trace has process plan
                if (ProcessPlan == null)
                {
                    HasProcessPlan = false;
                    return;
                }


                // Check whether trace contains first step
                SingleStep firstStep = ProcessPlan.Steps.First();

                if (!LotActivitiesRaw.Where(x => x.Stepname == firstStep.Stepname).Any())
                {
                    HasStart = false;
                }

                // Check whether trace contains last step
                SingleStep lastStep = ProcessPlan.Steps.Last();

                if (!LotActivitiesRaw.Where(x => x.Stepname == lastStep.Stepname).Any())
                {
                    HasEnd = false;
                }

                // Passed all checks, so trace is complete
                return;
            }
예제 #3
0
        private void HandleCompositeCommand(JdwpPacket packet)
        {
            var data = packet.Data;
            var suspendPolicy = (Jdwp.SuspendPolicy) data.GetByte();
            var count = data.GetInt();

            for (var i = 0; i < count; i++)
            {
                var eventKind = (Jdwp.EventKind) data.GetByte();
                JdwpEvent evt;
                switch (eventKind)
                {
                    case Jdwp.EventKind.VmInit:
                        evt = new VmStart(data);
                        break;
                    case Jdwp.EventKind.SingleStep:
                        evt = new SingleStep(data);
                        break;
                    case Jdwp.EventKind.BreakPoint:
                        evt = new Breakpoint(data);
                        break;
                    case Jdwp.EventKind.MethodEntry:
                        evt = new MethodEntry(data);
                        break;
                    case Jdwp.EventKind.MethodExit:
                        evt = new MethodExit(data);
                        break;
                    case Jdwp.EventKind.Exception:
                        evt = new Exception(data);
                        break;
                    case Jdwp.EventKind.ThreadStart:
                        evt = new ThreadStart(data);
                        break;
                    case Jdwp.EventKind.ThreadEnd:
                        evt = new ThreadDeath(data);
                        break;
                    case Jdwp.EventKind.ClassPrepare:
                        evt = new ClassPrepare(data);
                        break;
                    case Jdwp.EventKind.ClassUnload:
                        evt = new ClassUnload(data);
                        break;
                    case Jdwp.EventKind.FieldAccess:
                        evt = new FieldAccess(data);
                        break;
                    case Jdwp.EventKind.FieldModification:
                        evt = new FieldModification(data);
                        break;
                    case Jdwp.EventKind.VmDeath:
                        evt = new VmDeath(data);
                        break;
                    default:
                        throw new ArgumentException("Unknown event kind in compositive command " + (int)eventKind);
                }
                DLog.Debug(DContext.DebuggerLibDebugger, "JDWP event {0} {1}", eventKind, evt);
                Task.Factory.StartNew(() => {
                    evt.Accept(compositeCommandProcessor, suspendPolicy);
                });
            }
        }
예제 #4
0
 // Constructor
 public FixedTimeStepSystem(float fixedTimeStep, int maxSteps, SingleStep singleStep, PostStepping postStepping)
 {
     fixedTimestepAccumulator      = 0;
     fixedTimestepAccumulatorRatio = 0;
     this.fixedTimeStep            = fixedTimeStep;
     this.maxSteps     = maxSteps;
     this.singleStep   = singleStep;
     this.postStepping = postStepping;
 }
예제 #5
0
 // Constructor
 public FixedTimeStepSystem(float fixedTimeStep, int maxSteps, SingleStep singleStep, PostStepping postStepping)
 {
     fixedTimestepAccumulator = 0;
     fixedTimestepAccumulatorRatio = 0;
     this.fixedTimeStep = fixedTimeStep;
     this.maxSteps = maxSteps;
     this.singleStep = singleStep;
     this.postStepping = postStepping;
 }
예제 #6
0
            /// <summary>
            /// Handle single step events
            /// </summary>
            public override bool Visit(SingleStep e, Jdwp.SuspendPolicy suspendPolicy)
            {
                var step   = debugger.process.StepManager.GetAndRemove(e.RequestId);
                var thread = (step != null) ? step.Thread : null;
                var reason = (thread != null) ? SuspendReason.SingleStep : SuspendReason.ProcessSuspend;

                if (step != null)
                {
                    // Reset event
                    debugger.EventRequest.ClearAsync(Jdwp.EventKind.SingleStep, step.RequestId);
                }
                HandleSuspendPolicy(suspendPolicy, reason, thread);
                return(true);
            }
예제 #7
0
 public virtual TResult Visit(SingleStep e, TData data)
 {
     return(Visit((JdwpEvent)e, data));
 }
        private void HandleCompositeCommand(JdwpPacket packet)
        {
            var data          = packet.Data;
            var suspendPolicy = (Jdwp.SuspendPolicy)data.GetByte();
            var count         = data.GetInt();

            for (var i = 0; i < count; i++)
            {
                var       eventKind = (Jdwp.EventKind)data.GetByte();
                JdwpEvent evt;
                switch (eventKind)
                {
                case Jdwp.EventKind.VmInit:
                    evt = new VmStart(data);
                    break;

                case Jdwp.EventKind.SingleStep:
                    evt = new SingleStep(data);
                    break;

                case Jdwp.EventKind.BreakPoint:
                    evt = new Breakpoint(data);
                    break;

                case Jdwp.EventKind.MethodEntry:
                    evt = new MethodEntry(data);
                    break;

                case Jdwp.EventKind.MethodExit:
                    evt = new MethodExit(data);
                    break;

                case Jdwp.EventKind.Exception:
                    evt = new Exception(data);
                    break;

                case Jdwp.EventKind.ThreadStart:
                    evt = new ThreadStart(data);
                    break;

                case Jdwp.EventKind.ThreadEnd:
                    evt = new ThreadDeath(data);
                    break;

                case Jdwp.EventKind.ClassPrepare:
                    evt = new ClassPrepare(data);
                    break;

                case Jdwp.EventKind.ClassUnload:
                    evt = new ClassUnload(data);
                    break;

                case Jdwp.EventKind.FieldAccess:
                    evt = new FieldAccess(data);
                    break;

                case Jdwp.EventKind.FieldModification:
                    evt = new FieldModification(data);
                    break;

                case Jdwp.EventKind.VmDeath:
                    evt = new VmDeath(data);
                    break;

                default:
                    throw new ArgumentException("Unknown event kind in compositive command " + (int)eventKind);
                }
                DLog.Debug(DContext.DebuggerLibDebugger, "JDWP event {0} {1}", eventKind, evt);
                Task.Factory.StartNew(() => {
                    evt.Accept(compositeCommandProcessor, suspendPolicy);
                });
            }
        }
        private void HandleCompositeCommand(JdwpPacket packet)
        {
            var data          = packet.Data;
            var suspendPolicy = (Jdwp.SuspendPolicy)data.GetByte();
            var count         = data.GetInt();

            for (var i = 0; i < count; i++)
            {
                var       eventKind = (Jdwp.EventKind)data.GetByte();
                JdwpEvent evt;
                switch (eventKind)
                {
                case Jdwp.EventKind.VmInit:
                    evt = new VmStart(data);
                    break;

                case Jdwp.EventKind.SingleStep:
                    evt = new SingleStep(data);
                    break;

                case Jdwp.EventKind.BreakPoint:
                    evt = new Breakpoint(data);
                    break;

                case Jdwp.EventKind.MethodEntry:
                    evt = new MethodEntry(data);
                    break;

                case Jdwp.EventKind.MethodExit:
                    evt = new MethodExit(data);
                    break;

                case Jdwp.EventKind.Exception:
                    evt = new Exception(data);
                    break;

                case Jdwp.EventKind.ThreadStart:
                    evt = new ThreadStart(data);
                    break;

                case Jdwp.EventKind.ThreadEnd:
                    evt = new ThreadDeath(data);
                    break;

                case Jdwp.EventKind.ClassPrepare:
                    evt = new ClassPrepare(data);
                    break;

                case Jdwp.EventKind.ClassUnload:
                    evt = new ClassUnload(data);
                    break;

                case Jdwp.EventKind.FieldAccess:
                    evt = new FieldAccess(data);
                    break;

                case Jdwp.EventKind.FieldModification:
                    evt = new FieldModification(data);
                    break;

                case Jdwp.EventKind.VmDeath:
                    evt = new VmDeath(data);
                    break;

                default:
                    throw new ArgumentException("Unknown event kind in compositive command " + (int)eventKind);
                }
                DLog.Debug(DContext.DebuggerLibDebugger, "JDWP event {0} {1}", eventKind, evt);
                Task.Factory.StartNew(() => {
                    evt.Accept(compositeCommandProcessor, suspendPolicy);
                }).ContinueWith(task =>
                {
                    DLog.Error(DContext.DebuggerLibJdwpConnection, "HandleCompositeCommand: Internal failure on event processing. SuspendPolicy was {1}; IsCancelled={0}. Exception={1}", suspendPolicy, task.IsCanceled, task.Exception);
                    if (suspendPolicy != Jdwp.SuspendPolicy.None)
                    {
                        // we should better resume the VM, as the command handler may have failed to do so.
                        if (Connected)
                        {
                            VirtualMachine.ResumeAsync();
                        }
                    }
                }, TaskContinuationOptions.NotOnRanToCompletion);
            }
        }
예제 #10
0
파일: Debugger.cs 프로젝트: jdruin/F5Eagle
        ///////////////////////////////////////////////////////////////////////

        #region IDebugger Members
        public void AddInfo(
            StringPairList list,
            DetailFlags detailFlags
            )
        {
            CheckDisposed();

            bool empty = HostOps.HasEmptyContent(detailFlags);

            if (empty || (suspendCount > 0))
            {
                list.Add("SuspendCount", suspendCount.ToString());
            }

            if (empty || Enabled)
            {
                list.Add("Enabled", Enabled.ToString());
            }

            if (empty || (Loops > 0))
            {
                list.Add("Loops", Loops.ToString());
            }

            if (empty || (Active > 0))
            {
                list.Add("Active", Active.ToString());
            }

            if (empty || SingleStep)
            {
                list.Add("SingleStep", SingleStep.ToString());
            }

#if BREAKPOINTS
            if (empty || BreakOnToken)
            {
                list.Add("BreakOnToken", BreakOnToken.ToString());
            }
#endif

            if (empty || BreakOnExecute)
            {
                list.Add("BreakOnExecute", BreakOnExecute.ToString());
            }

            if (empty || BreakOnCancel)
            {
                list.Add("BreakOnCancel", BreakOnCancel.ToString());
            }

            if (empty || BreakOnError)
            {
                list.Add("BreakOnError", BreakOnError.ToString());
            }

            if (empty || BreakOnReturn)
            {
                list.Add("BreakOnReturn", BreakOnReturn.ToString());
            }

            if (empty || BreakOnTest)
            {
                list.Add("BreakOnTest", BreakOnTest.ToString());
            }

            if (empty || BreakOnExit)
            {
                list.Add("BreakOnExit", BreakOnExit.ToString());
            }

            if (empty || (Steps > 0))
            {
                list.Add("Steps", Steps.ToString());
            }

            if (empty || (Types != BreakpointType.None))
            {
                list.Add("Types", Types.ToString());
            }

#if BREAKPOINTS
            BreakpointDictionary breakpoints = Breakpoints;

            if (empty || ((breakpoints != null) && (breakpoints.Count > 0)))
            {
                list.Add("Breakpoints", (breakpoints != null) ?
                         breakpoints.Count.ToString() : FormatOps.DisplayNull);
            }
#endif

#if DEBUGGER_ARGUMENTS
            ArgumentList executeArguments = ExecuteArguments;

            if (empty || (executeArguments != null))
            {
                list.Add("ExecuteArguments", (executeArguments != null) ?
                         executeArguments.ToString(ToStringFlags.NameAndValue,
                                                   null, false) : FormatOps.DisplayNull);
            }
#endif

            if (empty || !String.IsNullOrEmpty(Command))
            {
                list.Add("Command", FormatOps.DisplayString(
                             FormatOps.ReplaceNewLines(FormatOps.NormalizeNewLines(
                                                           Command))));
            }

            if (empty || !String.IsNullOrEmpty(Result))
            {
                list.Add("Result", FormatOps.DisplayString(
                             FormatOps.ReplaceNewLines(FormatOps.NormalizeNewLines(
                                                           Result))));
            }

            QueueList <string, string> queue = Queue;

            if (empty || ((queue != null) && (queue.Count > 0)))
            {
                list.Add("Queue", (queue != null) ?
                         queue.Count.ToString() : FormatOps.DisplayNull);
            }

            StringList callbackArguments = CallbackArguments;

            if (empty || ((callbackArguments != null) &&
                          (callbackArguments.Count > 0)))
            {
                list.Add("CallbackArguments", (callbackArguments != null) ?
                         callbackArguments.ToString() : FormatOps.DisplayNull);
            }

            if (interpreter != null)
            {
                interpreter.GetHostDebuggerInfo(ref list, detailFlags);
            }
            else if (empty)
            {
                list.Add((IPair <string>)null);
                list.Add("Interpreter");
                list.Add((IPair <string>)null);
                list.Add("Id", FormatOps.DisplayNull);
            }
        }
예제 #11
0
        private void HandleCompositeCommand(JdwpPacket packet)
        {
            var data = packet.Data;
            var suspendPolicy = (Jdwp.SuspendPolicy) data.GetByte();
            var count = data.GetInt();

            for (var i = 0; i < count; i++)
            {
                var eventKind = (Jdwp.EventKind) data.GetByte();
                JdwpEvent evt;
                switch (eventKind)
                {
                    case Jdwp.EventKind.VmInit:
                        evt = new VmStart(data);
                        break;
                    case Jdwp.EventKind.SingleStep:
                        evt = new SingleStep(data);
                        break;
                    case Jdwp.EventKind.BreakPoint:
                        evt = new Breakpoint(data);
                        break;
                    case Jdwp.EventKind.MethodEntry:
                        evt = new MethodEntry(data);
                        break;
                    case Jdwp.EventKind.MethodExit:
                        evt = new MethodExit(data);
                        break;
                    case Jdwp.EventKind.Exception:
                        evt = new Exception(data);
                        break;
                    case Jdwp.EventKind.ThreadStart:
                        evt = new ThreadStart(data);
                        break;
                    case Jdwp.EventKind.ThreadEnd:
                        evt = new ThreadDeath(data);
                        break;
                    case Jdwp.EventKind.ClassPrepare:
                        evt = new ClassPrepare(data);
                        break;
                    case Jdwp.EventKind.ClassUnload:
                        evt = new ClassUnload(data);
                        break;
                    case Jdwp.EventKind.FieldAccess:
                        evt = new FieldAccess(data);
                        break;
                    case Jdwp.EventKind.FieldModification:
                        evt = new FieldModification(data);
                        break;
                    case Jdwp.EventKind.VmDeath:
                        evt = new VmDeath(data);
                        break;
                    default:
                        throw new ArgumentException("Unknown event kind in compositive command " + (int)eventKind);
                }
                DLog.Debug(DContext.DebuggerLibDebugger, "JDWP event {0} {1}", eventKind, evt);
                Task.Factory.StartNew(() => {
                    evt.Accept(compositeCommandProcessor, suspendPolicy);
                }).ContinueWith(task =>
                {
                    DLog.Error(DContext.DebuggerLibJdwpConnection, "HandleCompositeCommand: Internal failure on event processing. SuspendPolicy was {1}; IsCancelled={0}. Exception={1}", suspendPolicy, task.IsCanceled, task.Exception);
                    if (suspendPolicy != Jdwp.SuspendPolicy.None)
                    {
                        // we should better resume the VM, as the command handler may have failed to do so.
                        if(Connected)
                            VirtualMachine.ResumeAsync();
                    }
                }, TaskContinuationOptions.NotOnRanToCompletion);
            }
        }