public void LeaveState(System.Activities.Debugger.State state) { if ((this.callStack.Count > 0) && (this.callStack.Pop() != null)) { this.controller.LeaveState(); } }
internal void InvokeWorker(object islandArguments, VirtualStackFrame stackFrame) { System.Activities.Debugger.State state = stackFrame.State; MethodInfo island = this.GetIsland(state); IDictionary <string, object> locals = stackFrame.Locals; int numberOfEarlyLocals = state.NumberOfEarlyLocals; object[] parameters = new object[2 + numberOfEarlyLocals]; parameters[0] = this.IsPriming; parameters[1] = islandArguments; if (numberOfEarlyLocals > 0) { int index = 2; foreach (LocalsItemDescription description in state.EarlyLocals) { object obj2; string name = description.Name; if (!locals.TryGetValue(name, out obj2)) { obj2 = Activator.CreateInstance(description.Type); } parameters[index] = obj2; index++; } } island.Invoke(null, parameters); }
private void Instrument(Activity activity, SourceLocation sourceLocation, string name) { if (this.states.ContainsKey(activity)) { Debugger.Log(1, "Workflow", System.Activities.SR.DuplicateInstrumentation(activity.DisplayName)); } else { System.Activities.Debugger.State state = this.stateManager.DefineStateWithDebugInfo(sourceLocation, name); this.states.Add(activity, state); } }
private MethodInfo GetIsland(System.Activities.Debugger.State state) { MethodInfo methodInfo = null; if (this.IsPriming) { if (!this.islandsWithPriming.TryGetValue(state, out methodInfo)) { methodInfo = state.GetMethodInfo(true); this.islandsWithPriming[state] = methodInfo; } return(methodInfo); } if (!this.islands.TryGetValue(state, out methodInfo)) { methodInfo = state.GetMethodInfo(false); this.islands[state] = methodInfo; } return(methodInfo); }
private MethodBuilder CreateIsland(TypeBuilder typeBuilder, System.Activities.Debugger.State state, bool withPrimingTest) { MethodBuilder builder = this.CreateMethodBuilder(typeBuilder, threadWorkerControllerType, state, withPrimingTest); ILGenerator iLGenerator = builder.GetILGenerator(); SourceLocation location = state.Location; ISymbolDocumentWriter sourceDocument = this.GetSourceDocument(location.FileName); Label label = iLGenerator.DefineLabel(); if (withPrimingTest) { iLGenerator.MarkSequencePoint(sourceDocument, 0xfeefee, 1, 0xfeefee, 100); iLGenerator.Emit(OpCodes.Ldarg_0); iLGenerator.Emit(OpCodes.Brtrue, label); } iLGenerator.MarkSequencePoint(sourceDocument, location.StartLine, location.StartColumn, location.EndLine, location.EndColumn); iLGenerator.Emit(OpCodes.Nop); iLGenerator.MarkLabel(label); iLGenerator.Emit(OpCodes.Ldarg_1); iLGenerator.EmitCall(OpCodes.Call, islandWorkerMethodInfo, null); iLGenerator.Emit(OpCodes.Ret); return(builder); }
public VirtualStackFrame(System.Activities.Debugger.State state, IDictionary<string, object> locals) { this.state = state; this.locals = locals; }
internal void LeaveState(int threadIndex, System.Activities.Debugger.State state) { this.threads[threadIndex].LeaveState(state); }
internal void EnterState(int threadIndex, System.Activities.Debugger.State state, IDictionary <string, object> locals) { this.EnterState(threadIndex, new VirtualStackFrame(state, locals)); }
internal System.Activities.Debugger.State DefineState(SourceLocation location, string name, LocalsItemDescription[] earlyLocals, int numberOfEarlyLocals) { System.Activities.Debugger.State item = new System.Activities.Debugger.State(location, name, earlyLocals, numberOfEarlyLocals); this.states.Add(item); return(item); }
internal MethodBuilder CreateMethodBuilder(TypeBuilder typeBuilder, Type typeIslandArguments, System.Activities.Debugger.State state, bool withPriming) { string name = (state.Name != null) ? state.Name : ("Line_" + state.Location.StartLine); if (withPriming) { name = "_" + name; } IEnumerable <LocalsItemDescription> earlyLocals = state.EarlyLocals; int numberOfEarlyLocals = state.NumberOfEarlyLocals; Type[] parameterTypes = new Type[2 + numberOfEarlyLocals]; parameterTypes[0] = typeof(bool); parameterTypes[1] = typeIslandArguments; if (numberOfEarlyLocals > 0) { int index = 2; foreach (LocalsItemDescription description in earlyLocals) { parameterTypes[index] = description.Type; index++; } } Type returnType = typeof(void); MethodBuilder builder = typeBuilder.DefineMethod(name, MethodAttributes.Static | MethodAttributes.Public, returnType, parameterTypes); builder.DefineParameter(1, ParameterAttributes.None, "isPriming"); builder.DefineParameter(2, ParameterAttributes.None, "typeIslandArguments"); if (numberOfEarlyLocals > 0) { int position = 3; foreach (LocalsItemDescription description2 in earlyLocals) { builder.DefineParameter(position, ParameterAttributes.None, description2.Name); position++; } } return(builder); }
public VirtualStackFrame(System.Activities.Debugger.State state, IDictionary <string, object> locals) { this.state = state; this.locals = locals; }
public VirtualStackFrame(System.Activities.Debugger.State state) : this(state, null) { }
internal System.Activities.Debugger.State DefineState(SourceLocation location, string name, LocalsItemDescription[] earlyLocals, int numberOfEarlyLocals) { System.Activities.Debugger.State item = new System.Activities.Debugger.State(location, name, earlyLocals, numberOfEarlyLocals); this.states.Add(item); return item; }