예제 #1
0
 protected void CheckAnonymousScope(AnonymousScopeEntry scope)
 {
     Debug("Anonymous scope: {0}", scope);
     foreach (CapturedScope captured in scope.CapturedScopes)
     {
         if (File.GetAnonymousScope(captured.Scope) == null)
         {
             throw new MonoSymbolFileException("Anonymous scope {0} has invalid captured scopes.", scope.ID);
         }
     }
 }
예제 #2
0
        public AnonymousScopeEntry GetAnonymousScope(int id)
        {
            if (reader == null)
                throw new InvalidOperationException ();

            AnonymousScopeEntry scope;
            lock (this) {
                if (anonymous_scopes != null) {
                    anonymous_scopes.TryGetValue (id, out scope);
                    return scope;
                }

                anonymous_scopes = new Dictionary<int, AnonymousScopeEntry> ();
                reader.BaseStream.Position = ot.AnonymousScopeTableOffset;
                for (int i = 0; i < ot.AnonymousScopeCount; i++) {
                    scope = new AnonymousScopeEntry (reader);
                    anonymous_scopes.Add (scope.ID, scope);
                }

                return anonymous_scopes [id];
            }
        }