Exemplo n.º 1
0
        private void ReadObject(BinaryReader reader)
        {
            uint key1 = reader.ReadUInt32();
            uint key2 = reader.ReadUInt32();

            HeapshotReader.ObjectInfo objectInfo = new HeapshotReader.ObjectInfo();
            objectInfo.code = key1;
            objectInfo.size = reader.ReadUInt32();
            if (!this.types.ContainsKey(key2))
            {
                throw new Exception(string.Format("Failed to find type info {0} for object {1}!!!", (object)key2, (object)key1));
            }
            objectInfo.typeInfo = this.types[key2];
            uint num;

            while ((int)(num = reader.ReadUInt32()) != 0)
            {
                HeapshotReader.ReferenceInfo referenceInfo = new HeapshotReader.ReferenceInfo();
                referenceInfo.code = num;
                uint key3 = reader.ReadUInt32();
                referenceInfo.fieldInfo = (int)key3 != 0 ? (!objectInfo.typeInfo.fields.ContainsKey(key3) ? (HeapshotReader.FieldInfo)null : objectInfo.typeInfo.fields[key3]) : (HeapshotReader.FieldInfo)null;
                objectInfo.references.Add(referenceInfo);
            }
            if (this.objects.ContainsKey(key1))
            {
                throw new Exception(string.Format("Object {0} was already loaded?!", (object)key1));
            }
            objectInfo.type    = (int)key1 != (int)key2 ? HeapshotReader.ObjectType.Managed : HeapshotReader.ObjectType.Root;
            this.objects[key1] = objectInfo;
            this.allObjects.Add(objectInfo);
        }
Exemplo n.º 2
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.º 3
0
        public List <HeapshotReader.ObjectInfo> GetObjectsOfType(string name)
        {
            List <HeapshotReader.ObjectInfo> objectInfoList = new List <HeapshotReader.ObjectInfo>();

            using (List <HeapshotReader.ObjectInfo> .Enumerator enumerator = this.allObjects.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    HeapshotReader.ObjectInfo current = enumerator.Current;
                    if (current.typeInfo.name == name)
                    {
                        objectInfoList.Add(current);
                    }
                }
            }
            return(objectInfoList);
        }
Exemplo n.º 4
0
        private void ReadObject(BinaryReader reader)
        {
            uint num  = reader.ReadUInt32();
            uint num2 = reader.ReadUInt32();

            HeapshotReader.ObjectInfo objectInfo = new HeapshotReader.ObjectInfo();
            objectInfo.code = num;
            objectInfo.size = reader.ReadUInt32();
            if (!this.types.ContainsKey(num2))
            {
                throw new Exception(string.Format("Failed to find type info {0} for object {1}!!!", num2, num));
            }
            objectInfo.typeInfo = this.types[num2];
            uint code;

            while ((code = reader.ReadUInt32()) != 0u)
            {
                HeapshotReader.ReferenceInfo referenceInfo = new HeapshotReader.ReferenceInfo();
                referenceInfo.code = code;
                uint num3 = reader.ReadUInt32();
                if (num3 == 0u)
                {
                    referenceInfo.fieldInfo = null;
                }
                else
                {
                    if (objectInfo.typeInfo.fields.ContainsKey(num3))
                    {
                        referenceInfo.fieldInfo = objectInfo.typeInfo.fields[num3];
                    }
                    else
                    {
                        referenceInfo.fieldInfo = null;
                    }
                }
                objectInfo.references.Add(referenceInfo);
            }
            if (this.objects.ContainsKey(num))
            {
                throw new Exception(string.Format("Object {0} was already loaded?!", num));
            }
            objectInfo.type   = ((num != num2) ? HeapshotReader.ObjectType.Managed : HeapshotReader.ObjectType.Root);
            this.objects[num] = objectInfo;
            this.allObjects.Add(objectInfo);
        }
Exemplo n.º 5
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.º 6
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.º 7
0
 public ReferenceInfo(HeapshotReader.ObjectInfo refObj, HeapshotReader.FieldInfo field)
 {
     this.referencedObject = refObj;
     this.fieldInfo        = field;
 }
