如何将 CLR 方法表条目与 MethodDesc 进行匹配?
使用 sos,我可以获得特定类的方法表条目列表:
!DumpMT -MD 1d3c58 PDB symbol for mscorwks.dll not loaded EEClass: 001d195c Module: 001d2f2c Name: Class1.B mdToken: 02000005 BaseSize: 0xc ComponentSize: 0x0 Number of IFaces in IFaceMap: 0 Slots in VTable: 7 -------------------------------------- MethodDesc Table Entry MethodDesc JIT Name 691f6a90 69071248 PreJIT System.Object.ToString() 691f6ab0 69071250 PreJIT System.Object.Equals(System.Object) 691f6b20 69071280 PreJIT System.Object.GetHashCode() 692674c0 690712a4 PreJIT System.Object.Finalize() 001dc088 001d3c34 NONE Class1.B.M() 001dc090 001d3c40 NONE Class1.B.N() 001dc098 001d3c4c JIT Class1.B..ctor()
但我无法弄清楚 sos 如何将表条目与 MethodDesc 相匹配 - 在方法表中进行查看内存仅提供指向 JIT 存根的 Entry 值。我不知道如何从那里获取 MethodDesc 。有人有什么想法吗?
Using sos, I can get the method table entry list for a particular class:
!DumpMT -MD 1d3c58 PDB symbol for mscorwks.dll not loaded EEClass: 001d195c Module: 001d2f2c Name: Class1.B mdToken: 02000005 BaseSize: 0xc ComponentSize: 0x0 Number of IFaces in IFaceMap: 0 Slots in VTable: 7 -------------------------------------- MethodDesc Table Entry MethodDesc JIT Name 691f6a90 69071248 PreJIT System.Object.ToString() 691f6ab0 69071250 PreJIT System.Object.Equals(System.Object) 691f6b20 69071280 PreJIT System.Object.GetHashCode() 692674c0 690712a4 PreJIT System.Object.Finalize() 001dc088 001d3c34 NONE Class1.B.M() 001dc090 001d3c40 NONE Class1.B.N() 001dc098 001d3c4c JIT Class1.B..ctor()
But I can't figure out how sos can match up a table entry with a MethodDesc
- having a poke around the method table in memory only gives the Entry values, which point to the JIT stub. I can't figure out how you can get the MethodDesc
s from there. Anyone have any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以从 Class1.B..ctor() 的条目中获取 MethodDesc
例如,这里是一个示例 dumpmt
从条目返回到 methoddesc 的引用
这里是使用 !dumpmd HTH
You could get the MethodDesc from the entry for Class1.B..ctor()
For example here is a sample dumpmt
And here is reference back to methoddesc from entry using !dumpmd
HTH