What Is a Pdb File

What is a PDB file?

A PDB file contains information for the debugger to work with. There's less information in a Release build than in a Debug build anyway. But if you want it to not be generated at all, go to your project's Build properties, select the Release configuration, click on "Advanced..." and under "Debug Info" pick "None".

What's a PDB file?

A Program Data Base file has nothing to do with incremental linking and Project State! PDB files are used to map EXE with SOURCES. They are used for Debug and Release binaries. Here an article that explains this binding link between an Executable Image and its PDB file

Where must PDB files be located for debugging to work?

See MSDN:

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 build with /debug
(Visual Basic/C#). You can build Visual Basic and Visual C#
applications with /debug:full or /debug:pdbonly. Building with
/debug:full generates debuggable code. Building with /debug:pdbonly
generates PDBs but does not generate the DebuggableAttribute that
tells the JIT compiler that debug information is available. Use
/debug:pdbonly if you want to generate PDBs for a release build that
you do not want to be debuggable.

Also check this article by John Robbins: PDB Files: What Every Developer Must Know

What is the use of removing pdb files?

PDB stands for Program Database, a proprietary file format (developed by Microsoft) for storing debugging information about a program (or, commonly, program modules such as a DLL or EXE)
Without the PDB files, it would be impossible to debug a release build by anything other than address-level debugging.

So, in brief, it's not required to run the application. It's just required once you fire up a debugger.

PDB files in Visual Studio bin\debug folders

From MSDN:

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.

So it looks like the "issue" here (for lack of a better word) is that some of your DLLs are being built in debug mode (and hence emitting PDB files), and some are being built in release mode (hence not emitting PDB files). If that's the case, it should be easy to fix -- go into each project and update its build settings. This would be the default scenario, if you haven't done any tweaking of command line options.

However, it will get trickier if that isn't the case. Maybe you're all in release or debug mode. Now you need to look at the command line compile options (specified in the project properties) for each project. Update them to /debug accordingly if you want the debugger, or remove it if you don't.

Edit in Response to Edit

Yes, the DLL files "know" that they have PDB files, and have paths to them, but that doesn't mean too much. Copying just DLL files to a given directory, as others have mentioned, won't clear this issue up. You need the PDB files as well.

Copying individual files in Windows, with the exception of certain "bundle"-type files (I don't know Microsoft's term for this, but "complete HTML packages" are the concept) doesn't copy associated files. DLL files aren't assembled in the "bundle" way, so copying them leaves their PDB file behind.

I'd say the only answer you're going to have is to update your process for getting the DLL files to those central locations, and include the PDB files ... I'd love to be proven wrong on that, though!



Related Topics



Leave a reply



Submit