Debug in VS C++ with dll, pdb files and source

白昼怎懂夜的黑 提交于 2019-12-24 08:28:08

问题


A question about pdb file. Is pdb file for debugging in Visual Studio? If so, why do they also exist in my Release folder? It's normal that pdb files are in Debug folder, but why they are also in Release folder.

So I have now a Release folder build by Integration team with all the pdb files. Now I can load all the corresponding source (in GIT) so I'm sure that the binaries correspond to the source. Then do I need to build again in order to debug in Visual Studio? If not, what I have to do in order to get thing done quickly?


回答1:


As mentioned above, PDBs are as much important as release binaries! Once a software is released, you can debug it afterwards (depending on whether public and private symbols are available). Should the PDBs contain private symbols, please keep in mind that these describe your code (parameters, types, return values, symbols...). Here an article explaining the logical link that exists between an executable and its PDBs.




回答2:


Actually you can debug your release build too - if you have the PDB files. So it's a good idea to keep the PDB files of your shipped product (release build). For debugging you need the executable and the matching PDB and the matching source files. That's it.




回答3:


You can debug a release build as well, it's just that it's not that useful because of all the extra optimizations. If you don't want a pdb file, you can specify it in the project properties for the release build.




回答4:


Is pdb file for debugging in Visual Studio? YES.

why do they also exist in my Release folder? Go to "your project" Property Page (target release) -> Linker -> Debugging. Set the option Generate Program Database File. i.e. Release/myExe.pdb



来源:https://stackoverflow.com/questions/11100855/debug-in-vs-c-with-dll-pdb-files-and-source

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