上课时如何休息
我已阅读线程每当输入文件(或类)时就中断。现在我了解了如何在类中自动设置断点的基本机制。然而,Thread提供的解决方案主要针对.net框架。我的问题是如何在标准 C++ 中处理它。我们在windows 7平台上使用vc 10编译器。
此外,当我们重新选择要检查的类时,我们更喜欢不需要重新编译的方法,因为这是一个巨大的工程,并且重新编译需要花费大量时间。
提前致谢!
I've read the thread break whenever a file(or class) is entered. And I now understood the basic mechanism how to automatically set breakpoints in the classes. However, the solution that thread provided is focused on .net framework. My problem is how to deal with it in standard C++. We use vc 10 compiler on windows 7 platform.
Besides, we prefer methods which do not need recompile when we rechoose the class which we want to inspect since it is a huge project and recompilation takes a lot of time.
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以从 IDE 执行此操作:
http://blogs.msdn.com/b/habibh/archive/2009/09/10/class-breakpoint-how -在-visual-studio-debugger.aspx中的-ac-class上设置断点
You can do it from the IDE:
http://blogs.msdn.com/b/habibh/archive/2009/09/10/class-breakpoint-how-to-set-a-breakpoint-on-a-c-class-in-the-visual-studio-debugger.aspx
埃米尔·科米尔给出的答案是一个很好的解决方案。当我尝试按照链接所述添加断点“Stack::*”时,我发现代码行左侧没有红点,直到我开始调试程序。停止程序后,红点消失,但断点窗口会跟踪每个断点,您可以通过在断点窗口中双击断点来转到代码。
The answer Emile Cormier gives is a good solution. When I try to add a breakpoint "Stack::* " as the link says, I found there is no red point on the left of code lines until I start debugging the program. After stopping the program, the red points disappear, but the break point window will keep track of every breakpoint and you can turn to the code by double clicking the breakpoint in the breakpoint window.
据我所知,你只能设置内存断点(每当读/写某个内存地址的内容时就断点),然后手动断点(在某一行代码上断点)。
最好的办法可能是在要调试的函数调用的开头设置一个断点。
As far as i know, you can only set memory breakpoints (break whenever the contents of a certain memory address is read/written) and then manual breakpoints (break on a certain line of code).
Your best bet may be to set a breakpoint at the beginning of the function call(s) you want to debug.