One of the things that surprised me when I started using Visual Studio, coming from a Linux programming background, was the amount of files it generates when you create and compile a project. One of these files is usually named project.pdb and contains the debug information for the final executable, along with information for incremental linking (Microsoft calls it the “program database“, hence the PDB extension). It turns out having separate debug information files can be useful when you want to distribute your program in binary form, but still be able to debug it when you get crash reports.

I was curious if the GNU toolchain could do the same, and the answer is yes. According to the gdb documentation there are two ways of using debug info from another file: