SOS Command: !IP2MD
Enable unmanaged debugging in your project properties, run your code to a break point. Press Ctrl + Alt + I.
Type following commands.
.load C:windowsMicrosoft.NETFrameworkv2.0.50727sos.dll !Help !IP2MD !IP2MD <Code address>
Given an address in managed JITTED code, IP2MD attempts to find the MethodDesc associated with it. For example, this output from !clrstack:
!clrstack OS Thread Id: 0xa3c (2620) ESP EIP 0012f3c0 00ff019a IEnumerableTest.Utils.EnumToArray[[IEnumerableTest.Program+RoleType, LinqSelectTest]]() 0012f424 00ff00b9 IEnumerableTest.Program.Main(System.String[]) 0012f69c 79e71b4c [GCFrame: 0012f69c] !ip2md 00ff019a MethodDesc: 00933198 Method Name: IEnumerableTest.Utils.EnumToArray[[IEnumerableTest.Program+RoleType, LinqSelectTest]]() Class: 0093140c MethodTable: 0093313c mdToken: 06000001 Module: 00932c5c IsJitted: yes CodeAddr: 00ff0160
We have taken a return address into Mainy.Main, and discovered information about that method. You could run !U, !DumpMT, !DumpClass, !DumpMD, or !DumpModule on the fields listed to learn more.
!DumpClass 0093140c Class Name: IEnumerableTest.Utils mdToken: 02000002 (C:projectsNetInversebinDebugIEnumerableTest.exe) Parent Class: 790c3ef0 Module: 00932c5c Method Table: 0093313c Vtable Slots: 4 Total Method Slots: 5 Class Attributes: 100181 Abstract, NumInstanceFields: 0 NumStaticFields: 0