开发者

What do these properties mean in Mono.Cecil?

I am using Lokad shared libraries, which in turn depends on Mono.Cecil.

I am a little confused what the following properties mean (they are to do with .NET internals and thus have equivalent .NET internals):

  • PackingSize (they are to do with types as it is in TypeDefinition).
  • Mvid (in ModuleDefinition).
  • ExplicitThis (something to do with the this keyword I know, but in MethodDefinition).
  • CallingConvention.
  • GetSentinel (a meth开发者_如何学运维od which returns int in MethodReference).
  • RVA.
  • SemanticsAttribute.
  • IsHideBySig.

Any idea what these mean/do?


I'm not too familiar with Cecil, but the majority of those items are related to the IL file. Here are some answers - all taken from Serge Lidin's book: Expert .Net 2.0 IL Assembler.

  • Packing Size = The alignment factor in bytes. Must be set to 0 or a power of 2 from 1 to 128. (in the class layout metadata table) (p122)

  • Mvid = globally unique identifier, assigned to the module as it is generated (or module version id). (in the module metadata table) (p105)

  • Explicit This = Method call signature. The first explicitly specified parameter is the instance pointer. The ILAsm keywork is explicit. (p159)

  • CallingConvention = the first byte of a signature identifies the type of the signature, which for historical reasons is called the calling convention of the signature. (ex: default, vararg, field, localsig, property, unmgd, hasthis, explicitthis) p158-159

  • GetSentinel = most likely has to do with the sentinel modifier, which signifies the beginning of optional arguments supplied for a vararg method call. (p152)

  • RVA = Relative virtual address: the address of an item once it has been loaded into memory, with the base address of the image file subtracted from it - in other words, the offset of an item within the image file loaded into memory. (p42)

  • SemanticsAttribute - most likely something to do with the MethodSemantics table, which connects events and properties with their associated methods and provides information regarding the type of association. A Semantic can be a setter, getter, other (property) or addon, removeon or fire (event) p317

  • IsHideBySig - the method hides all methods of the parent classes that have a matching signature and name (as opposed to having a matching name only). p188

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