0

I am debugging a VS 2008 C++ project. The project links to a static lib whose PDB file is present in same folder as the .lib file. It used to be all OK. PDB of lib file is loaded and source file is accessible during debugging. But now it suddenly fail to load with no change at all.

So how do I diagnose in VC++ to make sure the pdb is found and loaded by IDE?

UPDATE:

I changed EXE project setting to be "YES" for "Use library dependency inputs", and now I can access source code of the lib now, though it doesn't answer my initial question of why pdb of lib suddenly fails to load.

Further Question

My understanding is: EXE file statically links to LIB file, so all referenced binary code in LIB are already included in EXE binary. So do I actually need LIB file present? And, do I need LIB pdb file present or are the debugging info integrated into EXE's pdb file as well?

Matt Johnson-Pint
  • 230,703
  • 74
  • 448
  • 575
Sheen
  • 3,333
  • 5
  • 26
  • 46
  • If the PDB is not the one that relates to the actual build of the LIB, it won't load it no matter what you do. Are you 100% sure that nothing has changed? – Roger Rowland Jul 07 '14 at 12:25
  • @RogerRowland I am pretty sure nothing changed. I recompiled the lib project and made sure the pdb is re-generated. Is there a way to see verbose information of dubugger on loading PDBs? – Sheen Jul 07 '14 at 12:36
  • Not that I know of, but during a debugging session or when analysing a crash dump, you can look at the Modules tab and see if you can try to resolve the symbols from there by specifying the PDB location manually - it may give addtional info. – Roger Rowland Jul 07 '14 at 12:43
  • Are the lib and PDB from the same date & time? Even a diff in a timestamp is enough to fail PDB loading. – Ofek Shilon Jul 07 '14 at 13:10
  • The PDB of the lib won't be merged into the PDB of the EXE that consumes it, so you *do* need the lib's PDB when debugging as that ties the functions in the lib to it's corresponding source code (which is not part of your EXE's project), – Roger Rowland Jul 07 '14 at 15:08

0 Answers0