private void CreateTables(ManagedData crawledData) { List <APITable> tables = new List <APITable>(); CreateTable_RootReferences(tables); CreateTable_NativeAllocations(tables); CreateTable_NativeAllocationSites(tables); CreateTable_NativeCallstackSymbols(tables); CreateTable_NativeMemoryLabels(tables); CreateTable_NativeMemoryRegions(tables); CreateTable_NativeObjects(tables); CreateTable_NativeTypes(tables); CreateNativeTable_NativeTypeBase(tables); CreateTable_NativeConnections(tables); CreateTable_TypeDescriptions(tables); m_Tables = tables.ToArray(); List <Table> extraTable = new List <Table>(); extraTable.Add(new ObjectAllManagedTable(this, formatter, m_Snapshot, crawledData, ObjectTable.ObjectMetaType.Managed)); extraTable.Add(new ObjectAllNativeTable(this, formatter, m_Snapshot, crawledData, ObjectTable.ObjectMetaType.Native)); extraTable.Add(new ObjectAllTable(this, formatter, m_Snapshot, crawledData, ObjectTable.ObjectMetaType.All)); m_ExtraTable = extraTable.ToArray(); foreach (var t in m_ExtraTable) { m_TablesByName.Add(t.GetName(), t); } }
public CachedSnapshot(PackedMemorySnapshot s) { packedMemorySnapshot = s; virtualMachineInformation = s.virtualMachineInformation; nativeAllocationSites = new NativeAllocationSiteEntriesCache(s.nativeAllocationSites); typeDescriptions = new TypeDescriptionEntriesCache(s.typeDescriptions); nativeTypes = new NativeTypeEntriesCache(s.nativeTypes); nativeRootReferences = new NativeRootReferenceEntriesCache(s.nativeRootReferences); nativeObjects = new NativeObjectEntriesCache(s.nativeObjects); nativeMemoryRegions = new NativeMemoryRegionEntriesCache(s.nativeMemoryRegions); nativeMemoryLabels = new NativeMemoryLabelEntriesCache(s.nativeMemoryLabels); nativeCallstackSymbols = new NativeCallstackSymbolEntriesCache(s.nativeCallstackSymbols); nativeAllocations = new NativeAllocationEntriesCache(s.nativeAllocations); managedStacks = new ManagedMemorySectionEntriesCache(s.managedStacks); managedHeapSections = new ManagedMemorySectionEntriesCache(s.managedHeapSections); gcHandles = new GCHandleEntriesCache(s.gcHandles); fieldDescriptions = new FieldDescriptionEntriesCache(s.fieldDescriptions); connections = new ConnectionEntriesCache(s.connections); SortedNativeRegionsEntries = new SortedNativeMemoryRegionEntriesCache(this); SortedManagedStacksEntries = new SortedManagedMemorySectionEntriesCache(managedStacks); SortedManagedHeapEntries = new SortedManagedMemorySectionEntriesCache(managedHeapSections); SortedManagedObjects = new SortedManagedObjectsCache(this); SortedNativeAllocations = new SortedNativeAllocationsCache(this); SortedNativeObjects = new SortedNativeObjectsCache(this); CrawledData = new ManagedData(); typeDescriptions.InitSecondaryItems(this); nativeObjects.InitSecondaryItems(); nativeObjects.InitSecondaryItems(this); }
public ObjectListTable(Database.Schema schema, SnapshotObjectDataFormatter formatter, CachedSnapshot snapshot, ManagedData crawledData, ObjectMetaType metaType) : base(schema, metaType) { Formatter = formatter; Snapshot = snapshot; CrawledData = crawledData; var col = new List <Column>(); switch (metaType) { case ObjectMetaType.Managed: col.Add(new ObjectListUnifiedIndexColumn(this)); col.Add(new ObjectListAddressColumn(this)); col.Add(new ObjectListNameColumn(this)); col.Add(new ObjectListValueColumn(this)); col.Add(new ObjectListLengthColumn(this)); col.Add(new ObjectListTypeColumn(this)); col.Add(new ObjectListNativeObjectNameLinkColumn(this)); col.Add(new ObjectListStaticColumn(this)); col.Add(new ObjectListRefCountColumn(this)); col.Add(new ObjectListOwnedSizeColumn(this)); col.Add(new ObjectListTargetSizeColumn(this)); break; case ObjectMetaType.Native: col.Add(new ObjectListUnifiedIndexColumn(this)); col.Add(new ObjectListAddressColumn(this)); col.Add(new ObjectListNativeInstanceIdColumn(this)); col.Add(new ObjectListNativeObjectNameColumn(this)); col.Add(new ObjectListTypeColumn(this)); col.Add(new ObjectListRefCountColumn(this)); col.Add(new ObjectListOwnedSizeColumn(this)); break; case ObjectMetaType.All: col.Add(new ObjectListUnifiedIndexColumn(this)); col.Add(new ObjectListAddressColumn(this)); col.Add(new ObjectListNameColumn(this)); col.Add(new ObjectListValueColumn(this)); col.Add(new ObjectListLengthColumn(this)); col.Add(new ObjectListObjectTypeColumn(this)); col.Add(new ObjectListTypeColumn(this)); col.Add(new ObjectListStaticColumn(this)); col.Add(new ObjectListNativeInstanceIdLinkColumn(this)); col.Add(new ObjectListNativeObjectNameLinkColumn(this)); col.Add(new ObjectListRefCountColumn(this)); col.Add(new ObjectListOwnedSizeColumn(this)); col.Add(new ObjectListTargetSizeColumn(this)); col.Add(new ObjectListNativeObjectSizeColumn(this)); break; } InitExpandColumn(col); }
public CachedSnapshot(PackedMemorySnapshot s) { var vmInfo = s.virtualMachineInformation; if (!VMTools.ValidateVirtualMachineInfo(vmInfo)) { throw new UnityException("Invalid VM info. Snapshot file is corrupted."); } virtualMachineInformation = vmInfo; packedMemorySnapshot = s; m_SnapshotVersion = s.version; nativeAllocationSites = new NativeAllocationSiteEntriesCache(s.nativeAllocationSites); typeDescriptions = new TypeDescriptionEntriesCache(s.typeDescriptions); nativeTypes = new NativeTypeEntriesCache(s.nativeTypes); nativeRootReferences = new NativeRootReferenceEntriesCache(s.nativeRootReferences); nativeObjects = new NativeObjectEntriesCache(s.nativeObjects); nativeMemoryRegions = new NativeMemoryRegionEntriesCache(s.nativeMemoryRegions); nativeMemoryLabels = new NativeMemoryLabelEntriesCache(s.nativeMemoryLabels); nativeCallstackSymbols = new NativeCallstackSymbolEntriesCache(s.nativeCallstackSymbols); nativeAllocations = new NativeAllocationEntriesCache(s.nativeAllocations); managedStacks = new ManagedMemorySectionEntriesCache(s.managedStacks); managedHeapSections = new ManagedMemorySectionEntriesCache(s.managedHeapSections); gcHandles = new GCHandleEntriesCache(s.gcHandles); fieldDescriptions = new FieldDescriptionEntriesCache(s.fieldDescriptions); connections = new ConnectionEntriesCache(s, HasConnectionOverhaul); SortedNativeRegionsEntries = new SortedNativeMemoryRegionEntriesCache(this); SortedManagedStacksEntries = new SortedManagedMemorySectionEntriesCache(managedStacks); SortedManagedHeapEntries = new SortedManagedMemorySectionEntriesCache(managedHeapSections); SortedManagedObjects = new SortedManagedObjectsCache(this); SortedNativeAllocations = new SortedNativeAllocationsCache(this); SortedNativeObjects = new SortedNativeObjectsCache(this); CrawledData = new ManagedData(); typeDescriptions.InitSecondaryItems(this); nativeObjects.InitSecondaryItems(); nativeObjects.InitSecondaryItems(this); }
public ObjectFieldTable(Schema schema, SnapshotDataRenderer renderer, CachedSnapshot snapshot, ManagedData crawledData, ObjectData obj, ObjectMetaType metaType) : base(schema, renderer, snapshot, crawledData, metaType) { this.obj = obj; objBase = obj.GetBase(snapshot); SetFieldsList(BuildFieldList()); InitObjectList(); }
public ObjectSingleTable(Schema schema, SnapshotDataRenderer renderer, CachedSnapshot snapshot, ManagedData crawledData, ObjectData obj, ObjectMetaType metaType) : base(schema, renderer, snapshot, crawledData, metaType) { this.obj = obj; if (!obj.dataIncludeObjectHeader) { var od = ObjectData.FromManagedPointer(snapshot, obj.hostManagedObjectPtr); objOffset = obj.managedObjectData.offset - od.managedObjectData.offset; } else { objOffset = 0; } InitObjectList(); ExpandCell(0, 0, true); }
public ObjectReferenceTable(Database.Schema schema, SnapshotObjectDataFormatter formatter, CachedSnapshot snapshot, ManagedData crawledData, ObjectData obj, ObjectMetaType metaType) : base(schema, formatter, snapshot, crawledData, metaType) { m_Object = obj; m_References = ObjectConnection.GetAllObjectConnectingTo(snapshot, obj); InitObjectList(); }
public ObjectReferenceTable(Database.Schema schema, SnapshotObjectDataFormatter formatter, CachedSnapshot snapshot, ManagedData crawledData, ObjectData obj, ObjectMetaType metaType) : base(schema, formatter, snapshot, crawledData, metaType) { m_Object = obj; m_References = ObjectConnection.GetAllObjectConnectingTo(snapshot, obj); #if DEBUG_VALIDATION int toUnifiedIndex = m_Object.GetUnifiedObjectIndex(snapshot); var toManagedIndex = snapshot.UnifiedObjectIndexToManagedObjectIndex(toUnifiedIndex); for (int k = 0; k != m_References.Length; ++k) { var oFrom = m_References[k]; switch (oFrom.dataType) { case ObjectDataType.ReferenceArray: case ObjectDataType.ReferenceObject: case ObjectDataType.Value: if (oFrom.m_Parent != null) { oFrom = oFrom.m_Parent.obj; } break; } bool connectionFound = false; switch (oFrom.dataType) { case ObjectDataType.Global: { if (snapshot.HasGlobalConnection(toManagedIndex)) { connectionFound = true; } } break; case ObjectDataType.Type: { if (snapshot.HasManagedTypeConnection(oFrom.managedTypeIndex, toManagedIndex)) { connectionFound = true; } } break; case ObjectDataType.Array: case ObjectDataType.BoxedValue: case ObjectDataType.Object: { if (snapshot.HasObjectConnection(oFrom.GetUnifiedObjectIndex(snapshot), toUnifiedIndex)) { connectionFound = true; break; } } break; case ObjectDataType.NativeObject: { if (snapshot.HasObjectConnection(oFrom.GetUnifiedObjectIndex(snapshot), toUnifiedIndex)) { connectionFound = true; break; } } break; } if (!connectionFound) { UnityEngine.Debug.LogError("Connection not found, index =" + k); } } #endif InitObjectList(); }