English 中文(简体)
我怎么能够把“CLR”方法表上的条目与“方法吗?
原标题:How can I match up a CLR method table entry with a MethodDesc?

在使用电灯时,我可以找到一个特定类别的方法表条目清单:

!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()

但是,我可以指出,如何使表格条目与<条码>MethodDesc相匹配——在方法表上有一个oke光只给出了切入值,这表明了JIT的麻烦。 我可以说明你如何能够获得<代码>。 方法说明/编码。 没有人有什么想法?

问题回答

您可从第1.B.ctor()类的条目中找到方法。

!dumpmd poi(001dc098-0x4)

举例来说,这里是堆放场的样本。

  0:021> !dumpmt -md poi(0x18e3d90)
EEClass: 012ef6a4
Module: 00d42c5c
Name: LINQPad.UserOptions
mdToken: 02000002  (C:Documents and Settings
aveenMy DocumentsDownloadsLINQPad.exe)
BaseSize: 0x3c
ComponentSize: 0x0
Number of IFaces in IFaceMap: 0
Slots in VTable: 16
--------------------------------------
MethodDesc Table
   Entry MethodDesc      JIT Name
03aa6aa0   03924924   PreJIT System.Object.ToString()
03aa6ac0   0392492c   PreJIT System.Object.Equals(System.Object)
03aa6b30   0392495c   PreJIT System.Object.GetHashCode()
03b17410   03924980   PreJIT System.Object.Finalize()
01321618   00d481ac      JIT LINQPad.UserOptions..ctor()
01321458   00d481c0      JIT LINQPad.UserOptions..cctor()
013214a8   00d48140      JIT LINQPad.UserOptions.get_Instance()
01321580   00d4814c      JIT LINQPad.UserOptions.Load()
01321650   00d48158      JIT LINQPad.UserOptions.Deserialize(System.String)
00d4c249   00d48164     NONE LINQPad.UserOptions.Save()
018c8410   00d48170      JIT LINQPad.UserOptions.get_TabSizeActual()
00d4c251   00d4817c     NONE LINQPad.UserOptions.get_IsVBDefault()
01325ef0   00d48188      JIT LINQPad.UserOptions.GetDefaultCustomSnippetsFolder()
01325e00   00d48194      JIT LINQPad.UserOptions.GetCustomSnippetsFolder(Boolean)
0db83d50   00d481a0      JIT LINQPad.UserOptions.get_ActualEditorBackColor()
01321898   00d481b4      JIT LINQPad.UserOptions.<Deserialize>b__0(System.Reflection.FieldInfo)

这里指的是从入境时使用的方法! 倾销

0:021> !dumpmd poi(01321458-0x4)
Method Name: LINQPad.UserOptions..cctor()
Class: 012ef6a4
MethodTable: 00d4838c
mdToken: 0600000c
Module: 00d42c5c
IsJitted: yes
CodeAddr: 01321458

HTH





相关问题
SQL CLR Stored Procedure - Relative path for DllImport?

I have a C# project consisting of stored procedures that reference a win32 dll from another project in the solution. Currently, dllimport is using absolute paths to reference it. If I use a relative ...

convert a list of structs from c# to c++

I have the following c# code static void Main(string[] args) { List<Results> votes = new List<Results>(); } public struct Results { public int Vote1; ...

How|Where are closed-over variables stored?

This is a question based on the article "Closing over the loop variable considered harmful" by Eric Lippert. It is a good read, Eric explains why after this piece of code all funcs will return the ...

Axapta Validation Class

I ve written a method to handle regex validation in AX2009. Problem is that it always returns false, no matter what the expression or input string. Returns no errors, just false Mind taking a ...

Getting a byte array from out of process C++ COM to C#

What s the best way to get a chunk of memory (i.e. void*) from a COM server to C#? We have been using an IStream (using CreateStreamOnHGlobal) and passing that back, which worked. However when we ...

Removing delegates from chain

class Program { internal delegate int CallBack(int i); static void Main(string[] args) { CallBack callbackMethodsChain = null; CallBack cbM1 = new CallBack(FirstMethod); ...

热门标签