PDB does not match image Error

感情迁移 提交于 2019-12-21 07:25:31

问题


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.


回答1:


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".




回答2:


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).




回答3:


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"




回答4:


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




回答5:


If you are debugging something that is a nuget package I recommend this:

Go in Tools->Options->Debugging->Symbols and add https://symbols.nuget.org/download/symbols

Otherwise well, you are left with manually modifying guid from dll to match that in PDB file.



来源:https://stackoverflow.com/questions/7749558/pdb-does-not-match-image-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!