Пример #1
0
        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);
            }
        }
Пример #2
0
        public CachedSnapshot(PackedMemorySnapshot s)
        {
            packedMemorySnapshot      = s;
            m_SnapshotVersion         = s.version;
            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, 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);
        }
Пример #3
0
        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 <Database.Column>();

            switch (metaType)
            {
            case ObjectMetaType.All:
            case ObjectMetaType.Managed:
                col.Add(new ObjectListUnifiedIndexColumn(this));
                col.Add(new ObjectListNameColumn(this));
                col.Add(new ObjectListValueColumn(this));
                col.Add(new ObjectListTypeColumn(this));
                col.Add(new ObjectListObjectTypeColumn(this));
                col.Add(new ObjectListNativeObjectNameLinkColumn(this));
                col.Add(new ObjectListLengthColumn(this));
                col.Add(new ObjectListStaticColumn(this));
                col.Add(new ObjectListRefCountColumn(this));
                col.Add(new ObjectListOwnedSizeColumn(this));
                col.Add(new ObjectListTargetSizeColumn(this));
                col.Add(new ObjectListNativeObjectSizeColumn(this));
                col.Add(new ObjectListNativeInstanceIdLinkColumn(this));
                col.Add(new ObjectListAddressColumn(this));
                col.Add(new ObjectListUniqueStringColumn(this));
                break;

            case ObjectMetaType.Native:
                col.Add(new ObjectListUnifiedIndexColumn(this));
                col.Add(new ObjectListNameColumn(this));
                col.Add(new ObjectListValueColumn(this));
                col.Add(new ObjectListTypeColumn(this));
                col.Add(new ObjectListNativeObjectNameColumn(this));
                col.Add(new ObjectListObjectTypeColumn(this));
                col.Add(new ObjectListRefCountColumn(this));
                col.Add(new ObjectListOwnedSizeColumn(this));
                col.Add(new ObjectListTargetSizeColumn(this));
                col.Add(new ObjectListNativeInstanceIdColumn(this));
                col.Add(new ObjectListAddressColumn(this));
                col.Add(new ObjectListUniqueStringColumn(this));
                break;
            }

            InitExpandColumn(col);
        }
        public CachedSnapshot(QueriedMemorySnapshot 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(gcHandles.Count, connections.Count);

            typeDescriptions.InitSecondaryItems(this);
            nativeObjects.InitSecondaryItems();
            nativeObjects.InitSecondaryItems(this);
        }
 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 ObjectFieldTable(Schema schema, SnapshotObjectDataFormatter formatter, CachedSnapshot snapshot, ManagedData crawledData, ObjectData obj, ObjectMetaType metaType)
            : base(schema, formatter, snapshot, crawledData, metaType)
        {
            this.obj = obj;
            objBase  = obj.GetBase(snapshot);

            SetFieldsList(BuildFieldList());
            InitObjectList();
        }
 public ObjectSingleTable(Schema schema, SnapshotObjectDataFormatter formatter, CachedSnapshot snapshot, ManagedData crawledData, ObjectData obj, ObjectMetaType metaType)
     : base(schema, formatter, 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);
 }