执行(able/ing)代码处无法到达断点
我有两个 DLL,一个用本机 C++ 编写,另一个用 C++/CLI 编写。前者被注入到进程中,并在稍后的时间点加载后者。在调试时,我注意到本机 DLL 的断点运行正常,而其他断点却运行不正常,即使其代码正在执行。
断点显示以下消息:不会命中断点。没有与该行关联的可执行代码。可能的原因包括:预处理器指令或编译器/链接器优化。
模块窗口告诉我插件的符号已加载。我正在运行它的 DEBUG 版本。关于为什么会这样以及也许有解决办法的任何想法吗?
I've got two DLLs, one in written in native C++ and the other in C++/CLI. The former is injected into a process, and at a later point in time, loads the latter. While debugging, I noticed that the native DLL's breakpoints were functioning correctly while the other's weren't, even though its code was being executed.
The breakpoints showed this message: This breakpoint will not be hit. No executable code associated with this line. Possible causes include: preprocessor directives or compiler/linker optimizations.
The modules window tells me that the plugin's symbols are loaded. I'm running with its DEBUG build. Any ideas on why this is so and perhaps a fix ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我假设您使用的是 Visual Studio。您是否打开了混合模式调试?
(项目属性->调试->调试器类型)
I assume you're using Visual Studio. Do you have mixed-mode debugging switched on?
(Project Properties->Debugging->Debugger Type)
您遇到的问题的原因是 PDB(“PDB 代表程序数据库,一种专有文件格式(由 Microsoft 开发),用于存储有关程序的调试信息)”不是最新的。
尝试清理解决方案(即包含托管代码 DLL)并再次重建它
提示:如果您引用的是 DLL,请尝试将最新的 pdb 放在它旁边,您可以从 bin 中获取 pdb。文件夹。
The reason for what you faced is that the PDBs ("PDB stands for Program Database, a proprietary file format (developed by Microsoft) for storing debugging information about a program) are not up-to-date.
Try to clean the solution (that contains the managed code DLL) and rebuild it again.
Tip: if you are referring to the DLL, try to put the up-to-date pdbs beside the it. You can get the pdbs from your bin folder.