Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Source information missing from the debug information for this module - PDB successfully loaded

Visual Studio loads the correct PDB file, but can't find source information for anything in the solution.

Things I've tried:

  • Clean, reboot, regenerate project (CMake), rebuild
  • Check the Modules window to ensure the PDB is loaded (it is)
  • Mess with "Debug Source Files" setting under solution properties
  • Check the PDB file with symchk (it says the PDB matches the EXE, and that it has full symbol information, i.e. it's not stripped)
  • Download system lib symbols from Microsoft because why not

Is there some setting that generates a PDB without source information? Or could it be baking bad paths into the PDB? I tried grepping through the PDB and although it appears to have all the symbols, I couldn't find any source file paths.

More info: this is a 64-bit C++ project. Everything is statically linked including the runtime.

like image 933
etodd Avatar asked Sep 27 '16 15:09

etodd


People also ask

How do I debug a PDB file?

The easiest way to use the PDB file is to let Visual Studio do the heavy lifting - either launch your program with Visual Studio's "Debug" command (F5 by default), or run the program and use the "Attach to Process" item in Visual Studio's Debug menu.

How do I add a PDB file to Visual Studio?

Open Settings: Tools->Options -> Debugging -> Symbols and add directory, where your . PDB files are located. You can add custom path, like for each project, and also you can edit common path, where Visual Studio will save all . pdb cache.

How do I load debug symbols in Visual Studio?

In Visual Studio, open Tools > Options > Debugging > Symbols (or Debug > Options > Symbols).


Video Answer


1 Answers

The project was missing the /Zi parameter. Apparently this still causes the compiler to generate a PDB file that can be successfully loaded, it just doesn't have any useful symbols in it. No idea why.

like image 69
etodd Avatar answered Sep 19 '22 22:09

etodd