使用通用类型的类在WINDBG SOS中设置断点 [英] setting breakpoint in WINDBG SOS with generically typed classes

查看:74
本文介绍了使用通用类型的类在WINDBG SOS中设置断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windbg中寻求SOS扩展命令!BPMD的帮助(即键入!help BPMD )会导致文本,其中包含除其他外的说明,介绍了如何分解为通用类型的方法.内容如下:

Asking for help for the SOS extension command !BPMD in Windbg (i.e. typing !help BPMD) results in a text which contains, among other things, a description on how to break into generecally typed methods. This reads as follows:

!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整数(撇号右边的整数)是什么意思?这些代码是否与方法的类型(公共无效和静态公共无效)相关,或者它们是否引用模板参数的数量?如果第一个猜测是正确的,我在哪里可以找到可能的类型的列表?

What I fail to understand here is the syntax used in the last two lines. What does the apostrophe (`) mean, and what is the meaning of the tho integers involved (the ones to the right of the apostrophe)? Are these codes related to the type (public void and static public void) of the methods, or do they refer to the number of template arguments? In case the first guess is true, where would I find a list of possible types?

推荐答案

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

The backtick symbol is the syntax for specifying a generic type in IL. The number after the backtick is the number of generic parameters.

这篇关于使用通用类型的类在WINDBG SOS中设置断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