A PDB file is a file format used for storing debugging information about a program or program modules such as a DLL or EXE. It is typically created from source files during compilation and commonly has a .pdb extension. The PDB file 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.
When a program is debugged, the debugger loads debugging information from the PDB file and uses it to locate symbols or relate the current execution state of a program to its 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.
PDB files are usually removed from the programs distribution package and are used by developers during debugging to save time and gain insight. The PDB format is documented and information can be extracted from a PDB file using the DIA (Debug Interface Access) interfaces, available on Microsoft Windows. There are also third-party tools that can extract information from PDB files, such as radare2 and pdbparse.
In summary, a PDB file is a file format used for storing debugging information about a program or program modules, which is used by developers during debugging to save time and gain insight.