Beispiel #1
0
 public void PrintStackTrace(SDThread thread)
 {
     context.WriteInfo("Thread CLR ID: {0}, OS ID: {1:X}, State: {2}, IsThreadPoolThread: {3}, {4}", thread.EngineId, thread.OsId, thread.State, thread.IsThreadPoolThread, TagAnalyzer.TagsAsString("Tags: ", thread.Tags));
     foreach (SDCombinedStackFrame frame in thread.StackTrace)
     {
         if (frame.Type == StackFrameType.Special)
         {
             context.WriteLine("{0,-10} {1,-20:x16} {2}", "Special", frame.InstructionPointer, "[" + frame.MethodName + "]");
         }
         else
         {
             context.WriteLine("{0,-10} {1,-20:x16} {2}!{3}+0x{4:x}",
                               frame.Type,
                               frame.InstructionPointer,
                               frame.ModuleName,
                               frame.MethodName,
                               frame.OffsetInMethod);
             Console.ResetColor();
         }
     }
     context.WriteInfo("-- end call stack (thread {0}) --\n", thread.OsId);
 }
Beispiel #2
0
 /// <summary>
 /// Prints out a list of loaded modules in dump, managed libraries and also native modules
 /// </summary>
 /// <param name="target"></param>
 /// <param name="runtime"></param>
 public void PrintModuleList()
 {
     context.WriteLine("\n--- Module list ---");
     context.WriteLine("{0,-20:x16} {1,-10} {2,-20} {3} {4}", "Start", "Size/bytes", "Version", "Filename", "Tags");
     foreach (var module in systemInfo.Modules)
     {
         context.WriteLine("{0,-20:x16} {1,-10:x} {2,-20} {3} {4}",
                           module.ImageBase, module.FileSize, module.Version, module.FileName, TagAnalyzer.TagsAsString(string.Empty, module.Tags));
     }
 }