Exemplo n.º 1
0
        private void RefreshHeapshotUIObjects()
        {
            this.hsRoots.Clear();
            this.hsAllObjects.Clear();
            using (List <HeapshotReader.ReferenceInfo> .Enumerator enumerator = this.heapshotReader.Roots.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    HeapshotReader.ReferenceInfo current = enumerator.Current;
                    this.hsRoots.Add(new HeapshotWindow.HeapshotUIObject(current.fieldInfo.name, current.referencedObject, false));
                }
            }
            SortedDictionary <string, List <HeapshotReader.ObjectInfo> > sortedDictionary = new SortedDictionary <string, List <HeapshotReader.ObjectInfo> >();

            using (List <HeapshotReader.ObjectInfo> .Enumerator enumerator = this.heapshotReader.Objects.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    HeapshotReader.ObjectInfo current = enumerator.Current;
                    if (current.type == HeapshotReader.ObjectType.Managed)
                    {
                        string name = current.typeInfo.name;
                        if (!sortedDictionary.ContainsKey(name))
                        {
                            sortedDictionary.Add(name, new List <HeapshotReader.ObjectInfo>());
                        }
                        sortedDictionary[name].Add(current);
                    }
                }
            }
            using (SortedDictionary <string, List <HeapshotReader.ObjectInfo> > .Enumerator enumerator1 = sortedDictionary.GetEnumerator())
            {
                while (enumerator1.MoveNext())
                {
                    KeyValuePair <string, List <HeapshotReader.ObjectInfo> > current1 = enumerator1.Current;
                    HeapshotReader.ObjectInfo refObject = new HeapshotReader.ObjectInfo();
                    HeapshotReader.FieldInfo  field     = new HeapshotReader.FieldInfo("(Unknown)");
                    using (List <HeapshotReader.ObjectInfo> .Enumerator enumerator2 = current1.Value.GetEnumerator())
                    {
                        while (enumerator2.MoveNext())
                        {
                            HeapshotReader.ObjectInfo current2 = enumerator2.Current;
                            refObject.references.Add(new HeapshotReader.ReferenceInfo(current2, field));
                        }
                    }
                    this.hsAllObjects.Add(new HeapshotWindow.HeapshotUIObject(current1.Key + " x " + (object)current1.Value.Count, refObject, false)
                    {
                        IsDummyObject = true
                    });
                }
            }
        }
Exemplo n.º 2
0
        private void ReadType(BinaryReader reader)
        {
            uint num = reader.ReadUInt32();

            HeapshotReader.TypeInfo typeInfo = new HeapshotReader.TypeInfo();
            typeInfo.name = reader.ReadString();
            uint key;

            while ((key = reader.ReadUInt32()) != 0u)
            {
                HeapshotReader.FieldInfo fieldInfo = new HeapshotReader.FieldInfo();
                fieldInfo.name       = reader.ReadString();
                typeInfo.fields[key] = fieldInfo;
            }
            if (this.types.ContainsKey(num))
            {
                throw new Exception(string.Format("Type info for object {0} was already loaded!!!", num));
            }
            this.types[num] = typeInfo;
            this.allTypes.Add(typeInfo);
        }
Exemplo n.º 3
0
        private void RefreshHeapshotUIObjects()
        {
            this.hsRoots.Clear();
            this.hsAllObjects.Clear();
            foreach (HeapshotReader.ReferenceInfo info in this.heapshotReader.Roots)
            {
                string name = info.fieldInfo.name;
                this.hsRoots.Add(new HeapshotUIObject(name, info.referencedObject, false));
            }
            SortedDictionary <string, List <HeapshotReader.ObjectInfo> > dictionary = new SortedDictionary <string, List <HeapshotReader.ObjectInfo> >();

            foreach (HeapshotReader.ObjectInfo info2 in this.heapshotReader.Objects)
            {
                if (info2.type == HeapshotReader.ObjectType.Managed)
                {
                    string key = info2.typeInfo.name;
                    if (!dictionary.ContainsKey(key))
                    {
                        dictionary.Add(key, new List <HeapshotReader.ObjectInfo>());
                    }
                    dictionary[key].Add(info2);
                }
            }
            foreach (KeyValuePair <string, List <HeapshotReader.ObjectInfo> > pair in dictionary)
            {
                HeapshotReader.ObjectInfo refObject = new HeapshotReader.ObjectInfo();
                HeapshotReader.FieldInfo  field     = new HeapshotReader.FieldInfo("(Unknown)");
                foreach (HeapshotReader.ObjectInfo info5 in pair.Value)
                {
                    refObject.references.Add(new HeapshotReader.ReferenceInfo(info5, field));
                }
                HeapshotUIObject item = new HeapshotUIObject(pair.Key + " x " + pair.Value.Count, refObject, false)
                {
                    IsDummyObject = true
                };
                this.hsAllObjects.Add(item);
            }
        }
