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); }
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 string GetReadableCallstack(NativeCallstackSymbolEntriesCache symbols, long idx) { string readableStackTrace = ""; ulong[] callstackSymbols = this.callstackSymbols[idx]; for (int i = 0; i < callstackSymbols.Length; ++i) { int symbolIdx = symbols.symbol.FindIndex(x => x == callstackSymbols[i]); if (symbolIdx < 0) { readableStackTrace += "<unknown>\n"; } else { readableStackTrace += symbols.readableStackTrace[symbolIdx]; } } return(readableStackTrace); }
public string GetReadableCallstackForId(NativeCallstackSymbolEntriesCache symbols, long id) { int entryIdx = this.id.FindIndex(x => x == id); return(entryIdx < 0 ? "" : GetReadableCallstack(symbols, entryIdx)); }