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);
        }
Example #2
0
        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);
        }