Exemplo n.º 4
0
        private void RefreshHeapshotUIObjects()
        {
            this.hsRoots.Clear();
            this.hsAllObjects.Clear();
            foreach (HeapshotReader.ReferenceInfo current in this.heapshotReader.Roots)
            {
                string name = current.fieldInfo.name;
                this.hsRoots.Add(new HeapshotWindow.HeapshotUIObject(name, current.referencedObject, false));
            }
            SortedDictionary <string, List <HeapshotReader.ObjectInfo> > sortedDictionary = new SortedDictionary <string, List <HeapshotReader.ObjectInfo> >();

            foreach (HeapshotReader.ObjectInfo current2 in this.heapshotReader.Objects)
            {
                if (current2.type == HeapshotReader.ObjectType.Managed)
                {
                    string name2 = current2.typeInfo.name;
                    if (!sortedDictionary.ContainsKey(name2))
                    {
                        sortedDictionary.Add(name2, new List <HeapshotReader.ObjectInfo>());
                    }
                    sortedDictionary[name2].Add(current2);
                }
            }
            foreach (KeyValuePair <string, List <HeapshotReader.ObjectInfo> > current3 in sortedDictionary)
            {
                HeapshotReader.ObjectInfo objectInfo = new HeapshotReader.ObjectInfo();
                HeapshotReader.FieldInfo  field      = new HeapshotReader.FieldInfo("(Unknown)");
                foreach (HeapshotReader.ObjectInfo current4 in current3.Value)
                {
                    objectInfo.references.Add(new HeapshotReader.ReferenceInfo(current4, field));
                }
                HeapshotWindow.HeapshotUIObject heapshotUIObject = new HeapshotWindow.HeapshotUIObject(current3.Key + " x " + current3.Value.Count, objectInfo, false);
                heapshotUIObject.IsDummyObject = true;
                this.hsAllObjects.Add(heapshotUIObject);
            }
        }
Exemplo n.º 5
0
 public ReferenceInfo(HeapshotReader.ObjectInfo refObj, HeapshotReader.FieldInfo field)
 {
     this.referencedObject = refObj;
     this.fieldInfo        = field;
 }
Exemplo n.º 6
0
 private void RefreshHeapshotUIObjects()
 {
     this.hsRoots.Clear();
     this.hsAllObjects.Clear();
     foreach (HeapshotReader.ReferenceInfo info in this.heapshotReader.Roots)
     {
         string name = info.fieldInfo.name;
         this.hsRoots.Add(new HeapshotUIObject(name, info.referencedObject, false));
     }
     SortedDictionary<string, List<HeapshotReader.ObjectInfo>> dictionary = new SortedDictionary<string, List<HeapshotReader.ObjectInfo>>();
     foreach (HeapshotReader.ObjectInfo info2 in this.heapshotReader.Objects)
     {
         if (info2.type == HeapshotReader.ObjectType.Managed)
         {
             string key = info2.typeInfo.name;
             if (!dictionary.ContainsKey(key))
             {
                 dictionary.Add(key, new List<HeapshotReader.ObjectInfo>());
             }
             dictionary[key].Add(info2);
         }
     }
     foreach (KeyValuePair<string, List<HeapshotReader.ObjectInfo>> pair in dictionary)
     {
         HeapshotReader.ObjectInfo refObject = new HeapshotReader.ObjectInfo();
         HeapshotReader.FieldInfo field = new HeapshotReader.FieldInfo("(Unknown)");
         foreach (HeapshotReader.ObjectInfo info5 in pair.Value)
         {
             refObject.references.Add(new HeapshotReader.ReferenceInfo(info5, field));
         }
         HeapshotUIObject item = new HeapshotUIObject(pair.Key + " x " + pair.Value.Count, refObject, false) {
             IsDummyObject = true
         };
         this.hsAllObjects.Add(item);
     }
 }
