如何使用符号插入断点包括“<>"(尖括号) [英] How to insert breakpoint using symbols include "<>" (angle brackets)

查看:35
本文介绍了如何使用符号插入断点包括“<>"(尖括号)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 windbg 中插入一个断点,使用名为TSmartPointer::TSmartPointer"的符号.

I want to insert a breakpoint in windbg, using symbols named "TSmartPointer::TSmartPointer".

bp TSmartPointer<class CDataMemberMgr>::TSmartPointer<class CDataMemberMgr>

WinDbg 注意到我没有找到任何符号.

WinDbg noticed me that no symbols were found.

我使用命令 x 搜索符号,但也没有找到符号:

I use command x to search symbol, but also no symbols are found:

x TSmartPointer<class CDataMemberMgr>::TSmartPointer<class CDataMemberMgr>

当我替换<"时和>"到*",WinDbg可以找到符号:

When I replace "<" and ">" to "*", WinDbg can find symbols:

x TSmartPointer*class CDataMemberMgr*::TSmartPointer*class CDataMemberMgr*

我错了吗?如何插入此断点?

Am I wrong? How can I insert this breakpoint?

推荐答案

我在 WinDbg 的内部帮助中找不到这个,但是在 Microsoft 文档,这让我对 空格 也有些疑惑

I could not find this in WinDbg's internal help, but in Microsoft documentation, which makes me wonder a bit about the spaces as well

要在复杂函数(包括包含空格的函数以及 C++ 公共类的成员)上设置断点,请将表达式括在括号中.例如,使用 bp (??MyPublic) 或 bp (operator new).

To set a breakpoint on complicated functions, including functions that contain spaces, as well as a member of a C++ public class, enclose the expression in parentheses. For example, use bp (??MyPublic) or bp (operator new).

此外,它明确谈到了尖括号:

您必须以三个符号@!" 开头,并以引号 (") 结尾.如果没有此语法,则不能在 MASM 评估器中的符号名称中使用空格、尖括号(<、>)或其他特殊字符.

You must start with the three symbols @!" and end with a quotation mark ("). Without this syntax, you cannot use spaces, angle brackets (<, >), or other special characters in symbol names in the MASM evaluator.

(强调我的)

因此,在您的情况下,以下内容应该有效:

So, in your case, the following should work:

bp @!"TSmartPointer<class CDataMemberMgr>::TSmartPointer<class CDataMemberMgr>"

引号也应该关心空格.

并对@Kurt Hutchinson 发表评论:

对于模板类,使用 Windbg 想要的确切间距和尖括号位置很重要.有时那里会有一个额外的空间,这很重要.您可以通过首先进行符号查找来判断它应该是什么,例如 x MSHTML!TSmartPointer*CDataMemberMgr*.Windbg 应该进行通配符匹配并打印出一堆符号名称.然后,您应该使用@!"..." 引用从该列表中复制并粘贴正确的名称.不要尝试自己重新输入符号名称,因为空格很重要,如果您错过了空格,Windbg 将无法正确匹配.

For template classes, it's important to use the exact spacing and angle bracket placement that Windbg wants. Sometimes there will be an extra space in there that is significant. You can tell what it should be by doing a symbol lookup first like x MSHTML!TSmartPointer*CDataMemberMgr*. Windbg should do a wildcard match and print out a bunch of symbol names. Then you should copy and paste the correct name from that list, using the @!"..." quoting. Don't try to retype the symbol name yourself because spaces matter and if you miss one, Windbg won't match it correctly.

这篇关于如何使用符号插入断点包括“&lt;&gt;"(尖括号)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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