Exemple #1
0
        public override MemberList GetMembersNamed(Identifier name)
        {
            MemberList   returnList = new MemberList();
            IDebugSymbol container  = this.debugEnv.context.GetContainer();

            CDebugMethodSymbol methodSymbol = null;

            if ((methodSymbol = container as CDebugMethodSymbol) != null)
            {
                if (name.Name == "this")
                {
                    returnList.Add(new DebugFieldNode(this.debugEnv, methodSymbol.GetThis(), name, null, null, 0));
                }
                else
                {
                    IEnumSymbol param = methodSymbol.GetParameters();
                    if (param != null)
                    {
                        for (int i = 1; ; i++)
                        {
                            if (param.Current == null)
                            {
                                break;
                            }
                            if (param.Current.Name == name.Name)
                            {
                                DebugParameterField paramField = new DebugParameterField(this.debugEnv, param.Current, name, null, this);
                                paramField.DeclaringType = this;
                                paramField.Parameter     = this.DeclaringMethod.Parameters[i];
                                returnList.Add(paramField);
                                break;
                            }
                            param.MoveNext();
                        }
                    }
                }
            }
            return(returnList);
        }
Exemple #2
0
        public override MemberList GetMembersNamed(Identifier name)
        {
            MemberList   returnList = new MemberList();
            IDebugSymbol container  = this.debugEnv.context.GetContainer();

            CDebugMethodSymbol methodSymbol = null;

            if ((methodSymbol = container as CDebugMethodSymbol) != null)
            {
                if (name.Name == "this")
                {
                    returnList.Add(new DebugFieldNode(this.debugEnv, methodSymbol.GetThis(), name, null, null, 0));
                }
                else
                {
                    IEnumSymbol locals = methodSymbol.GetLocals();
                    if (locals != null)
                    {
                        for (int i = 0; ; i++)
                        {
                            if (locals.Current == null)
                            {
                                break;
                            }
                            if (locals.Current.Name == name.Name)
                            {
                                Field localField = new DebugFieldNode(this.debugEnv, locals.Current, name, null, this, i);
                                localField.DeclaringType = this;
                                returnList.Add(localField);
                                break;
                            }
                            locals.MoveNext();
                        }
                    }
                }
            }
            return(returnList);
        }
Exemple #3
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);
     }
 }