public bool IsEqual(IDebugValue val) { bool pRetVal = false; this.m_Object.IsEqual(((CDebugValue )val).m_Object, out pRetVal); return(pRetVal); }
internal EnumDebugPropertyTypes(IEnumDebugTypes enumTypes, IDebugProperty parent, IDebugValue containerValue, CommonExpressionEvaluator evaluator) { this.enumTypes = enumTypes; this.parent = parent; this.containerValue = containerValue; this.evaluator = evaluator; }
public virtual BaseProperty MakeProperty(IDebugPropertySymbol symbol, IDebugProperty parent, IDebugValue containerValue) { IDebugMethodSymbol getter = symbol.GetGetter(); IDebugValue value = null; if (getter != null /*&& (context.flags & EvaluationFlags.NoFuncEval) == 0*/) { IEnumSymbol parameters = getter.GetParameters(); if (parameters == null || parameters.Count == 0) { IDebugValue[] arguments = null; if ((getter.Modifiers & SymbolModifiers.Static) == 0) { arguments = new IDebugValue[] { containerValue } } ; else { arguments = new IDebugValue[0]; } value = getter.Evaluate(containerValue, arguments); } } return(this.MakeProperty(symbol.Name, symbol.Type, value, parent)); }
internal EnumDebugPropertySymbols(IEnumSymbol enumSymbols, IDebugProperty parent, IDebugValue containerValue, CommonExpressionEvaluator evaluator) { this.enumSymbols = enumSymbols; this.parent = parent; this.containerValue = containerValue; this.evaluator = evaluator; }
public bool MoveNext() { bool pRetVal = false; if (null != this.m_Current) { this.m_Current = null; } else { // Skip the first element this.m_Objects.Skip(1); } IDebugObject pObject = null; IDebugObject[] pObjects = new IDebugObject[1]; int fetched = 0; this.m_Objects.Next(1, pObjects, out fetched); if (null != pObjects && fetched > 0) { pObject = pObjects[0]; IDebugValue val = new CDebugValue(pObject, this.m_Context); this.m_Current = val; pRetVal = true; } return(pRetVal); }
public DebugClassNode(DebugEnvironment envr, IDebugType symbolType, IDebugValue value) { this.debugEnv = envr; this.SymbolType = symbolType; this.Value = value; this.Name = Identifier.For(this.GetDebugType.Name); }
public TypeProperty(IDebugType type, IDebugProperty parent, IDebugValue containerValue, CommonExpressionEvaluator evaluator) { this.type = type; this.parent = parent; this.name = this.type.FullName; this.containerValue = containerValue; this.evaluator = evaluator; }
public void Reset() { this.m_Objects.Reset(); if (null != this.m_Current) { this.m_Current = null; } }
public BaseProperty(string name, IDebugType staticType, IDebugValue value, IDebugProperty parent, CommonExpressionEvaluator evaluator) { this.name = name; this.staticType = staticType; this.parent = parent; this.value = value; this.evaluator = evaluator; }
public EnumProperty(string name, IDebugType staticType, IDebugValue value, IDebugProperty parent, CommonExpressionEvaluator evaluator) : base(name, staticType, value, parent, evaluator) { this.enumType = value.RuntimeType() as IDebugEnumType; if (this.enumType == null) { this.enumType = staticType as IDebugEnumType; } }
internal EnumArrayIndices(IEnumDebugValues enumValues, IDebugType elementType, IDebugProperty parent, IDebugValue containerValue, CommonExpressionEvaluator evaluator) { this.enumValues = enumValues; this.elementType = elementType; this.parent = parent; this.containerValue = containerValue; this.index = 0; this.evaluator = evaluator; }
public virtual BaseProperty MakeProperty(IDebugFieldSymbol symbol, IDebugProperty parent, IDebugValue containerValue) { IDebugType staticType = symbol.Type; IDebugValue value = symbol.GetValue(containerValue); if (symbol.Name == "this value: ") { return(this.MakeProperty("this", symbol.Type, value, parent)); } return(this.MakeProperty(symbol.Name, symbol.Type, value, parent)); }
public StructuralProperty(string name, IDebugType staticType, IDebugValue value, IDebugProperty parent, CommonExpressionEvaluator evaluator) : base(name, staticType, value, parent, evaluator) { if (this.value != null) { this.structuralType = this.value.RuntimeType() as IDebugStructuralType; } else { this.structuralType = staticType as IDebugStructuralType; } }
public IDebugValue GetElement(int index) { IDebugValue pRetVal = null; IDebugObject element = null; this.m_ArrayObject.GetElement((uint)index, out element); if (null != element) { pRetVal = new CDebugValue(element, this.m_Context); } return(pRetVal); }
public override string GetValue(uint radix, uint timeout) { if (this.value == null || this.value.IsNullReference()) { return("null"); } else { IDebugClassType classType = (IDebugClassType)this.value.RuntimeType(); IDebugFieldSymbol countSymbol; IDebugValue count = null; IEnumSymbol enumCountSymbol = classType.GetMembers("count", true, SymbolKind.Field, SymbolModifiers.All); if ((countSymbol = enumCountSymbol.Current as IDebugFieldSymbol) != null) { count = countSymbol.GetValue(this.value); } return("{length = " + count.GetValue().ToString() + "}"); } }
// Override these factory methods to create language specfic IDebugProperty implementations public virtual BaseProperty MakeProperty(string name, IDebugType staticType, IDebugValue value, IDebugProperty parent) { IDebugType type = null; if (value == null || value.IsNullReference() || staticType.Kind == TypeKind.Stream || staticType.Kind == TypeKind.FlexArray || staticType.Kind == TypeKind.Enum) { type = staticType; } else { type = value.RuntimeType(); } switch (type.Kind) { case TypeKind.Primitive: return(MakePrimitiveTypeProperty(name, staticType, value, parent)); case TypeKind.InnerClass: case TypeKind.Class: return(MakeClassProperty(name, staticType, value, parent)); case TypeKind.FlexArray: return(MakeFlexArrayProperty(name, staticType, value, parent)); case TypeKind.Tuple: return(MakeStructuralProperty(name, staticType, value, parent)); case TypeKind.Stream: return(MakeStreamProperty(name, staticType, value, parent)); case TypeKind.Array: return(MakeArrayProperty(name, staticType, value, parent)); case TypeKind.Enum: return(MakeEnumProperty(name, staticType, value, parent)); } return(null); }
// Override these factory methods to create language specfic IDebugProperty implementations public virtual BaseProperty MakeProperty(string name, IDebugType staticType, IDebugValue value, IDebugProperty parent){ IDebugType type = null; if (value == null || value.IsNullReference() || staticType.Kind == TypeKind.Stream || staticType.Kind == TypeKind.FlexArray || staticType.Kind == TypeKind.Enum) type = staticType; else type = value.RuntimeType(); switch (type.Kind){ case TypeKind.Primitive: return MakePrimitiveTypeProperty(name, staticType, value, parent); case TypeKind.InnerClass: case TypeKind.Class: return MakeClassProperty(name, staticType, value, parent); case TypeKind.FlexArray: return MakeFlexArrayProperty(name, staticType, value, parent); case TypeKind.Tuple: return MakeStructuralProperty(name, staticType, value, parent); case TypeKind.Stream: return MakeStreamProperty(name, staticType, value, parent); case TypeKind.Array: return MakeArrayProperty(name, staticType, value, parent); case TypeKind.Enum: return MakeEnumProperty(name, staticType, value, parent); } return null; }
public virtual BaseProperty MakeStructuralProperty(string name, IDebugType staticType, IDebugValue value, IDebugProperty parent){ return new StructuralProperty(name, staticType, value, parent, this); }
internal EnumDebugPropertySymbols(IEnumSymbol enumSymbols, IDebugProperty parent, IDebugValue containerValue, CommonExpressionEvaluator evaluator){ this.enumSymbols = enumSymbols; this.parent = parent; this.containerValue = containerValue; this.evaluator = evaluator; }
internal EnumDebugPropertyTypes(IEnumDebugTypes enumTypes, IDebugProperty parent, IDebugValue containerValue, CommonExpressionEvaluator evaluator){ this.enumTypes = enumTypes; this.parent = parent; this.containerValue = containerValue; this.evaluator = evaluator; }
public StructuralProperty(string name, IDebugType staticType, IDebugValue value, IDebugProperty parent, CommonExpressionEvaluator evaluator) : base(name, staticType, value, parent, evaluator){ if (this.value != null) this.structuralType = this.value.RuntimeType() as IDebugStructuralType; else this.structuralType = staticType as IDebugStructuralType; }
public ArrayProperty(string name, IDebugType staticType, IDebugValue containerValue, IDebugProperty parent, CommonExpressionEvaluator evaluator) : base(name, staticType, containerValue, parent, evaluator){ arrayValue = (IDebugArrayValue)this.value; }
public void SetReferenceValue(IDebugValue val) { this.m_Object.SetReferenceValue(((CDebugValue )val).m_Object); }
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); } }
public DebugFieldNode(DebugEnvironment envr, IDebugSymbol symbol, Identifier name, IDebugValue container, TypeNode declaringType, int id) { this.debugEnv = envr; this.Symbol = symbol; this.Container = container; this.Name = name; this.index = id; this.DeclaringType = declaringType; switch (symbol.Type.Kind) { case TypeKind.Class: this.Type = new DebugClassNode(this.debugEnv, this.Symbol.Type, ((IDebugFieldSymbol )symbol).GetValue(Container)); break; case TypeKind.Stream: this.Type = symbol.Type.CompilerType; break; case TypeKind.Tuple: StructTypes sType = ((IDebugStructuralType)this.Symbol.Type).StructuralType; switch (sType) { case StructTypes.Tuple: FieldList list = new FieldList(); IEnumSymbol symbols = ((IDebugStructuralType)this.Symbol.Type).GetMembers(null, true, SymbolKind.Field, SymbolModifiers.All); if (symbols != null) { while (symbols.Current != null) { Field fieldMember = new DebugFieldNode(this.debugEnv, symbols.Current, new Identifier(symbols.Current.Name), ((IDebugFieldSymbol )symbol).GetValue(Container), null, 0); SymbolModifiers modifier = symbols.Current.Modifiers; if ((modifier & SymbolModifiers.Abstract) != 0) { fieldMember.Flags |= FieldFlags.None; } if ((modifier & SymbolModifiers.Final) != 0) { fieldMember.Flags |= FieldFlags.None; } if ((modifier & SymbolModifiers.Private) != 0) { fieldMember.Flags |= FieldFlags.Private; } if ((modifier & SymbolModifiers.Public) != 0) { fieldMember.Flags |= FieldFlags.Public; } if ((modifier & SymbolModifiers.Static) != 0) { fieldMember.Flags |= FieldFlags.Static; } list.Add(fieldMember); symbols.MoveNext(); } } Class dummy = new Class(); dummy.DeclaringModule = new Module(); this.Type = TupleType.For(list, dummy); break; case StructTypes.Union: // HACK: Need a better way for identifying return types this.Type = TypeUnion.For(SymbolHelper.GetTypeList(this.Symbol.Type.FullName, this.debugEnv.context), new Module()); break; case StructTypes.Intersection: // TODO: Need to figure out Intersection Types, I think depends on figuring out return Type //this.Type = TypeIntersection.For(typeList, new Module()); this.Type = new Class(); break; } /*FieldList list = new FieldList(); * IEnumSymbol symbols = ((IDebugStructuralType) this.Symbol.Type).GetMembers(null, true, SymbolKind.Field, SymbolModifiers.All); * if (symbols != null){ * while(symbols.Current != null){ * list.Add(new DebugFieldNode(this.debugEnv, symbols.Current, new Identifier(symbols.Current.Name), null, null, 0)); * symbols.MoveNext(); * } * } * Class dummy = new Class(); * dummy.DeclaringModule = new Module(); * this.Type = TupleType.For(list, dummy);*/ break; case TypeKind.Primitive: switch (this.Symbol.Type.TypeCode) { case TypeCode.Boolean: this.Type = SystemTypes.Boolean; break; case TypeCode.Char: this.Type = SystemTypes.Char; break; case TypeCode.Int16: this.Type = SystemTypes.Int16; break; case TypeCode.UInt16: this.Type = SystemTypes.UInt32; break; case TypeCode.Int32: this.Type = SystemTypes.Int32; break; case TypeCode.UInt32: this.Type = SystemTypes.UInt32; break; case TypeCode.Int64: this.Type = SystemTypes.Int64; break; case TypeCode.UInt64: this.Type = SystemTypes.UInt64; break; case TypeCode.Double: this.Type = SystemTypes.Double; break; case TypeCode.Single: this.Type = SystemTypes.Single; break; case TypeCode.SByte: this.Type = SystemTypes.Int8; break; case TypeCode.Byte: this.Type = SystemTypes.UInt8; break; case TypeCode.String: this.Type = SystemTypes.String; break; } break; case TypeKind.Enum: this.Type = new DebugEnumNode(this.debugEnv, this.Symbol.Type); break; } }
public IDebugValue Evaluate(IDebugValue containerValue, IDebugValue[] arguments) { IDebugValue pRetVal = null; uint argcount = 0; if( null != arguments ) { argcount = (uint ) arguments.Length; } IDebugObject[] args = new IDebugObject[argcount]; if (null != args){ if (argcount > 0){ for (uint i = 0; i < argcount; i++){ IDebugValue value = arguments[i] as IDebugValue; if (null != value){ args[i] = ((CDebugValue ) value).GetObject(); } else { return null; } } } IDebugObject containerObject = null; if (null != containerValue){ containerObject = ((CDebugValue ) containerValue).GetObject(); } IDebugBinder binder = this.m_Context.Binder; IDebugObject pObject = null; binder.Bind(containerObject, this.m_Field, out pObject); IDebugFunctionObject pFuncObject = null; pFuncObject = pObject as IDebugFunctionObject; if (null != pFuncObject) { IDebugObject result = null; pFuncObject.Evaluate(args, argcount, /*this.m_Context.timeout*/ 99999, out result); if (null != result) { pRetVal = new CDebugValue(result, this.m_Context); } } } return pRetVal; }
public IDebugValue GetValue(IDebugValue container) { IDebugValue pRetVal = null; IDebugObject containerObject = null; if (this.m_Parent != null) container = this.m_Parent; if (null != container) containerObject = ((CDebugValue) container).GetObject(); IDebugBinder binder = this.m_Context.Binder; if (null != binder){ IDebugObject pObject = null; binder.Bind(containerObject, this.m_Field, out pObject); IDebugEnumField enumField = null; if ( null != (enumField = this.m_Field as IDebugEnumField)) { IDebugField underlyingField = null; enumField.GetUnderlyingSymbol(out underlyingField); if (null != underlyingField){ IDebugObject underlyingObject = null; binder.Bind(pObject, underlyingField, out underlyingObject); if (null != underlyingObject){ pObject = underlyingObject; } } } if (null != pObject){ if(this.Type.Kind == TypeKind.Array) pRetVal = new CDebugArrayValue(pObject as IDebugArrayObject, this.m_Context); else pRetVal = new CDebugValue(pObject, this.m_Context); } } return pRetVal; }
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 virtual BaseProperty MakeProperty(IDebugFieldSymbol symbol, IDebugProperty parent, IDebugValue containerValue){ IDebugType staticType = symbol.Type; IDebugValue value = symbol.GetValue(containerValue); if (symbol.Name == "this value: ") return this.MakeProperty("this", symbol.Type, value, parent); return this.MakeProperty(symbol.Name, symbol.Type, value, parent); }
public bool MoveNext() { bool pRetVal = false; if (null != this.m_Current){ this.m_Current = null; } else { // Skip the first element this.m_Objects.Skip(1); } IDebugObject pObject = null; IDebugObject[] pObjects = new IDebugObject[1]; int fetched = 0; this.m_Objects.Next(1, pObjects, out fetched); if (null != pObjects && fetched > 0) { pObject = pObjects[0]; IDebugValue val = new CDebugValue(pObject, this.m_Context); this.m_Current = val; pRetVal = true; } return pRetVal; }
public virtual BaseProperty MakeFlexArrayProperty(string name, IDebugType staticType, IDebugValue value, IDebugProperty parent) { return(new FlexArrayProperty(name, staticType, value, parent, this)); }
public BaseProperty(string name, IDebugType staticType, IDebugValue value, IDebugProperty parent, CommonExpressionEvaluator evaluator){ this.name = name; this.staticType = staticType; this.parent = parent; this.value = value; this.evaluator = evaluator; }
public ArrayProperty(string name, IDebugType staticType, IDebugValue containerValue, IDebugProperty parent, CommonExpressionEvaluator evaluator) : base(name, staticType, containerValue, parent, evaluator) { arrayValue = (IDebugArrayValue)this.value; }
public FlexArrayProperty(string name, IDebugType staticType, IDebugValue value, IDebugProperty parent, CommonExpressionEvaluator evaluator) : base(name, staticType, value, parent, evaluator){ }
public FlexArrayProperty(string name, IDebugType staticType, IDebugValue value, IDebugProperty parent, CommonExpressionEvaluator evaluator) : base(name, staticType, value, parent, evaluator) { }
public EnumProperty(string name, IDebugType staticType, IDebugValue value, IDebugProperty parent, CommonExpressionEvaluator evaluator) : base(name, staticType, value, parent, evaluator){ this.enumType = value.RuntimeType() as IDebugEnumType; if (this.enumType == null) this.enumType = staticType as IDebugEnumType; }
public IDebugValue CreateObject(IDebugMethodSymbol constructor, IDebugValue[] args) { throw new Exception("Not implemented Yet"); }
public TypeProperty(IDebugType type, IDebugProperty parent, IDebugValue containerValue, CommonExpressionEvaluator evaluator){ this.type = type; this.parent = parent; this.name = this.type.FullName; this.containerValue = containerValue; this.evaluator = evaluator; }
public void SetReferenceValue(IDebugValue val) { this.m_Object.SetReferenceValue( ((CDebugValue ) val).m_Object); }
internal EnumArrayIndices(IEnumDebugValues enumValues, IDebugType elementType, IDebugProperty parent, IDebugValue containerValue, CommonExpressionEvaluator evaluator){ this.enumValues = enumValues; this.elementType = elementType; this.parent = parent; this.containerValue = containerValue; this.index = 0; this.evaluator = evaluator; }
public bool IsEqual(IDebugValue val) { bool pRetVal = false; this.m_Object.IsEqual(((CDebugValue ) val).m_Object, out pRetVal); return pRetVal; }
public virtual BaseProperty MakePrimitiveTypeProperty(string name, IDebugType staticType, IDebugValue value, IDebugProperty parent){ return new PrimitiveTypeProperty(name, staticType, value, parent, this); }
public CEnumDebugValues(IEnumDebugObjects pObjects, IDebugContext pContext) { this.m_Objects = pObjects; this.m_Context = pContext; this.m_Current = null; }
public virtual BaseProperty MakeFlexArrayProperty(string name, IDebugType staticType, IDebugValue value, IDebugProperty parent){ return new FlexArrayProperty(name, staticType, value, parent, this); }
public IEnumSymbol GetClosureClassMembers(IDebugValue value){ return new CEnumClosureClassSymbols(value, this.m_Context); }
public virtual BaseProperty MakeProperty(IDebugPropertySymbol symbol, IDebugProperty parent, IDebugValue containerValue){ IDebugMethodSymbol getter = symbol.GetGetter(); IDebugValue value = null; if (getter != null /*&& (context.flags & EvaluationFlags.NoFuncEval) == 0*/){ IEnumSymbol parameters = getter.GetParameters(); if (parameters == null || parameters.Count == 0){ IDebugValue[] arguments = null; if ((getter.Modifiers & SymbolModifiers.Static) == 0) arguments = new IDebugValue[]{containerValue}; else arguments = new IDebugValue[0]; value = getter.Evaluate(containerValue, arguments); } } return this.MakeProperty(symbol.Name, symbol.Type, value, parent); }