Tree @88fcc3a (Download .tar.gz)
llvm-pdbutil.rst @88fcc3a — view markup · raw · history · blame
llvm-pdbutil - PDB File forensics and diagnostics
Display types, symbols, CodeView records, and other information from a PDB file, as well as manipulate and create PDB files. :program:`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.
:program:`llvm-pdbutil` is separated into several subcommands each tailored to a different purpose. A brief summary of each command follows, with more detail in the sections that follow.
- :ref:`pretty_subcommand` - Dump symbol and type information in a format that tries to look as much like the original source code as possible.
- :ref:`dump_subcommand` - Dump low level types and structures from the PDB file, including CodeView records, hash tables, PDB streams, etc.
- :ref:`bytes_subcommand` - Dump data from the PDB file's streams, records, types, symbols, etc as raw bytes.
- :ref:`yaml2pdb_subcommand` - Given a yaml description of a PDB file, produce a valid PDB file that matches that description.
- :ref:`pdb2yaml_subcommand` - For a given PDB file, produce a YAML description of some or all of the file in a way that the PDB can be reconstructed.
- :ref:`merge_subcommand` - Given two PDBs, produce a third PDB that is the result of merging the two input PDBs.
The pretty subcommand is built on the Windows DIA SDK, and as such is not supported on non-Windows platforms.
USAGE: :program:`llvm-pdbutil` pretty [options] <input PDB file>
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.
USAGE: :program:`llvm-pdbutil` dump [options] <input PDB file>
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.
The dump subcommand exposes internal details of the file format. As such, the reader should be familiar with :doc:`/PDB/index` before using this command.
USAGE: :program:`llvm-pdbutil` bytes [options] <input PDB file>
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.
USAGE: :program:`llvm-pdbutil` yaml2pdb [options] <input YAML file>
Generate a PDB file from a YAML description. The YAML syntax is not described here. Instead, use :ref:`llvm-pdbutil pdb2yaml <pdb2yaml_subcommand>` and examine the output for an example starting point.
Write the resulting PDB to the specified file.