Beispiel #1
0
        public override IEnumDebugProperty EnumChildren(EnumerationKind kind, int radix, int timeout, bool allowFuncEval)
        {
            if (this.value == null || this.value.IsNullReference())
            {
                return(null);
            }
            IDebugType       typ        = this.value.RuntimeType();
            IDebugClassType  classType  = null;
            IDebugStreamType streamType = null;

            if ((classType = typ as IDebugClassType) != null)
            {
                //IEnumSymbol enumSymbol = new CEnumClosureClassSymbols(this.value, this.context);
                IEnumSymbol enumSymbol = classType.GetClosureClassMembers(this.value);
                //IEnumSymbol enumSymbol = classType.GetMembers(null, true, SymbolKind.Field|SymbolKind.Property, SymbolModifiers.All);
                return(new EnumDebugPropertySymbols(enumSymbol, this, this.value, this.evaluator));
            }
            else if ((streamType = typ as IDebugStreamType) != null)
            {
                //IDebugStreamType classType = (IDebugStreamType)this.value.RuntimeType();
                IEnumSymbol enumSymbol = streamType.GetMembers(null, true, SymbolKind.Field | SymbolKind.Property, SymbolModifiers.All);
                return(new EnumDebugPropertySymbols(enumSymbol, this, this.value, this.evaluator));
            }
            else
            {
                return(null);
            }
        }
Beispiel #2
0
        public override IEnumDebugProperty EnumChildren(EnumerationKind kind, int radix, int timeout, bool allowFuncEval)
        {
            if (this.value == null || this.value.IsNullReference())
            {
                return(null);
            }
            IDebugClassType classType          = (IDebugClassType)this.value.RuntimeType();
            IEnumSymbol     enumCountSymbol    = classType.GetMembers("Count", true, SymbolKind.Property, SymbolModifiers.All);
            IEnumSymbol     enumElementsSymbol = classType.GetMembers("elements", true, SymbolKind.Field, SymbolModifiers.All);

            return(new AggregateEnumDebugProperty(
                       new EnumDebugPropertySymbols(enumCountSymbol, this, this.value, this.evaluator),
                       new EnumDebugPropertySymbols(enumElementsSymbol, this, this.value, this.evaluator)));
        }
Beispiel #3
0
        public virtual IEnumDebugProperty EnumChildren(EnumerationKind kind, int radix, int timeout, bool allowFuncEval)
        {
            IDebugClassType classType = this.type as IDebugClassType;

            if (classType != null)
            {
                IEnumDebugTypes enumBaseClasses = classType.GetBaseClasses();
                IEnumSymbol     enumMembers     = classType.GetMembers(null, true, SymbolKind.Field, SymbolModifiers.All);
                return(new AggregateEnumDebugProperty(
                           new EnumDebugPropertySymbols(enumMembers, this, this.containerValue, this.evaluator),
                           new EnumDebugPropertyTypes(enumBaseClasses, this, containerValue, this.evaluator)));
            }
            return(null);
        }
Beispiel #4
0
 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() + "}");
     }
 }
Beispiel #5
0
        public override IEnumDebugProperty EnumChildren(EnumerationKind kind, int radix, int timeout, bool allowFuncEval)
        {
            if (this.value == null || this.value.IsNullReference())
            {
                return(null);
            }
            IDebugClassType classType = (IDebugClassType)this.value.RuntimeType();

            if (classType.Name.IndexOf("closure") >= 0)
            {
                IEnumSymbol closureSymbol = classType.GetClosureClassMembers(this.value);
                return(new EnumDebugPropertySymbols(closureSymbol, this, this.value, this.evaluator));
            }
            else
            {
                IEnumSymbol     enumSymbol      = classType.GetMembers(null, true, SymbolKind.Field | SymbolKind.Property, SymbolModifiers.All);
                IEnumDebugTypes enumBaseClasses = classType.GetBaseClasses();
                return(new AggregateEnumDebugProperty(
                           new EnumDebugPropertyTypes(enumBaseClasses, this, this.value, this.evaluator),
                           new EnumDebugPropertySymbols(enumSymbol, this, this.value, this.evaluator)));
            }
        }
Beispiel #6
0
 public DebugMethodScope(DebugEnvironment envr, CDebugMethodSymbol method)
 {
     this.debugEnv = envr;
     if (method != null)
     {
         this.methodSymbol = method;
         IDebugFieldSymbol thisSymbol = method.GetThis();
         if (thisSymbol != null)
         {
             this.ThisType  = new DebugClassNode(this.debugEnv, thisSymbol.Type, thisSymbol.GetValue(null));
             this.BaseClass = new DebugTypeScope(this.debugEnv, null, this.ThisType);
         }
         else
         {
             IDebugClassType classType = method.GetDeclaringType();
             if (classType != null)
             {
                 Class declaringType = new DebugClassNode(this.debugEnv, classType, null);
                 this.BaseClass = new DebugTypeScope(this.debugEnv, null, declaringType);
             }
         }
         this.DeclaringMethod = new DebugMethod(this.debugEnv, this.methodSymbol, this);
     }
 }
Beispiel #7
0
 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);
   }
 }