Exemplo n.º 1
0
        public AnonymousScopeEntry GetAnonymousScope(int id)
        {
            if (this.reader == null)
            {
                throw new InvalidOperationException();
            }
            AnonymousScopeEntry result;

            if (this.anonymous_scopes != null)
            {
                AnonymousScopeEntry scope;
                this.anonymous_scopes.TryGetValue(id, out scope);
                result = scope;
            }
            else
            {
                this.anonymous_scopes           = new Dictionary <int, AnonymousScopeEntry>();
                this.reader.BaseStream.Position = (long)this.ot.AnonymousScopeTableOffset;
                for (int i = 0; i < this.ot.AnonymousScopeCount; i++)
                {
                    AnonymousScopeEntry scope = new AnonymousScopeEntry(this.reader);
                    this.anonymous_scopes.Add(scope.ID, scope);
                }
                result = this.anonymous_scopes[id];
            }

            return(result);
        }
        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]);
            }
        }
Exemplo n.º 3
0
        internal void DefineCapturedScope(int scope_id, int id, string captured_name)
        {
            if (this.reader != null)
            {
                throw new InvalidOperationException();
            }
            AnonymousScopeEntry scope = this.anonymous_scopes[scope_id];

            scope.AddCapturedScope(id, captured_name);
        }
Exemplo n.º 4
0
        internal void DefineCapturedVariable(int scope_id, string name, string captured_name, CapturedVariable.CapturedKind kind)
        {
            if (this.reader != null)
            {
                throw new InvalidOperationException();
            }
            AnonymousScopeEntry scope = this.anonymous_scopes[scope_id];

            scope.AddCapturedVariable(name, captured_name, kind);
        }
Exemplo n.º 5
0
        void read_scopes()
        {
            lock (this) {
                if (anonymous_scopes != null)
                {
                    return;
                }

                long old_pos = reader.BaseStream.Position;
                reader.BaseStream.Position = ot.AnonymousScopeTableOffset;

                anonymous_scopes = new Hashtable();
                for (int i = 0; i < ot.AnonymousScopeCount; i++)
                {
                    AnonymousScopeEntry scope = new AnonymousScopeEntry(reader);
                    anonymous_scopes.Add(scope.ID, scope);
                }

                reader.BaseStream.Position = old_pos;
            }
        }
Exemplo n.º 6
0
        public AnonymousScopeEntry GetAnonymousScope(int id)
        {
            if (reader == null)
            {
                throw new InvalidOperationException();
            }

            lock (this) {
                if (anonymous_scopes != null)
                {
                    return((AnonymousScopeEntry)anonymous_scopes [id]);
                }

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

                return((AnonymousScopeEntry)anonymous_scopes [id]);
            }
        }
Exemplo n.º 7
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];
			}
		}
Exemplo n.º 8
0
        public AnonymousScopeEntry GetAnonymousScope(int id)
        {
            if (reader == null)
                throw new InvalidOperationException ();

            lock (this) {
                if (anonymous_scopes != null)
                    return (AnonymousScopeEntry) anonymous_scopes [id];

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

                return (AnonymousScopeEntry) anonymous_scopes [id];
            }
        }
Exemplo n.º 9
0
        public AnonymousScopeEntry GetAnonymousScope(int id)
        {
            if (this.reader == null)
            {
                throw new InvalidOperationException();
            }
            AnonymousScopeEntry result;
            if (this.anonymous_scopes != null)
            {
                AnonymousScopeEntry scope;
                this.anonymous_scopes.TryGetValue(id, out scope);
                result = scope;
            }
            else
            {
                this.anonymous_scopes = new Dictionary<int, AnonymousScopeEntry>();
                this.reader.BaseStream.Position = (long)this.ot.AnonymousScopeTableOffset;
                for (int i = 0; i < this.ot.AnonymousScopeCount; i++)
                {
                    AnonymousScopeEntry scope = new AnonymousScopeEntry(this.reader);
                    this.anonymous_scopes.Add(scope.ID, scope);
                }
                result = this.anonymous_scopes[id];
            }

            return result;
        }
Exemplo n.º 10
0
        void read_scopes()
        {
            lock (this) {
                if (anonymous_scopes != null)
                    return;

                long old_pos = reader.BaseStream.Position;
                reader.BaseStream.Position = ot.AnonymousScopeTableOffset;

                anonymous_scopes = new Hashtable ();
                for (int i = 0; i < ot.AnonymousScopeCount; i++) {
                    AnonymousScopeEntry scope = new AnonymousScopeEntry (reader);
                    anonymous_scopes.Add (scope.ID, scope);
                }

                reader.BaseStream.Position = old_pos;
            }
        }
Exemplo n.º 11
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);
     }
 }