Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the usage of pdb's (Program Debug DataBase)?

Tags:

When compiling a library or an application (e.g a Console Application in the Visual Studio IDE), in the Debug folder of the application, apart from the .dll or .exe, there will be one more file with extension ".pdb".

What is the exact usage of this .pdb file?

like image 625
Amit Avatar asked Sep 19 '09 17:09

Amit


People also ask

What is program debug database?

Program database (PDB) is a 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.

How do I use PDB debugging?

The easiest way to use the PDB file is to let Visual Studio do the heavy lifting - either launch your program with Visual Studio's "Debug" command (F5 by default), or run the program and use the "Attach to Process" item in Visual Studio's Debug menu.

What is .PDB file in C#?

A program database file (extension . pdb) is a binary file that contains type and symbolic debugging information gathered over the course of compiling and linking the project. A PDB file is created when you compile a C/C++ program with /ZI or /Zi or a Visual Basic, Visual C#, or JScript program with the /debug option.

What does PDB file contains?

A typical PDB formatted file includes a large "header" section of text that summarizes the protein, citation information, and the details of the structure solution, followed by the sequence and a long list of the atoms and their coordinates.


2 Answers

PDBs contain debugging symbols, so you can ship a compiled binary to your customer without exposing your source code algorithms and other private details to them.

If your app goes wrong on a customer site, you can get a crash dump from them (using DrWatson), bring it back to your dev workstation and debug the crash, the debugger will use the symbols file in conjunction with the crash to show you the source code, data structures etc. In many cases, all you have to do is open the crash dump and the debugger will take you directly to the source code of the exception, and show you variables and threads too.

That's the primary use of them, they're invaluable when a customer reports a crash. The things you need to know about using them though - they are only valid for the build that created them, so if you recompile, your symbols file is next to worthless.

John Robbins has an excellent article why you would use them.

like image 139
gbjbaanb Avatar answered Sep 18 '22 15:09

gbjbaanb


John Robbins has written some really great articles on PDBs lately:

  • PDB Files: What Every Developer Must Know
  • Visual Studio Remote Debugging and PDB Files
  • How Many Secrets do .NET PDB Files Really Contain?
  • Do PDB Files Affect Performance?
  • Correctly Creating Native C++ Release Build PDBs
like image 30
Richard Berg Avatar answered Sep 17 '22 15:09

Richard Berg