VS2010 C++不包含 .pdb 的路径是我根据 dumpbin 编译的 .dll
Visual Studio 按照我的需要将项目编译成 dll,但是当我使用 dumpbin 检查这些 dll 时,它们没有 pdb 的条目,这可能就是为什么我在加载这些 dll 时无法调试这些 dll 的原因在运行时,它们的 pdb 永远不会加载。我怎样才能让VS写入这些路径?
视觉工作室,C++。
编辑: C++/常规/调试信息格式设置为“程序数据库(/Zi)”,链接器/调试/生成调试信息设置为“是(/DEBUG)”,我认为这是正确的。
Visual Studio compiles the projects into dlls as I want it to, but when I inspect these dlls with dumpbin, then they do not have an entry for their pdbs, which is probably the reason why I cannot debug any of those dlls if I load them at runtime and their pdbs are never loaded. How can I get VS to write these paths?
Visual Studio, C++.
Edit:
C++/General/Debug Information format ist set to "Program Database (/Zi)" and Linker/Debugging/Generate Debug Info are on "Yes (/DEBUG)", which I believe are correct.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果
dumpbin /headers
在调试目录中没有显示任何条目,可能是因为您没有在编译和链接时启用调试信息生成。您应该检查C++/常规/调试信息格式和链接器/调试/生成调试信息选项。如果设置了这些选项,您可以检查Visual输出目录中的dll和pdb是否匹配。借助 Windows 调试工具,您可以使用命令 symchk /v yourdll /sfolder_containing_pdb 来验证调试器引擎是否可以找到 pdb。它将检查 dll 是否不包含调试信息,在这种情况下,您在 Visual Studio 中缺少一个选项,或者 pdb 文件是否不完整。
您还可以将 Windbg 与命令
!sym busy
一起使用。 请参阅此处了解详细说明.If
dumpbin /headers
shows no entry in the Debug Directories, it is probably because you did not enable debug information generation at compile and link time. You should check the C++/General/Debug Information format and the Linker/Debugging/Generate Debug Info options.If these options are set, you may check if the dll and the pdb in the output directory of Visual match. With the Debugging Tools for Windows, you can use the command
symchk /v yourdll /s folder_containing_pdb
to verify if the pdb can be found by the debugger engine. It will check if the dll does not contain debug information, in which case you are missing an option in Visual Studio, or if the pdb file is not complete.You can also use Windbg with the command
!sym noisy
. See here for detailed instructions.pdb 未在 dll 中引用,而是由 Visual Studio 搜索。如果它们位于同一目录中,它应该找到它们。
The pdbs aren't referenced in the dll, they get searched by Visual Studio. If they are in the same directory, it should find them.
您可以指示 Visual Studio 在哪里查找符号 这篇文章。总之:
关于如何使用符号的更全面的概述位于此处。
Output
窗口中应该有关于加载 DLL 时发生的情况的信息。也许这不是您期望的版本?You can direct Visual Studio on where to look for your symbols per this article. In summary:
A more comprehensive overview of how symbols get used is here.
There should be info in the
Output
window on what happened when your DLL got loaded. Perhaps it's not the version you expected?