public bool Run(SptWrapper wrapper, string args) { ulong addr = wrapper.GetExpression(args); ClrMethodDescData mdd; uint n = 0; wrapper.Dac.GetMethodDescData(addr, 0, out mdd, 0, null, out n); ClrMethodTableData mtd = wrapper.Dac.GetMethodTableData(mdd.MethodTable); string methodName = wrapper.GetMethodDescName(addr); var tr = wrapper.CreateTableWriter(); tr.AddColumn(17, true); tr.AddColumn(-1); tr.TextColumn("Method Name:").TextColumn(methodName.ToString()).NewRow() .TextColumn("Class:").PointerColumn(mtd.EEClass).NewRow() .TextColumn("MethodTable:").PointerColumn(mdd.MethodTable).NewRow() .TextColumn("mdToken:").Column("0x{0:x8}", mdd.mdToken).NewRow() .TextColumn("Module:").PointerColumn(mdd.Module).NewRow() .TextColumn("IsJitted:").TextColumn(mdd.IsJitted != 0 ? "yes" : "no").NewRow() .TextColumn("CodeAddr:").PointerColumn(mdd.CodeAddr).NewRow() .TextColumn("Transparency:").TextColumn(GetTransparency(wrapper, addr)).NewRow(); return(true); }
public bool Run(SptWrapper wrapper, string args) { ulong addr = wrapper.GetExpression(args); ClrMethodDescData mdd; uint n = 0; wrapper.Dac.GetMethodDescData(addr, 0, out mdd, 0, null, out n); ClrMethodTableData mtd = wrapper.Dac.GetMethodTableData(mdd.MethodTable); string methodName = wrapper.GetMethodDescName(addr); var tr = wrapper.CreateTableWriter(); tr.AddColumn(17, true); tr.AddColumn(-1); tr.TextColumn("Method Name:").TextColumn(methodName.ToString()).NewRow() .TextColumn("Class:").PointerColumn(mtd.EEClass).NewRow() .TextColumn("MethodTable:").PointerColumn(mdd.MethodTable).NewRow() .TextColumn("mdToken:").Column("0x{0:x8}", mdd.mdToken).NewRow() .TextColumn("Module:").PointerColumn(mdd.Module).NewRow() .TextColumn("IsJitted:").TextColumn(mdd.IsJitted != 0 ? "yes" : "no").NewRow() .TextColumn("CodeAddr:").PointerColumn(mdd.CodeAddr).NewRow() .TextColumn("Transparency:").TextColumn(GetTransparency(wrapper, addr)).NewRow(); return true; }
private string GetTransparency(SptWrapper wrapper, ulong mdAddr) { var mttd = wrapper.Dac.GetMethodDescTransparencyData(mdAddr); string transparency; if (mttd.IsCalculated == 0) { transparency = "Not calculated"; } else if (mttd.IsOpaque == 0) { transparency = "Transparent"; } else if (mttd.IsSafe != 0) { transparency = "Critical"; } else { transparency = "Safe Critical"; } return(transparency); }
public static void EnsureInit(SptWrapper wrapper) { if (s_usefulMethodTables == null) { InitMethodTables(wrapper); } }
public static SptWrapper CreateFromDump(string dumpFile) { var bootstrapper = SptWrapper.GetBootstrapper(); bootstrapper.ConfigureSymbolPath(@"q:\symcache"); bootstrapper.ConfigureImagePath(@"q:\symcache"); return(new SptWrapper(bootstrapper.InitFromDump(dumpFile))); }
private static void InitMethodTables(SptWrapper wrapper) { s_usefulMethodTables = new Dictionary <ulong, Type>(); s_usefulMethodTablesInverse = new Dictionary <Type, ulong>(); foreach (var type in s_primitives) { var typeMt = wrapper.Proc.FindTypeByName("mscorlib.dll", type.FullName); s_usefulMethodTables.Add(typeMt, type); s_usefulMethodTablesInverse.Add(type, typeMt); } }
public bool Run(SptWrapper wrapper, string args) { string[] argSplit = args.Split(' '); string moduleName = argSplit[0]; string typeName = argSplit[1]; if (argSplit.Length != 0) { wrapper.DbgOutput("Usage: !name2ee <module> <type>"); } return(true); }
public bool Run(SptWrapper wrapper, string args) { string[] argSplit = args.Split(' '); string moduleName = argSplit[0]; string typeName = argSplit[1]; if (argSplit.Length != 0) { wrapper.DbgOutput("Usage: !name2ee <module> <type>"); } return true; }
public bool Run(SptWrapper wrapper, string args) { var threads = wrapper.GetThreads(); TableWriter tw = wrapper.CreateTableWriter(); tw .AddColumn(4) .AddColumn(4) .AddColumn(4) .AddPointerColumn() .AddColumn(8) .AddColumn(11, true) .AddPointerColumn() .AddPointerColumn() .AddPointerColumn() .AddColumn(5, true) .AddColumn(3) .AddColumn(-1, true); tw.TextColumn("").TextColumn("ID").TextColumn("OSID").TextColumn("ThreadOb").TextColumn("State") .TextColumn("GC Mode").TextColumn("GC Alloc").TextColumn("Context").TextColumn("Domain ").TextColumn("Lock").TextColumn("Apt") .TextColumn("Exception") .NewRow(); foreach (var t in threads) { tw .HexColumn(0) .HexColumn(t.CorThreadId) .HexColumn(t.osThreadId) .PointerColumn(t.ThreadAddress) .HexColumn(t.State) .TextColumn(t.PreemptiveGCDisabled == 0 ? "Preemptive" : "Cooperative") .PointerColumn(t.GCAllocContext) .PointerColumn(t.GCAllocContextLimit) .PointerColumn(t.domain) .Column("{0}", t.LockCount) .TextColumn("MTA") .TextColumn("???"); tw.NewRow(); } return(true); }
public bool Run(SptWrapper wrapper, string args) { var threads = wrapper.GetThreads(); TableWriter tw = wrapper.CreateTableWriter(); tw .AddColumn(4) .AddColumn(4) .AddColumn(4) .AddPointerColumn() .AddColumn(8) .AddColumn(11, true) .AddPointerColumn() .AddPointerColumn() .AddPointerColumn() .AddColumn(5, true) .AddColumn(3) .AddColumn(-1, true); tw.TextColumn("").TextColumn("ID").TextColumn("OSID").TextColumn("ThreadOb").TextColumn("State") .TextColumn("GC Mode").TextColumn("GC Alloc").TextColumn("Context").TextColumn("Domain ").TextColumn("Lock").TextColumn("Apt") .TextColumn("Exception") .NewRow(); foreach (var t in threads) { tw .HexColumn(0) .HexColumn(t.CorThreadId) .HexColumn(t.osThreadId) .PointerColumn(t.ThreadAddress) .HexColumn(t.State) .TextColumn(t.PreemptiveGCDisabled == 0 ? "Preemptive" : "Cooperative") .PointerColumn(t.GCAllocContext) .PointerColumn(t.GCAllocContextLimit) .PointerColumn(t.domain) .Column("{0}", t.LockCount) .TextColumn("MTA") .TextColumn("???"); tw.NewRow(); } return true; }
private static bool RunMethod <T>(SptWrapper wrapper, string args) where T : IPluginMethod, new() { var plugin = new T(); using (wrapper) { try { return(plugin.Run(wrapper, args)); } catch (Exception ex) { wrapper.DbgOutput(ex.ToString()); return(false); } } }
private string GetTransparency(SptWrapper wrapper, ulong mdAddr) { var mttd = wrapper.Dac.GetMethodDescTransparencyData(mdAddr); string transparency; if (mttd.IsCalculated == 0) { transparency = "Not calculated"; } else if (mttd.IsOpaque == 0) { transparency = "Transparent"; } else if (mttd.IsSafe != 0) { transparency = "Critical"; } else { transparency = "Safe Critical"; } return transparency; }
public void Init() { _ext = Util.CreateFromDump(@"Q:\spt\Dumps\x86\sql.dmp"); }
public void Init() { _proc = Util.CreateFromDump(@"Q:\spt\Dumps\x86\iis_request.dmp"); }
private static void InitMethodTables(SptWrapper wrapper) { s_usefulMethodTables = new Dictionary<ulong, Type>(); s_usefulMethodTablesInverse = new Dictionary<Type, ulong>(); foreach (var type in s_primitives) { var typeMt = wrapper.Proc.FindTypeByName("mscorlib.dll", type.FullName); s_usefulMethodTables.Add(typeMt, type); s_usefulMethodTablesInverse.Add(type, typeMt); } }
public static bool threads(SptWrapper wrapper, string args) { return(RunMethod <Threads>(wrapper, args)); }
public static bool dumpmd(SptWrapper wrapper, string args) { return(RunMethod <DumpMD>(wrapper, args)); }
public static bool name2ee(SptWrapper wrapper, string args) { return(RunMethod <Name2EE>(wrapper, args)); }