执行(able/ing)代码处无法到达断点

发布于 2024-08-26 16:03:56 字数 253 浏览 3 评论 0原文

我有两个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

本宫微胖 2024-09-02 16:03:57

我假设您使用的是 Visual Studio。您是否打开了混合模式调试?

(项目属性->调试->调试器类型)

I assume you're using Visual Studio. Do you have mixed-mode debugging switched on?

(Project Properties->Debugging->Debugger Type)

野の 2024-09-02 16:03:56

您遇到的问题的原因是 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文