Example #1
0
        public static string Create()
        {
            var f = CreateName();

            try
            {
                MemoryDump.Create(f);
                Cli.WriteCriticalErrorMessage($"Created memory dump '{f}'.");

                return(f);
            }
            catch
            {
                Cli.WriteCriticalErrorMessage($"Failed creating memory dump '{f}'.");

                return(null);
            }
        }
Example #2
0
        public void CreateMemoryDump(ProcessDumpType processDumpType)
        {
            var appInfo = ParagonDesktop.GetAppInfo(Application.Metadata.InstanceId);

            MemoryDump.CreateMemoryDump(appInfo, processDumpType);
        }
Example #3
0
 protected abstract Task RunAsyncCoreAsync(IConsole console, string[] args, AnalysisSession session, MemoryDump dump);
Example #4
0
        protected override Task RunAsyncCoreAsync(IConsole console, string[] args, AnalysisSession session, MemoryDump dump)
        {
            var stats = dump.ComputeHeapStatistics().OrderBy(s => s.TotalSize);

            console.WriteLine("              MT    Count    TotalSize Class Name");
            foreach (var heapStats in stats)
            {
                console.WriteLine($"{heapStats.Type.MethodTable:X16} {heapStats.Count.ToString().PadLeft(8)} {heapStats.TotalSize.ToString().PadLeft(12)} {heapStats.Type.Name}");
            }

            return(Task.CompletedTask);
        }
Example #5
0
 protected override async Task RunAsyncCoreAsync(IConsole console, string[] args, AnalysisSession session, MemoryDump dump)
 {
     foreach (var frame in dump.ActiveThread.EnumerateStackTrace())
     {
         var methodInfo = frame.Method == null ? "<Unknown Method>" : GenerateMethodInfo(frame.Method);
         await console.Out.WriteLineAsync($"{frame.StackPointer:x16} {frame.InstructionPointer:x16} {methodInfo}");
     }
 }
Example #6
0
 protected override async Task RunAsyncCoreAsync(IConsole console, string[] args, AnalysisSession session, MemoryDump dump)
 {
     foreach (var thread in dump.Runtime.Threads)
     {
         var isActive = dump.ActiveThreadId == thread.ManagedThreadId ? "." : " ";
         await console.Out.WriteLineAsync($"{isActive}{thread.ManagedThreadId.ToString().PadLeft(2)} Id: {Utils.FormatAddress(thread.OSThreadId)} Teb: {Utils.FormatAddress(thread.Teb)}");
     }
 }