Export (0) Print
Expand All

PDB Files

A program database (PDB) file holds debugging and project state information that allows incremental linking of a Debug configuration of your program. A PDB file is created when you compile a C/C++ program with /ZI or /Zi or a Visual Basic/C#/JScript .NET program with /debug.

In Visual C++, the /Fd option names the PDB file created by the compiler. When you create a project in Visual Studio using wizards, the /Fd option is set to create a PDB named project.PDB.

If you build your C/C++ application using a makefile, and you specify /ZI or /Zi without /Fd, you end up with two PDB files:

  • VC70.PDB   (More generally, VCx0.PDB where x represents the version of Visual C++.) This file stores all debugging information for the individual OBJ files and resides in the same directory as the project makefile.
  • project.PDB   This file stores all debug information for the.exe file. For native code, it resides in the \debug subdirectory. For managed code, it resides in the \WINDEBUG subdirectory.

Each time it creates an OBJ file, the C/C++ compiler merges debug information into VCx0.PBD. The inserted information includes type information but does not include symbol information such as function definitions. So, even if every source file includes common header files such as <windows.h>, the typedefs from those headers are stored only once, rather than being in every OBJ file.

The linker creates project.PDB, which contains debug information for the project's EXE file. The project.PDB contains full debug information, including function prototypes, not just the type information found in VCx0.PDB. Both PDB files allow incremental updates.

The Visual Studio debugger uses the project.PDB file created by the linker directly and embeds the absolute path to the PDB in the EXE or DLL file. If the debugger cannot find the PDB file at that location or if the path is invalid (for example, if the project was moved to another computer), the debugger searches the path containing the EXE, the Symbol Path specified in the solution's Property Pages (Common Properties folder, Debug Symbol Files page). The debugger will not load a PDB that does not match the binary being debugged.

Note   For more information, see Debug and Release Configurations.

See Also

Debug Settings and Preparation

Show:
© 2014 Microsoft