Search code examples
c++visual-studio-2010dllpdb-files

VS2010 C++ does not include paths to .pdb is my compiled .dlls according to dumpbin


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.


Solution

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