Debugging managed code using windbg is always a headache to me and I kind of avoid doing that by using Visual Studio. It becomes a shame as time going since some people think I know it well. So I decided to learn from scratch - by debugging my own small app.
First thing is to load the sos extension. I like .loadby more than .load because it always load the correct version of sos extension. If you are debugging a dump it's easy since you can use ".loadby sos mscorwks". But .loadby doesn't work if you are starting the application with windbg since mscorwks has not been loaded yet. The workaround is a little bit tricky - type following in your debugger "sxe lh:mscorlib" then GO. This tells the debugger to stop execution when mscorlib is loaded, and of course mscorwks is loaded at that time. Afterwards you can load sos successfully using .loadby as above. Details you can refer to this excellent post.
Do play around !dumpmodule, !dumpmt and !dumpmd a little bit please. It took me a while to understand and remember what they are intended for given their name and their parameters' name are similar. :) We can tell which method has been jitted using !dumpmt. Powerful, isn't?
0:000> !ip2md @eip
MethodDesc: 007131e8
Method Name: TestException.TestFinally.Go2()
Class: 0071145c
MethodTable: 00713200
mdToken: 06000002
Module: 00712d8c
IsJitted: yes
m_CodeOrIL: 00de01c8
0:000> !dumpmt -md 00713200
EEClass: 0071145c
Module: 00712d8c
Name: TestException.TestFinally
mdToken: 02000002 (D:/Work/LearnCSharp/Exception/bin/Debug/Exception.exe)
BaseSize: 0xc
ComponentSize: 0x0
Number of IFaces in IFaceMap: 0
Slots in VTable: 8
--------------------------------------
MethodDesc Table
Entry MethodDesc JIT Name
79371278 7914b928 PreJIT System.Object.ToString()
7936b3b0 7914b930 PreJIT System.Object.Equals(System.Object)
7936b3d0 7914b948 PreJIT System.Object.GetHashCode()
793624d0 7914b950 PreJIT System.Object.Finalize()
0071c035 007131e0 NONE TestException.TestFinally.Go1()
00de01c8 007131e8 JIT TestException.TestFinally.Go2()
00de00f0 007131f0 JIT TestException.TestFinally.Go3()
00de00c0 007131f8 JIT TestException.TestFinally..ctor()