Exemplo n.º 8
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.º 9
0
 public HeapshotUIObject(string name, HeapshotReader.ObjectInfo refObject, bool inverseReference)
 {
     this.name             = name;
     this.obj              = refObject;
     this.inverseReference = inverseReference;
 }
Exemplo n.º 10
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.º 11
0
			public HeapshotUIObject(string name, HeapshotReader.ObjectInfo refObject, bool inverseReference)
			{
				this.name = name;
				this.obj = refObject;
				this.inverseReference = inverseReference;
			}
Exemplo n.º 12
0
			public ReferenceInfo(HeapshotReader.ObjectInfo refObj, HeapshotReader.FieldInfo field)
			{
				this.referencedObject = refObj;
				this.fieldInfo = field;
			}
Exemplo n.º 13
0
		private void ReadObject(BinaryReader reader)
		{
			uint num = reader.ReadUInt32();
			uint num2 = reader.ReadUInt32();
			HeapshotReader.ObjectInfo objectInfo = new HeapshotReader.ObjectInfo();
			objectInfo.code = num;
			objectInfo.size = reader.ReadUInt32();
			if (!this.types.ContainsKey(num2))
			{
				throw new Exception(string.Format("Failed to find type info {0} for object {1}!!!", num2, num));
			}
			objectInfo.typeInfo = this.types[num2];
			uint code;
			while ((code = reader.ReadUInt32()) != 0u)
			{
				HeapshotReader.ReferenceInfo referenceInfo = new HeapshotReader.ReferenceInfo();
				referenceInfo.code = code;
				uint num3 = reader.ReadUInt32();
				if (num3 == 0u)
				{
					referenceInfo.fieldInfo = null;
				}
				else
				{
					if (objectInfo.typeInfo.fields.ContainsKey(num3))
					{
						referenceInfo.fieldInfo = objectInfo.typeInfo.fields[num3];
					}
					else
					{
						referenceInfo.fieldInfo = null;
					}
				}
				objectInfo.references.Add(referenceInfo);
			}
			if (this.objects.ContainsKey(num))
			{
				throw new Exception(string.Format("Object {0} was already loaded?!", num));
			}
			objectInfo.type = ((num != num2) ? HeapshotReader.ObjectType.Managed : HeapshotReader.ObjectType.Root);
			this.objects[num] = objectInfo;
			this.allObjects.Add(objectInfo);
		}
Exemplo n.º 14
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.º 15
0
 private void ReadObject(BinaryReader reader)
 {
   uint key1 = reader.ReadUInt32();
   uint key2 = reader.ReadUInt32();
   HeapshotReader.ObjectInfo objectInfo = new HeapshotReader.ObjectInfo();
   objectInfo.code = key1;
   objectInfo.size = reader.ReadUInt32();
   if (!this.types.ContainsKey(key2))
     throw new Exception(string.Format("Failed to find type info {0} for object {1}!!!", (object) key2, (object) key1));
   objectInfo.typeInfo = this.types[key2];
   uint num;
   while ((int) (num = reader.ReadUInt32()) != 0)
   {
     HeapshotReader.ReferenceInfo referenceInfo = new HeapshotReader.ReferenceInfo();
     referenceInfo.code = num;
     uint key3 = reader.ReadUInt32();
     referenceInfo.fieldInfo = (int) key3 != 0 ? (!objectInfo.typeInfo.fields.ContainsKey(key3) ? (HeapshotReader.FieldInfo) null : objectInfo.typeInfo.fields[key3]) : (HeapshotReader.FieldInfo) null;
     objectInfo.references.Add(referenceInfo);
   }
   if (this.objects.ContainsKey(key1))
     throw new Exception(string.Format("Object {0} was already loaded?!", (object) key1));
   objectInfo.type = (int) key1 != (int) key2 ? HeapshotReader.ObjectType.Managed : HeapshotReader.ObjectType.Root;
   this.objects[key1] = objectInfo;
   this.allObjects.Add(objectInfo);
 }