Ejemplo n.º 1
0
        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.");
        }
Ejemplo n.º 2
0
        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);
        }