断点没有达到 [英] Breakpoints not hitting up

查看:99
本文介绍了断点没有达到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的C ++代码库中,断点没有增加.
我已经在Visual Studio中建立了一个代码库(在Windows上为C ++),并创建了一个dll及其对应的pdb文件.

我运行了该应用程序,然后将其连接到windbg,正确设置了符号,并且源代码路径也正确.
我已在可疑文件中设置了断点.
问题在于断点没有达到.
当我在该位置(已设置断点的位置)进行更改时,相应的更改将反映在输出中.
但是在运行应用程序时,断点不会命中.

In my code base of C++ the breakpoints are not hitting up.
I have built a code base(C++ on Windows) in visual studio and created a dll and its corresponding pdb files.

I ran the application and then connected it to windbg, set the symbols properly and source code path is also proper.
I have set the breakpoints in a suspected file.
The problem is the breakpoints are not hitting up.
When I make the changes at that place(where I have set the breakpoints) the corresponding changes gets reflected in the output.
But while running the application the breakpoints does not hit.

What might be the reason behind this and how to resolve it?

推荐答案

请确保已在调试"模式下编译了二进制文件.
其次,检查调试器是否从正确的路径加载正确的符号/pdbs.
有关更多详细信息,请查看 [
Make sure that you''ve compiled the binaries in ''Debug'' mode.
Secondly check whether the debugger is loading the right symbols / pdbs from the right path.
For more details you can have a look this[^].


1.打开您的DLL项目
2.打开属性页,然后转到调试",然后在命令"字段中,输入应用程序的(相对)路径和名称.
3.按F5键以调试模式生成并运行DLL

如果不起作用,请在启动期间检查输出窗口中的错误消息.
1. Open your DLL project
2. Open the properties page, then go to ''Debugging'' and in the field ''Command'', enter the (relative) path and name of the application.
3. press F5 to build and run your DLL in debug mode

If that doesn''t work, check the output window for error messages during startup.


根据
According to this[^] similar question at SO, it may be because you have some optimizations turned on. When it optimizes, sometimes the code where the breakpoint is set no longer exists. Try turning off all optimization.


这篇关于断点没有达到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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