38

I have a lot of files in .pdb format, some of them downloaded, but until now I can't use or read what's inside, so I'm looking for how to read and view the .pdb file format from MS Windows XP.

Any of you that may know how to open it?

valiano
  • 16,433
  • 7
  • 64
  • 79
jones
  • 631
  • 3
  • 9
  • 20

5 Answers5

46

If you mean PDB as in a "program database" that the debugger uses:

PDB files contain data about a file such as an EXE or DLL that is used to aid in debugging. There are public interfaces that allow you to extract data from the file. See examples here:

If you mean PDB as in a Palm Pilot Database, then I know nothing about it, but the file format is available here:

Lingo
  • 53
  • 6
Eilon
  • 25,582
  • 3
  • 84
  • 102
37

Microsoft released the source code of their PDB formats, so other compiler developers like the LLVM team can implement the PDB format easier.

https://github.com/Microsoft/microsoft-pdb/

To actually dump the output of a file, just use this:

https://github.com/Microsoft/microsoft-pdb/blob/master/cvdump/cvdump.exe

cvdump Whatever.pdb
kungfooman
  • 4,473
  • 1
  • 44
  • 33
  • 3
    Thanks.! Useful application. – Misha Sep 02 '16 at 10:46
  • will not run : --------------------------- Unsupported 16-Bit Application --------------------------- The program or feature "\??\C:\Users\ehfsbxw\Downloads\_Opera\cvdump.exe" cannot start or run due to incompatibity with 64-bit versions of Windows. Please contact the software vendor to ask if a 64-bit Windows compatible version is available. --------------------------- OK --------------------------- – Sasha Bond Apr 29 '18 at 16:30
  • 1
    Exactly, @SashaBond, none of this is complete ... and they don't seem to be working on it anymore. So the only option is to take what's there and attempt to make as much sense of it as possible. – 0xC0000022L Jul 05 '18 at 09:28
  • 1
    Works for me on Windows 10 x64. – Der_Meister Oct 17 '18 at 13:56
25

Portable PDB

Classic (non-portable) PDB

codevision
  • 5,165
  • 38
  • 50
Ohad Schneider
  • 36,600
  • 15
  • 168
  • 198
13

Nowadays, I highly recommend LLVM's PDB parser, llvm-pdbutil.

It is an excellent and feature rich PDB dumper and great to complement Microsoft's cvdump.
For details and documentation, see:

Some useful commands for getting started:

  • llvm-pdbutil dump -all your.pdb
  • llvm-pdbutil bytes -syms your.pdb
  • llvm-pdbutil -help

Getting llvm-pdbutil:

As per LLVM 7.0.0, the latest official release, llvm-pdbutil.exe is not distributed with the LLVM binaries, so it has to be built from source.

However, if you're OK with a non official, Windows 64-bit binary, my home-brewed llvm-pdbutil builds are available here (note Visual C++ 2015 Redistributable is required):

https://github.com/shaharv/llvm-pdbutil-builds/releases

Building llvm-pdbutil:

For building llvm-pdbutil from source on Windows, you'll have to get and setup LLVM build. Follow the instructions on https://llvm.org/docs/GettingStarted.html.

There are some needed additions for PDB support, though. To summarize (for VS 2017):

  • Clone the LLVM repo: git clone https://github.com/llvm/llvm-project.git
  • cd llvm-project
  • mkdir build && cd build
  • If not running from Visual Studio console: set VSINSTALLDIR=c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\.
  • cmake -G "Visual Studio 15 2017" -A x64 -Thost=x64 -DLLVM_ENABLE_DIA_SDK=ON ../llvm
  • In Visual Studio, build the Tools/llvm-pdbutil project.
valiano
  • 16,433
  • 7
  • 64
  • 79
6

You can use the DBH tool from Windows SDK.

&'C:\Program Files\Debugging Tools for Windows (x64)\dbh.exe' -v MySymbol.pdb dump
Der_Meister
  • 4,771
  • 2
  • 46
  • 53