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

2019-07-31 09:53发布

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?

4条回答
戒情不戒烟
2楼-- · 2019-07-31 10:18

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

查看更多
forever°为你锁心
3楼-- · 2019-07-31 10:21

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.

查看更多
唯我独甜
4楼-- · 2019-07-31 10:33

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.

查看更多
我只想做你的唯一
5楼-- · 2019-07-31 10:43

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.

查看更多
登录 后发表回答