What is a PDB file?

What is a PDB file?

VoidSoul

Program database (PDB) is a proprietary file format (developed by Microsoft) for storing debugging information about a program (or, commonly, program modules such as a DLL or EXE). PDB files commonly have a .pdb extension. A PDB file is typically created from source files during compilation. It stores a list of all symbols
in a module with their addresses and possibly the name of the file and
the line on which the symbol was declared. This symbol information is
not stored in the module itself, because it takes up a lot of space.

A PDB file is a database file used by various applications, including Pegasus, Quicken, MS Visual Studio, and Palm Pilot software. It stores data in a structured format and is typically installed with the corresponding application.

PDB files used by different programs are usually saved in a proprietary format, meaning they can only be opened by the program they were installed with. For example, an Intuit Quicken PDB file is not recognized by Microsoft Visual Studio.

Visual Studio uses PDB files to store debugging information about a program, including symbol information, which is too large to be stored in the program itself. The symbol information consists of a list of all symbols in a program module with addresses, the name of the file, and the line the symbol was declared on. You can use Visual Studio to load information from the PDB file to debug a program.

When a program is debugged, the debugger loads debugging information from the PDB file and uses it to locate symbols or relate current execution state of a program source code. Microsoft Visual Studio uses PDB files as its primary file format for debugging information.

Another use of PDB files is in services that collect crash data from users and relate it to the specific parts of the source code that cause (or are involved in) the crash.

Microsoft compilers will, under appropriate options, store information in a single PDB about types found in the compiled sources. Debug information specific to each source is stored in the compiled object file, and contains references to types in the PDB. Each compilation will add to the PDB any types that are not already found there, so that references in already compiled object files remain valid.

The Microsoft linker, under appropriate options, builds a complete new PDB which combines the debug information found in its input modules, the types referenced by those modules, and other information generated by the linker. If the link is performed incrementally, an existing PDB is modified by adding replacing only the information pertaining to added or replaced modules, and adding any new types not already in the PDB.

PDB files are usually removed from the programs' distribution package. They are used by developers during debugging to save time and gain insight.

Learn More

Report Page