Пример #1
0
        public DebugMethod(DebugEnvironment envr, CDebugMethodSymbol method, DebugMethodScope scope)
        {
            this.debugEnv      = envr;
            this.methodSymbol  = method;
            this.DeclaringType = method.GetDeclaringType().CompilerType;
            SymbolModifiers modifier = this.methodSymbol.Modifiers;

            if ((modifier & SymbolModifiers.Abstract) != 0)
            {
                this.Flags |= MethodFlags.Abstract;
            }
            if ((modifier & SymbolModifiers.Final) != 0)
            {
                this.Flags |= MethodFlags.Final;
            }
            if ((modifier & SymbolModifiers.Private) != 0)
            {
                this.Flags |= MethodFlags.Private;
            }
            if ((modifier & SymbolModifiers.Public) != 0)
            {
                this.Flags |= MethodFlags.Public;
            }
            if ((modifier & SymbolModifiers.Static) != 0)
            {
                this.Flags |= MethodFlags.Static;
            }

            this.Scope = scope;
            if (this.methodSymbol != null)
            {
                IDebugFieldSymbol thisSymbol = this.methodSymbol.GetThis();
                if (thisSymbol != null)
                {
                    this.ThisParameter = new This(new DebugClassNode(this.debugEnv, thisSymbol.Type, thisSymbol.GetValue(null)));
                }
                ParameterList pList = new ParameterList();
                IEnumSymbol   param = methodSymbol.GetParameters();
                if (param != null)
                {
                    for (int i = 1; ; i++)
                    {
                        if (param.Current == null)
                        {
                            break;
                        }
                        ParameterField paramField = new DebugParameterField(this.debugEnv, param.Current, new Identifier(param.Current.Name), null, scope);
                        paramField.DeclaringType = scope;
                        pList[i] = new Parameter(paramField.Name, paramField.Type);
                        pList[i].ArgumentListIndex = i;
                        param.MoveNext();
                    }
                }
                this.Parameters = pList;
            }
        }
Пример #2
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);
     }
 }