PDB 与图像不匹配错误
我正在尝试对开源项目 npp-community 进行一些添加,但似乎无法调试。我尝试调试的代码被编译成 dll,然后链接到主项目。设置断点时出现以下错误:
当前不会命中断点。该文档尚未加载任何符号。
当我检查 debug>windows>modules
下的模块时,我检查符号加载信息并收到以下错误。
PDB 与图像不匹配
我尝试退出 Visual Studio 并重新启动/重新编译,但这似乎没有解决任何问题。谷歌似乎给出了一些绕圈子的线索,但没有明确的答案。
I'm trying to make a few additions to an open source project, npp-community, but can't seem to debug. The code that I'm trying to debug is compiled into a dll then linked to the primary project. When setting breakpoints I get the following error :
the breakpoint will not currently be hit. No symbols have been loaded for this document.
When I check the modules under debug>windows>modules
I check symbol load information and get the following error.
PDB does not match image
I have tried exiting visual studio and restarting/recompiling but that does not seem to fix anything. Google seems to give threads that go in circles and no clear answers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我的 VS2010 项目也有类似的问题,结果发现问题是由于项目属性不匹配 -> C/C++ -> 输出文件 -> “程序数据库文件名”,以及项目属性 -> 链接器 -> 调试 -> “生成程序数据库文件”。
通过将“程序数据库文件名”更改为“从父级或项目默认值继承”来修复此问题。
i have a similar issue with my VS2010 project, turn out the issue is due to mistmatch of Project properties -> C/C++ -> Output Files -> 'Program Database File name', and Project properties -> Linker -> Debugging -> 'Generate Program Database File'.
Fixed it by change the 'Program Database File name' to "inherit from parent or project default".
这里的问题在于调试器无法为您的模块找到有效的 PDB 文件。 PDB 文件使用两个参数与二进制图像进行匹配:标识符 (GUID) 和年龄。 本文中提供了有关此过程的更多信息。
确保您的模块具有有效的 PDB 文件,并且它们与模块位于同一目录中或在调试器的搜索路径中(调试->选项和设置...->符号)。
The problem here lies in the fact that the debugger was unable to find a valid PDB files for your modules. PDB files are matched against binary images using two parameters: identifier (GUID) and age. There is more information about this process in this article.
Make sure that you have valid PDB files for your modules and that they are in the same directory as modules or in the debugger's search path (Debug->Options and settings...->Symbols).
有时会发生这种情况,因为您可能已将项目构建为发布版本。
右键单击解决方案,然后单击“批量构建”>检查您的所有项目并单击“清理”
Sometimes it happens because you might have build the project as a release.
Right click on the solution and click on "Batch Build" > Check all your projects and click "Clean"
我与 nuget 包发生了名称冲突。我在一个名为 gtest 的项目中使用 googletest 包。 Visual Studio 不喜欢这样并且找不到 pdb 文件。重命名项目然后就可以了。
I had a name clash with a nuget package. I was using the googletest package in a project that was called gtest. Visual Studio did not like that and couldn't find the pdb files. Renamed the project and then it worked.
我在开发 WinCE5.0 的智能设备项目时遇到了这个问题。解决方案是冷启动我正在调试的设备+清理vs2008中的解决方案
I had this while working on a Smart Device project for WinCE5.0. The solution was to cold boot the device I was debugging on + clean the solution in vs2008
如果您正在调试 nuget 包,我建议您这样做:
进入
Tools->Options->Debugging->Symbols
并添加https://symbols.nuget.org /download/symbols
否则,您只能手动修改 dll 中的 guid 以匹配 PDB 文件中的 GUID。
If you are debugging something that is a nuget package I recommend this:
Go in
Tools->Options->Debugging->Symbols
and addhttps://symbols.nuget.org/download/symbols
Otherwise well, you are left with manually modifying guid from dll to match that in PDB file.