Friday, November 15, 2013

调试.NET程序 需要在Windbg中加载调试扩展项sos.dll Silverlight的运行时 runtime 是 CoreCLR 因此必须加载CoreCLR对应的sos.dll 不能使用.NE


调试.NET程序 需要在Windbg中加载调试扩展项sos.dll Silverlight的运行时 runtime 是 CoreCLR 因此必须加载CoreCLR对应的sos.dll 不能使用.NET Framework自带的sos.dll 获得正确sos.dll的方法是安装Silverlight Tools for Visual Studio 3.0 , 4.0 如果安装了正确的sos.dll starfish ornaments 在Windbg中可用如下命令将其加载
0:023> !threads ThreadCount:      9 UnstartedThread:  0 BackgroundThread: 7 PendingThread:    0 DeadThread:       2 Hosted Runtime:   yes                                    PreEmptive   GC Alloc                Lock        ID  OSID ThreadOBJ    State GC           Context       Domain   Count APT Exception    4     1   608 0a7098b8   2000220 Enabled  1bf9090c:1bf915dc 109e7fb8     1 STA   33    2  14e0 0a67fc78      b220 Enabled  00000000:00000000 0a567760     0 MTA (Finalizer)   34    3   504 0a680b68      1220 Enabled  00000000:00000000 0a567760     0 Ukn   35    4   46c 0e8b7798   1000220 Enabled  00000000:00000000 0a567760     0 Ukn (Threadpool Worker)   39    5  2350 0a41bf60   3001220 Enabled  1bf5fe18:1bf615dc 109e7fb8     1 Ukn (Threadpool Worker) XXXX    a       0a41c970   1011820 Enabled  00000000:00000000 0a567760     0 Ukn (Threadpool Worker) XXXX    9       0a41a638   starfish ornaments 1011820 Enabled  00000000:00000000 0a567760     0 Ukn (Threadpool Worker)   47    6  1618 0a41ce78   3001220 Enabled  1bf91700:1bf935dc 109e7fb8     0 Ukn (Threadpool Worker)   42    8  2754 0a41c468   3001220 Enabled  1bf93710:1bf955dc 109e7fb8     0 Ukn (Threadpool Worker)
0:023> ~4s eax=0000539e ebx=0244c8b8 ecx=0c4a19f4 edx=00000005 esi=00000001 starfish ornaments edi=00000000 eip=776464f4 esp=0244c868 ebp=0244c904 iopl=0         nv up ei pl zr na pe nc cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00200246 ntdll!KiFastSystemCallRet: 776464f4 c3              ret
0:004> starfish ornaments !CLRStack OS Thread Id: 0x608 (4) Child SP IP       Call Site 0244cac4 776464f4 [GCFrame: 0244cac4] 0244cbdc 776464f4 [HelperMethodFrame_1OBJ: 0244cbdc] starfish ornaments System.Threading.Monitor.Enter (System.Object) 0244cc24 024b117f MyApp.Common.Logger.Log (MyApp.GeneralServiceReference.Level, System.String,                   MyApp.GeneralServiceReference.ClientLoggingAttributes) 0244cc84 024b0d82 MyApp.Common.UsersUsageTracer.Log(MyApp.Common.UsageCategoryType,                   MyApp.Common.Event, MyApp.Common.TraceLevel, MyApp.Common.UsageParametes[]) 0244cd18 067ddc3b MyApp.BookInfo.BookInfoPresenter.set_Book(MyApp.BookServiceReference.BookInfo) ...
0:004> starfish ornaments !SyncBlk Index SyncBlock MonitorHeld Recursion Owning Thread Info  SyncBlock ... 1364 1ae8c1a4            3         1 0a41bf60 2350   39   starfish ornaments 0c4a19f4 ...
0:004> ~~[2350]s eax=00000001 starfish ornaments ebx=15c4eb00 ecx=00000001 edx=00000000 esi=00000001 edi=00000000 eip=776464f4 esp=15c4eab0 ebp=15c4eb4c iopl=0         nv up ei pl nz na po nc cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000202 ntdll!KiFastSystemCallRet: 776464f4 c3              ret
0:039> !CLRStack Child SP IP       Call Site 15c4ed10 776464f4 [HelperMethodFrame_1OBJ: 15c4ed10] System.Threading.WaitHandle.WaitOneNative                   (System.Runtime.InteropServices.SafeHandle, UInt32, Bo

No comments:

Post a Comment