Inheritance: ISymbolReader
Exemple #1
0
 private static Scope[] ReadScopes(MethodEntry entry, MethodBody body, InstructionMapper mapper)
 {
     CodeBlockEntry[] blocks = entry.GetCodeBlocks();
     Scope[]          scopes = new Scope[blocks.Length];
     CodeBlockEntry[] array  = blocks;
     for (int i = 0; i < array.Length; i++)
     {
         CodeBlockEntry block = array[i];
         if (block.BlockType == CodeBlockEntry.Type.Lexical)
         {
             Scope scope = new Scope();
             scope.Start         = mapper(block.StartOffset);
             scope.End           = mapper(block.EndOffset);
             scopes[block.Index] = scope;
             if (body.Scope == null)
             {
                 body.Scope = scope;
             }
             if (!MdbReader.AddScope(body.Scope, scope))
             {
                 body.Scope = scope;
             }
         }
     }
     return(scopes);
 }
Exemple #2
0
        private static bool AddScope(Scope provider, Scope scope)
        {
            bool result;

            {
                // foreach(var sub_scope in provider.Scopes)
                var __enumerator1 = (provider.Scopes).GetEnumerator();
                while (__enumerator1.MoveNext())
                {
                    var sub_scope = (Scope)__enumerator1.Current;
                    {
                        if (MdbReader.AddScope(sub_scope, scope))
                        {
                            result = true;
                            return(result);
                        }
                        if (scope.Start.Offset >= sub_scope.Start.Offset && scope.End.Offset <= sub_scope.End.Offset)
                        {
                            sub_scope.Scopes.Add(scope);
                            result = true;
                            return(result);
                        }
                    }
                }
            }
            result = false;
            return(result);
        }
Exemple #3
0
        public void Read(MethodSymbols symbols)
        {
            MethodEntry entry = this.symbol_file.GetMethodByToken(symbols.MethodToken.ToInt32());

            if (entry != null)
            {
                this.ReadLineNumbers(entry, symbols);
                MdbReader.ReadLocalVariables(entry, symbols);
            }
        }
Exemple #4
0
        public void Read(MethodBody body, InstructionMapper mapper)
        {
            MetadataToken method_token = body.Method.MetadataToken;
            MethodEntry   entry        = this.symbol_file.GetMethodByToken(method_token.ToInt32());

            if (entry != null)
            {
                Scope[] scopes = MdbReader.ReadScopes(entry, body, mapper);
                this.ReadLineNumbers(entry, mapper);
                MdbReader.ReadLocalVariables(entry, body, scopes);
            }
        }
Exemple #5
0
        private static bool AddScope(Scope provider, Scope scope)
        {
            bool result;

            foreach (Scope sub_scope in provider.Scopes)
            {
                if (MdbReader.AddScope(sub_scope, scope))
                {
                    result = true;
                    return(result);
                }
                if (scope.Start.Offset >= sub_scope.Start.Offset && scope.End.Offset <= sub_scope.End.Offset)
                {
                    sub_scope.Scopes.Add(scope);
                    result = true;
                    return(result);
                }
            }
            result = false;
            return(result);
        }