public CausalityContext(HeapContext heapContext) { Registry = TypesRegistry.Create(heapContext); Heap = heapContext; _threadsById = heapContext.DefaultHeap.Runtime.Threads.ToDictionary(t => t.ManagedThreadId, t => t); foreach (var(instance, kind) in Registry.EnumerateRegistry()) { GetOrCreate(instance, kind); } Console.WriteLine("Successfully loaded clr instances."); }
public static CausalityContext LoadCausalityContextFromDump(string dumpPath) { var heapContext = new HeapContext(() => { var target = DataTarget.LoadCrashDump(dumpPath); var dacLocation = target.ClrVersions[0]; var runtime = dacLocation.CreateRuntime(); var heap = runtime.Heap; return(heap); }); var context = new CausalityContext(heapContext); Console.WriteLine("Linking the nodes together."); context.LinkNodes(); return(context); }