Display types, symbols, CodeView records, and other information from a
PDB file, as well as manipulate and create PDB files. llvm-pdbutil
is normally used by FileCheck-based tests to test LLVM’s PDB reading and
writing functionality, but can also be used for general PDB file investigation
and forensics, or as a replacement for cvdump.

The pretty subcommand displays a very high level representation of your
program’s debug info. Since it is built on the Windows DIA SDK which is the
standard API that Windows tools and debuggers query debug information, it
presents a more authoritative view of how a debugger is going to interpret your
debug information than a mode which displays low-level CodeView records.

The dump subcommand displays low level information about the structure of a
PDB file. It is used heavily by LLVM’s testing infrastructure, but can also be
used for PDB forensics. It serves a role similar to that of Microsoft’s
cvdump tool.

Note

The dump subcommand exposes internal details of the file format. As
such, the reader should be familiar with The PDB File Format before using this
command.

When used in conjunction with -type-index or -id-index,
dumps the entire dependency graph for the specified index instead of just the
single record with the specified index. For example, if type index 0x4000 is
a function whose return type has index 0x3000, and you specify
-dependents=0x4000, then this would dump both records (as well as any other
dependents in the tree).

Like the dump subcommand, the bytes subcommand displays low level
information about the structure of a PDB file, but it is used for even deeper
forensics. The bytes subcommand finds various structures in a PDB file
based on the command line options specified, and dumps them in hex. Someone
working on support for emitting PDBs would use this heavily, for example, to
compare one PDB against another PDB to ensure byte-for-byte compatibility. It
is not enough to simply compare the bytes of an entire file, or an entire stream
because it’s perfectly fine for the same structure to exist at different
locations in two different PDBs, and “finding” the structure is half the battle.