使用通常类型的类在WINDBG SOS中设置断点

时间:2013-05-27 14:05:55

标签: clr windbg sos

请求SOS扩展命令的帮助!Windbg中的BPMD(即键入!help BPMD)会生成一个文本,其中包含有关如何打入基因类型方法的说明。其内容如下:

!BPMD works equally well with generic types. Adding a breakpoint on a generic 
type sets breakpoints on all already JIT-ted generic methods and sets a pending 
breakpoint for any instantiation that will be JIT-ted in the future.

Example for generics:
Given the following two classes:

class G3<T1, T2, T3> 
{
    ...
    public void F(T1 p1, T2 p2, T3 p3)
    { ... }
}

public class G1<T> {
    // static method
    static public void G<W>(W w)
    { ... }
}

One would issue the following commands to set breapoints on G3.F() and 
G1.G():

!bpmd myapp.exe G3`3.F
!bpmd myapp.exe G1`1.G

我在这里无法理解的是最后两行中使用的语法。撇号(`)是什么意思,所涉及的整数(撇号右边的那些)是什么意思?这些代码是否与方法的类型(public void和static public void)相关,还是它们引用了模板参数的数量?如果第一个猜测为真,我会在哪里找到可能的类型列表?

1 个答案:

答案 0 :(得分:2)

反引号符号是在IL中指定泛型类型的语法。反引号后面的数字是通用参数的数量。

相关问题