我经常在windbg中调试.netframeworkv2.0/v 4.0代码。在v 2.0中,主clr dll称为“mscorwks.dll”,在v 4.0中称为“clr.dll”。很多人都知道,要在v 2.0中加载sos,我们必须输入“.loadby sos mscorwks”,在v 4.0中输入“.loadby sos clr”。这对我来说是一种痛苦。提出了一个基于clr版本自动加载sos的脚本
!for_each_module .if(($sicmp( “@#ModuleName” , “mscorwks”) = 0) ) {.loadby sos mscorwks} .elsif ($sicmp( “@#ModuleName” , “clr”) = 0) {.loadby sos clr}
您可以通过在clr中基于.NET Framework版本设置一个断点来提高它的性能
!for_each_module .if(($sicmp( “@#ModuleName” , “mscorwks”) = 0) ) {bp mscorwks!WKS::GCHeap::SuspendEE “.if (dwo(mscorwks!WKS::GCHeap::GcCondemnedGeneration)==2) {.echo start of gen 2}“} .elsif ($sicmp( “@#ModuleName” , “clr”) = 0) {bp clr!WKS::GCHeap::SuspendEE “.if (dwo(clr!WKS::GCHeap::GcCondemnedGeneration)==2) {.echo start of gen 2}“}
原文地址:https://www.cnblogs.com/yilang/p/12426789.html
时间: 2024-11-13 03:48:35