” 附加到进程” 在 Visual Studio 2005 中
我安装了 Visual Studio 2005(带 SP1)并按照 C++ 所需的默认设置进行了设置。
现在我打开一个解决方案并运行 exe 。 在“工具”菜单项下,我选择“附加进程”,然后将其附加到刚刚运行的 exe 中。 我在代码中的几个位置放置了断点(该断点看起来已启用),这些是绝对应该命中断点的地方。 但由于某种原因,我的断点没有被命中。
PS:所有 pdb 都存在于正确的位置。
有没有我缺少的设置。
I installed Visual Studio 2005 ( with SP1 ) and made the default settings as what is required for C++ .
Now i open a solution and run the exe .
Under " Tools " menu item i go and Select " Attach the process " and i attach it to the exe i just ran . I put breakpoints several places in the code ( this breakpoints looks enabled ) and these are the places where the breakpoints should definitely be hit .
But for some reason , my breakpoints are not hit .
PS : All pdb's are present in correct location .
Is there any setting i am missing .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您处于调试模式吗? 当我尝试在发布模式下执行此操作时,我遇到了这个问题。 它不会抱怨,只是没有达到断点。
Are you in Debug mode? I've had this problem when I was trying to do it in Release mode. It doesn't complain, it just doesn't hit the breakpoints.
使用模块视图查看您的 exe/dll 是否已加载,如果未加载,则指定从何处加载 PDB。
Use the Modules view to see if your exe/dll is loaded, and if not, to specify where to load the PDB from.
也许它附加到了“错误类型”的代码。
在“附加到进程”对话框中,有一个设置允许您选择要调试的代码类型。 尝试单击“附加到”文本框旁边的“选择”按钮,然后仅选中
“托管代码”相关代码类型。http://img204.imageshack.us/img204/3017/capture5ct4.png
大多数时候,保留“自动确定要调试的代码类型”设置对我来说是有效的。 但是,在某些情况下,调试器无法理解我想要附加到托管代码(例如,如果我从批处理文件启动了我的应用程序),并且当它这样做时,上述解决方案对我有用。
Perhaps it is attaching to "the wrong kind" of code.
In the "Attach to Process" dialog, there is a setting that allows you to select the kind of code you want to debug. Try clicking "Select" button next to "Attach to" text box and checking only
"Managed code"the relevant code type.http://img204.imageshack.us/img204/3017/capture5ct4.png
Most of the time, leaving "automatically determine the type of code to debug" setting on works for me. However, in some cases, the debugger is not able to understand that I want to attach to managed code (if I have launched my application from a batch file, for example) and when it does that, the above solution works for me.