在 Windbg 中寻求 SOS 扩展命令 !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
我在这里无法理解的是最后两行中使用的语法。撇号 (`) 是什么意思,所涉及的 tho 整数(撇号右侧的那些)是什么意思?这些代码是与方法的类型(public void 和 static public void)相关,还是指模板参数的数量?如果第一个猜测是真的,我在哪里可以找到可能类型的列表?