Exemplo n.º 7
0
		private void RefreshHeapshotUIObjects()
		{
			this.hsRoots.Clear();
			this.hsAllObjects.Clear();
			foreach (HeapshotReader.ReferenceInfo current in this.heapshotReader.Roots)
			{
				string name = current.fieldInfo.name;
				this.hsRoots.Add(new HeapshotWindow.HeapshotUIObject(name, current.referencedObject, false));
			}
			SortedDictionary<string, List<HeapshotReader.ObjectInfo>> sortedDictionary = new SortedDictionary<string, List<HeapshotReader.ObjectInfo>>();
			foreach (HeapshotReader.ObjectInfo current2 in this.heapshotReader.Objects)
			{
				if (current2.type == HeapshotReader.ObjectType.Managed)
				{
					string name2 = current2.typeInfo.name;
					if (!sortedDictionary.ContainsKey(name2))
					{
						sortedDictionary.Add(name2, new List<HeapshotReader.ObjectInfo>());
					}
					sortedDictionary[name2].Add(current2);
				}
			}
			foreach (KeyValuePair<string, List<HeapshotReader.ObjectInfo>> current3 in sortedDictionary)
			{
				HeapshotReader.ObjectInfo objectInfo = new HeapshotReader.ObjectInfo();
				HeapshotReader.FieldInfo field = new HeapshotReader.FieldInfo("(Unknown)");
				foreach (HeapshotReader.ObjectInfo current4 in current3.Value)
				{
					objectInfo.references.Add(new HeapshotReader.ReferenceInfo(current4, field));
				}
				HeapshotWindow.HeapshotUIObject heapshotUIObject = new HeapshotWindow.HeapshotUIObject(current3.Key + " x " + current3.Value.Count, objectInfo, false);
				heapshotUIObject.IsDummyObject = true;
				this.hsAllObjects.Add(heapshotUIObject);
			}
		}
Exemplo n.º 8
0
			public ReferenceInfo(HeapshotReader.ObjectInfo refObj, HeapshotReader.FieldInfo field)
			{
				this.referencedObject = refObj;
				this.fieldInfo = field;
			}
Exemplo n.º 9
0
		private void ReadType(BinaryReader reader)
		{
			uint num = reader.ReadUInt32();
			HeapshotReader.TypeInfo typeInfo = new HeapshotReader.TypeInfo();
			typeInfo.name = reader.ReadString();
			uint key;
			while ((key = reader.ReadUInt32()) != 0u)
			{
				HeapshotReader.FieldInfo fieldInfo = new HeapshotReader.FieldInfo();
				fieldInfo.name = reader.ReadString();
				typeInfo.fields[key] = fieldInfo;
			}
			if (this.types.ContainsKey(num))
			{
				throw new Exception(string.Format("Type info for object {0} was already loaded!!!", num));
			}
			this.types[num] = typeInfo;
			this.allTypes.Add(typeInfo);
		}
Exemplo n.º 10
0
 private void RefreshHeapshotUIObjects()
 {
   this.hsRoots.Clear();
   this.hsAllObjects.Clear();
   using (List<HeapshotReader.ReferenceInfo>.Enumerator enumerator = this.heapshotReader.Roots.GetEnumerator())
   {
     while (enumerator.MoveNext())
     {
       HeapshotReader.ReferenceInfo current = enumerator.Current;
       this.hsRoots.Add(new HeapshotWindow.HeapshotUIObject(current.fieldInfo.name, current.referencedObject, false));
     }
   }
   SortedDictionary<string, List<HeapshotReader.ObjectInfo>> sortedDictionary = new SortedDictionary<string, List<HeapshotReader.ObjectInfo>>();
   using (List<HeapshotReader.ObjectInfo>.Enumerator enumerator = this.heapshotReader.Objects.GetEnumerator())
   {
     while (enumerator.MoveNext())
     {
       HeapshotReader.ObjectInfo current = enumerator.Current;
       if (current.type == HeapshotReader.ObjectType.Managed)
       {
         string name = current.typeInfo.name;
         if (!sortedDictionary.ContainsKey(name))
           sortedDictionary.Add(name, new List<HeapshotReader.ObjectInfo>());
         sortedDictionary[name].Add(current);
       }
     }
   }
   using (SortedDictionary<string, List<HeapshotReader.ObjectInfo>>.Enumerator enumerator1 = sortedDictionary.GetEnumerator())
   {
     while (enumerator1.MoveNext())
     {
       KeyValuePair<string, List<HeapshotReader.ObjectInfo>> current1 = enumerator1.Current;
       HeapshotReader.ObjectInfo refObject = new HeapshotReader.ObjectInfo();
       HeapshotReader.FieldInfo field = new HeapshotReader.FieldInfo("(Unknown)");
       using (List<HeapshotReader.ObjectInfo>.Enumerator enumerator2 = current1.Value.GetEnumerator())
       {
         while (enumerator2.MoveNext())
         {
           HeapshotReader.ObjectInfo current2 = enumerator2.Current;
           refObject.references.Add(new HeapshotReader.ReferenceInfo(current2, field));
         }
       }
       this.hsAllObjects.Add(new HeapshotWindow.HeapshotUIObject(current1.Key + " x " + (object) current1.Value.Count, refObject, false)
       {
         IsDummyObject = true
       });
     }
   }
 }