public RequestContext(HttpActionContext actionContext, IDebugContext debugContext) { UserName = null; Password = null; DebugContext = debugContext; TryGetUserFromCurrentContext(); }
private void GenerateExceptionReport(IDebugContext context) { string tFn = _fileName; if (_maxCrashes > 0 && _crashesRecorded.Count > _maxCrashes) { return; } else if (_crashesRecorded.Count > 0) { string path = Path.GetDirectoryName(_fileName); string name = Path.GetFileNameWithoutExtension(_fileName); string ext = Path.GetExtension(_fileName); tFn = Path.Combine(path, name + _crashesRecorded + ext); if (File.Exists(tFn)) { File.Delete(tFn); } } context.SaveDumpFile(tFn, DumpType.Small, _dumpFlags, "Auto-generated from crash monitor."); _crashesRecorded.Add(tFn); }
void IDebugContextService.Push(IDebugContext context) { if (Context.Count > 0) { context.SetParentContext(Context[Context.Count - 1]); } Context.Add(context); }
public Profiler(IDebugContext debugContext, LogLevel logLevel, string name = null) { _debugContext = debugContext; _logLevel = logLevel; _name = name; _watch = Stopwatch.StartNew(); _debugContext.Log(logLevel, "Start: {0}", _name ?? String.Empty); }
public Profiler(IDebugContext debugContext, LogLevel logLevel, string name = null) { _debugContext = debugContext; _logLevel = logLevel; _name = name; _watch = Stopwatch.StartNew(); _debugContext.Log(logLevel, "Start: {0}", _name ?? String.Empty); }
public void HandleEventTest( [PexAssumeUnderTest] SimpleTriggerListener target, DebugTrigger triggerType, DebuggerEventArgs eventArgs, IDebugContext context ) { target.HandleEvent(triggerType, eventArgs, context); // TODO: add assertions to method SimpleTriggerListenerTest.HandleEventTest(SimpleTriggerListener, DebugTrigger, DebuggerEventArgs, IDebugContext) }
public void HandleEventTest( [PexAssumeUnderTest] FileCrashMonitor target, DebugTrigger triggerType, DebuggerEventArgs eventArgs, IDebugContext context ) { target.HandleEvent(triggerType, eventArgs, context); // TODO: add assertions to method FileCrashMonitorTest.HandleEventTest(FileCrashMonitor, DebugTrigger, DebuggerEventArgs, IDebugContext) }
public PetControllerTests() { Kernel = new StandardKernel(); Kernel.Bind<IConfiguration>().To<Configuration>(); Kernel.Bind<IDebugContext>().To<DebugContext>(); Kernel.Bind<IPetPolicyProvider>().To<PetPolicyProvider>(); _policyProvider = Kernel.Get<PetPolicyProvider>(); _debugContext = Kernel.Get<IDebugContext>(); _policyProvider.DebugContext = _debugContext; }
public PetControllerTests() { Kernel = new StandardKernel(); Kernel.Bind <IConfiguration>().To <Configuration>(); Kernel.Bind <IDebugContext>().To <DebugContext>(); Kernel.Bind <IPetPolicyProvider>().To <PetPolicyProvider>(); _policyProvider = Kernel.Get <PetPolicyProvider>(); _debugContext = Kernel.Get <IDebugContext>(); _policyProvider.DebugContext = _debugContext; }
internal static TypeNodeList GetTypeList(string typeList, IDebugContext context){ TypeNodeList list = new TypeNodeList(); int startIndex = typeList.LastIndexOf(".")+1; int endIndex; IDebugType typ; while((endIndex = typeList.IndexOf("Or", startIndex)) > 0){ typ = context.GetType(typeList.Substring(startIndex, endIndex - startIndex)); if (typ != null) list.Add(typ.CompilerType); startIndex = endIndex+2; } typ = context.GetType(typeList.Substring(startIndex)); if (typ != null) list.Add(typ.CompilerType); return list; }
internal static IDebugType DebugTypeFromField(IDebugField field, IDebugContext context) { IDebugType type = null; FIELD_KIND kind; field.GetKind(out kind); if (0 != (FIELD_KIND.FIELD_KIND_TYPE & kind)) { if (0 != (kind & FIELD_KIND.FIELD_TYPE_PRIMITIVE)){ type = new CDebugPrimitiveType(field, context); } else if (0 != (kind & (FIELD_KIND.FIELD_TYPE_CLASS|FIELD_KIND.FIELD_TYPE_STRUCT|FIELD_KIND.FIELD_TYPE_INNERCLASS))) { IDebugClassField classField = null; if (null != (classField = field as IDebugClassField)) { if (classField.DoesInterfaceExist("StructuralTypes.TupleType") == (int)HResult.S_OK) type = new CDebugStructuralType(classField, context, StructTypes.Tuple); else if(classField.DoesInterfaceExist("StructuralTypes.TypeUnion") == (int)HResult.S_OK) type = new CDebugStructuralType(classField, context, StructTypes.Union); else if(classField.DoesInterfaceExist("StructuralTypes.TypeIntersection") == (int)HResult.S_OK) type = new CDebugStructuralType(classField, context, StructTypes.Intersection); else{ FIELD_INFO name = new FIELD_INFO(); classField.GetInfo(FIELD_INFO_FIELDS.FIF_NAME, out name); if (name.bstrName.IndexOf("IEnumerableOf") >=0) type = new CDebugStreamType(classField, context, StreamType.GenericIEnumerable); else if (name.bstrName.IndexOf("NonEmptyIEnumerableOf") >=0) type = new CDebugStreamType(classField, context, StreamType.GenericNonEmptyIEnumerable); else if (name.bstrName.IndexOf("NonNullOf") >=0) type = new CDebugStreamType(classField, context, StreamType.GenericNonNull); else if (name.bstrName.IndexOf("BoxedOf") >=0) type = new CDebugStreamType(classField, context, StreamType.GenericBoxed); else if (name.bstrName.IndexOf("IListOf") >=0) type = new CDebugFlexArrayType(classField, context); else type = new CDebugClassType(classField, context); } } } else if (0 != (kind & FIELD_KIND.FIELD_TYPE_ENUM)) { IDebugEnumField enumField = null; if (null != (enumField = field as IDebugEnumField)) { type = new CDebugEnumType(enumField, context); } } else if (0 != (kind & FIELD_KIND.FIELD_TYPE_ARRAY)) { IDebugArrayField arrayField = null; if (null != (arrayField = field as IDebugArrayField)) { type = new CDebugArrayType(arrayField, context); } } } return type; }
public BreedController(IBreedProvider breedProvider, IDebugContext debugContext) { _breedProvider = breedProvider; _breedProvider.DebugContext = debugContext; }
public CountriesController(ICountryProvider countryProvider, IDebugContext debugContext) { _countryProvider = countryProvider; _countryProvider.DebugContext = debugContext; }
public DebugEnvironment() { this.context = null; }
public CountriesController(ICountryProvider countryProvider, IDebugContext debugContext) { _countryProvider = countryProvider; _countryProvider.DebugContext = debugContext; }
public CDebugValue(IDebugObject pObject, IDebugContext pContext) { this.m_Object = pObject; this.m_Context = pContext; this.m_RuntimeType = null; }
public PetPoliciesController(IPetPolicyProvider policyProvider, IDebugContext debugContext) { _policyProvider = policyProvider; _policyProvider.DebugContext = debugContext; }
public Profiler(IDebugContext debugContext, string name = null) : this(debugContext, LogLevel.All, name) { }
public static CDebugMethodSymbol Create(IDebugMethodField field, IDebugContext context) { return new CDebugMethodSymbol(field, context); }
public CDebugMethodSymbol(IDebugMethodField field, IDebugContext context) : base (field as IDebugField, context) { this.m_MethodField = field; }
public CDebugFieldSymbol(IDebugField field, IDebugValue parent, IDebugContext context) : this(field, context){ this.m_Parent = parent; }
public CDebugFieldSymbol(IDebugField field, IDebugContext context) : base(field, context){ this.m_Parent = null; }
public CDebugEnumType(IDebugEnumField enumField, IDebugContext context) : base(enumField as IDebugField, context) { this.m_EnumField = enumField; }
public CDebugArrayType(IDebugArrayField arrayField, IDebugContext context) : base(arrayField as IDebugField, context) { this.m_ArrayField = arrayField; }
public DebugEnvironment(){ this.context = null; }
public static void Init(IDebugContext context) { Current = context; }
public CDebugPropertySymbol(IDebugPropertyField field, IDebugContext context) : base (field as IDebugField, context) { this.m_PropertyField = field; }
public CEnumDebugValues(IEnumDebugObjects pObjects, IDebugContext pContext) { this.m_Objects = pObjects; this.m_Context = pContext; this.m_Current = null; }
public static CDebugPropertySymbol Create(IDebugPropertyField field, IDebugContext context) { return new CDebugPropertySymbol(field, context); }
public CDebugFlexArrayType(IDebugClassField flexType, IDebugContext context) : base(flexType as IDebugField, context){ this.m_ClassField = flexType; }
public CEnumSymbols(IEnumDebugFields fields, IDebugContext context) { this.m_Fields = fields; this.m_Context = context; this.m_Current = null; }
void IDebugContext.SetParentContext(IDebugContext parent) { Parent = parent; }
public CEnumClosureClassSymbols(IDebugValue parent, IDebugContext context){ this.m_Context = context; this.m_Parent = parent; this.m_ClassType = parent.RuntimeType() as IDebugClassType; this.m_Current = null; if (this.m_Parent != null && this.m_ClassType != null){ this.m_FieldEnumerator = this.m_ClassType.GetMembers(null, true, SymbolKind.Field, SymbolModifiers.All); } }
private IDebugProperty EvaluateExpression(uint evalFlags, uint timeout, IDebugContext context, String resultType) { if (this.debugContext == null) { this.debugContext = new DebugEnvironment(); } this.debugContext.context = context; BlockScope scope = new DebugBlockScope(this.debugContext); ErrorNodeList errors = new ErrorNodeList(); if (this.cciExpr.compiledExpression == null) { this.cciExpr.compiledExpression = (Expression)this.cciExpr.EE.ExprCompiler.CompileParseTree(this.cciExpr.ParsedExpr, scope, new Module(), errors); if (errors.Count > 0) { this.cciExpr.compiledExpression = null; } } if (this.cciExpr.compiledExpression != null) { StackFrame currentFrame = new StackFrame(); IDebugMethodSymbol methodSym = this.debugContext.context.GetContainer() as CDebugMethodSymbol; if (methodSym != null) { IDebugFieldSymbol thisSymbol = methodSym.GetThis(); if (thisSymbol != null) { currentFrame.thisObject = new Literal(thisSymbol.GetValue(null), ((MethodScope )scope.BaseClass).ThisType); } else { currentFrame.thisObject = null; } currentFrame.parameters[0] = currentFrame.thisObject; IEnumSymbol locals = methodSym.GetLocals(); if (locals != null) { for (int i = 0; ; i++) { if (locals.Current == null) { break; } Field localField = new DebugFieldNode(this.debugContext, locals.Current, new Identifier(locals.Current.Name), null, null, i); currentFrame.locals[i] = localField.GetValue(null); locals.MoveNext(); } } IEnumSymbol param = methodSym.GetParameters(); if (param != null) { for (int i = 1; ; i++) { if (param.Current == null) { break; } Field paramField = new DebugFieldNode(this.debugContext, param.Current, new Identifier(param.Current.Name), null, null, i); currentFrame.parameters[i] = paramField.GetValue(null); param.MoveNext(); } } } if (this.cciExpr.EE.ExprEvaluator == null) { this.cciExpr.EE.ExprEvaluator = new Evaluator(); } this.cciExpr.EE.ExprEvaluator.stackFrame = currentFrame; Literal resultExpr = this.cciExpr.EE.ExprEvaluator.VisitExpression(this.cciExpr.compiledExpression) as Literal; if (resultExpr != null) { if (resultExpr.Value is IDebugValue && resultExpr.Type is IDebugInfo) //already wrapped for use by debugger { return(this.cciExpr.EE.MakeProperty(this.cciExpr.Expr, ((IDebugInfo)resultExpr.Type).GetDebugType, (IDebugValue)resultExpr.Value, null)); } else if (resultExpr.Value is IDebugValue) { return(this.cciExpr.EE.MakeProperty(this.cciExpr.Expr, ((IDebugValue)resultExpr.Value).RuntimeType(), (IDebugValue)resultExpr.Value, null)); } if (resultExpr.Value != null) { return(new ExpressionEvalProperty(this.cciExpr.Expr, resultExpr.Type.FullName, resultExpr.Value.ToString(), resultExpr, this.cciExpr.EE)); } } else { return(new ExpressionEvalProperty(this.cciExpr.Expr, String.Empty, "Error Evaluating Expression.", null, this.cciExpr.EE)); } } else if (errors.Count > 0) { return(new ExpressionEvalProperty(this.cciExpr.Expr, String.Empty, errors[0].GetMessage(), null, this.cciExpr.EE)); } return(new ExpressionEvalProperty(this.cciExpr.Expr, String.Empty, "Unknown Compiler Error.", null, this.cciExpr.EE)); }
public CEnumLocalSymbols(IEnumDebugFields fields, IDebugContext context) { this.m_Fields = fields; this.m_Context = context; this.m_Current = null; this.m_IsEnumeratingClosureClass = false; this.m_DisplayRetunLocal = false; }
public DebugEnvironment(IDebugContext context) { this.context = context; }
public CDebugType(IDebugField field, IDebugContext context) { this.m_Field = field; this.m_Context = context; }
public Profiler(IDebugContext debugContext, string name = null) : this(debugContext, LogLevel.All, name) { }
public JwtController(IUserProvider userProvider, IDebugContext debugContext, IConfiguration configuration) { _userProvider = userProvider; _userProvider.DebugContext = debugContext; this._configuration = configuration; }
private IDebugProperty EvaluateExpression(uint evalFlags, uint timeout, IDebugContext context, String resultType){ if (this.debugContext == null) this.debugContext = new DebugEnvironment(); this.debugContext.context = context; BlockScope scope = new DebugBlockScope(this.debugContext); ErrorNodeList errors = new ErrorNodeList(); if (this.cciExpr.compiledExpression == null){ this.cciExpr.compiledExpression = (Expression)this.cciExpr.EE.ExprCompiler.CompileParseTree(this.cciExpr.ParsedExpr, scope, new Module(), errors); if (errors.Count > 0) this.cciExpr.compiledExpression = null; } if (this.cciExpr.compiledExpression != null){ StackFrame currentFrame = new StackFrame(); IDebugMethodSymbol methodSym = this.debugContext.context.GetContainer() as CDebugMethodSymbol; if (methodSym != null){ IDebugFieldSymbol thisSymbol = methodSym.GetThis(); if (thisSymbol != null) currentFrame.thisObject = new Literal(thisSymbol.GetValue(null), ((MethodScope ) scope.BaseClass).ThisType); else currentFrame.thisObject = null; currentFrame.parameters[0] = currentFrame.thisObject; IEnumSymbol locals = methodSym.GetLocals(); if (locals != null){ for (int i=0; ; i++){ if (locals.Current == null) break; Field localField = new DebugFieldNode(this.debugContext, locals.Current, new Identifier(locals.Current.Name), null, null, i); currentFrame.locals[i] = localField.GetValue(null); locals.MoveNext(); } } IEnumSymbol param = methodSym.GetParameters(); if (param != null){ for (int i=1; ; i++){ if (param.Current == null) break; Field paramField = new DebugFieldNode(this.debugContext, param.Current, new Identifier(param.Current.Name), null, null, i); currentFrame.parameters[i] = paramField.GetValue(null); param.MoveNext(); } } } if (this.cciExpr.EE.ExprEvaluator == null) this.cciExpr.EE.ExprEvaluator = new Evaluator(); this.cciExpr.EE.ExprEvaluator.stackFrame = currentFrame; Literal resultExpr = this.cciExpr.EE.ExprEvaluator.VisitExpression(this.cciExpr.compiledExpression) as Literal; if (resultExpr != null){ if (resultExpr.Value is IDebugValue && resultExpr.Type is IDebugInfo) //already wrapped for use by debugger return this.cciExpr.EE.MakeProperty(this.cciExpr.Expr, ((IDebugInfo)resultExpr.Type).GetDebugType, (IDebugValue)resultExpr.Value, null); else if(resultExpr.Value is IDebugValue) return this.cciExpr.EE.MakeProperty(this.cciExpr.Expr, ((IDebugValue)resultExpr.Value).RuntimeType(), (IDebugValue)resultExpr.Value, null); if (resultExpr.Value != null) return new ExpressionEvalProperty(this.cciExpr.Expr, resultExpr.Type.FullName, resultExpr.Value.ToString(), resultExpr, this.cciExpr.EE); } else return new ExpressionEvalProperty(this.cciExpr.Expr, String.Empty, "Error Evaluating Expression.", null, this.cciExpr.EE); } else if (errors.Count > 0){ return new ExpressionEvalProperty(this.cciExpr.Expr, String.Empty, errors[0].GetMessage(), null, this.cciExpr.EE); } return new ExpressionEvalProperty(this.cciExpr.Expr, String.Empty, "Unknown Compiler Error.", null, this.cciExpr.EE); }
public PetsController(IPetProvider petProvider, IDebugContext debugContext) { _petProvider = petProvider; _petProvider.DebugContext = debugContext; }
public DebugEnvironment(IDebugContext context){ this.context = context; }
public PetsController(IPetProvider petProvider, IDebugContext debugContext) { _petProvider = petProvider; _petProvider.DebugContext = debugContext; }
public DebugContextWithProvider(IDebugContext debugContext, IDebugContextProvider debugContextProvider) { m_context = debugContext; m_contextProvider = debugContextProvider; }
public ScopeDebugContext(IDebugContext context) { m_Context = context; Service <IDebugContextService> .Current.Push(context); }
public CDebugArrayValue(IDebugArrayObject pObject, IDebugContext pContext) :base(pObject as IDebugObject, pContext){ this.m_ArrayObject = pObject; }
public CDebugArrayValue(IDebugArrayObject pObject, IDebugContext pContext) : base(pObject as IDebugObject, pContext) { this.m_ArrayObject = pObject; }
public CDebugValue(IDebugObject pObject, IDebugContext pContext){ this.m_Object = pObject; this.m_Context = pContext; this.m_RuntimeType = null; }
public CEnumDebugValues(IEnumDebugObjects pObjects, IDebugContext pContext) { this.m_Objects = pObjects; this.m_Context = pContext; this.m_Current = null; }
public CDebugPrimitiveType(IDebugField field, IDebugContext context) : base(field, context) { }
/// <summary> /// Handle the given trigger. /// </summary> /// <param name="triggerType">The type of trigger to evaluate.</param> /// <param name="eventArgs">The event arguments to handle.</param> /// <param name="context">The debug context to execute the action on.</param> public void HandleEvent(DebugTrigger triggerType, DebuggerEventArgs eventArgs, IDebugContext context) { if (_trigger == triggerType) { foreach (string command in _debugScript) { try { context.RunCommand(command); } catch (DebugMonitorException) { } } } }
public PoliciesController(IPolicyProvider policyProvider, IDebugContext debugContext) { _policyProvider = policyProvider; _policyProvider.DebugContext = debugContext; }
/// <summary> /// Handle a trigger event. /// </summary> /// <param name="triggerType">The type of trigger to handle.</param> /// <param name="eventArgs">The trigger event arguments.</param> /// <param name="context">The debug context to perform.</param> /// <returns>True if the trigger should be handled.</returns> public void HandleEvent(DebugTrigger triggerType, DebuggerEventArgs eventArgs, IDebugContext context) { if (triggerType == DebugTrigger.Exception && !((ExceptionEventArgs)eventArgs).FirstChance) { try { GenerateExceptionReport(context); } catch (DebugMonitorException) { } } }