xref: /freebsd/usr.bin/clang/llvm-pdbutil/llvm-pdbutil.1 (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
Man page generated from reStructuredText.
. . .nr rst2man-indent-level 0 . \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .rstReportMargin pre:
. RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .rstReportMargin post:
.. . RE indent \\n[an-margin]
old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1 new: \\n[rst2man-indent\\n[rst2man-indent-level]]
..
"LLVM-PDBUTIL" "1" "2023-05-24" "16" "LLVM"
NAME
llvm-pdbutil - PDB File forensics and diagnostics NDENT 0.0
\(bu 2
\%Synopsis
\(bu 2
\%Description
\(bu 2
\%Subcommands NDENT 2.0
\(bu 2
\%pretty NDENT 2.0
\(bu 2
\%Summary
\(bu 2
\%Options NDENT 2.0
\(bu 2
\%Filtering and Sorting Options
\(bu 2
\%Symbol Type Options
\(bu 2
\%Other Options NINDENT NINDENT
\(bu 2
\%dump NDENT 2.0
\(bu 2
\%Summary
\(bu 2
\%Options NDENT 2.0
\(bu 2
\%MSF Container Options
\(bu 2
\%Module & File Options
\(bu 2
\%Symbol Options
\(bu 2
\%Type Record Options
\(bu 2
\%Miscellaneous Options NINDENT NINDENT
\(bu 2
\%bytes NDENT 2.0
\(bu 2
\%Summary
\(bu 2
\%Options NDENT 2.0
\(bu 2
\%MSF File Options
\(bu 2
\%PDB Stream Options
\(bu 2
\%DBI Stream Options
\(bu 2
\%Module Options
\(bu 2
\%Type Record Options NINDENT NINDENT
\(bu 2
\%pdb2yaml NDENT 2.0
\(bu 2
\%Summary
\(bu 2
\%Options NINDENT
\(bu 2
\%yaml2pdb NDENT 2.0
\(bu 2
\%Summary
\(bu 2
\%Options NINDENT
\(bu 2
\%merge NDENT 2.0
\(bu 2
\%Summary
\(bu 2
\%Options NINDENT NINDENT NINDENT
SYNOPSIS
llvm-pdbutil [subcommand] [options]
DESCRIPTION
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\(aqs PDB reading and writing functionality, but can also be used for general PDB file investigation and forensics, or as a replacement for cvdump.
SUBCOMMANDS
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. NDENT 0.0 NDENT 3.5 NDENT 0.0
\(bu 2
\%pretty - Dump symbol and type information in a format that tries to look as much like the original source code as possible.
\(bu 2
\%dump - Dump low level types and structures from the PDB file, including CodeView records, hash tables, PDB streams, etc.
\(bu 2
\%bytes - Dump data from the PDB file\(aqs streams, records, types, symbols, etc as raw bytes.
\(bu 2
\%yaml2pdb - Given a yaml description of a PDB file, produce a valid PDB file that matches that description.
\(bu 2
\%pdb2yaml - 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.
\(bu 2
\%merge - Given two PDBs, produce a third PDB that is the result of merging the two input PDBs. NINDENT NINDENT NINDENT
pretty
IMPORTANT: NDENT 0.0 NDENT 3.5 The pretty subcommand is built on the Windows DIA SDK, and as such is not supported on non-Windows platforms. NINDENT NINDENT USAGE: llvm-pdbutil pretty [options] <input PDB file>
Summary
The pretty subcommand displays a very high level representation of your program\(aqs 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.
Options
Filtering and Sorting Options
NOTE: NDENT 0.0 NDENT 3.5 exclude filters take priority over include filters. So if a filter matches both an include and an exclude rule, then it is excluded. NINDENT NINDENT NDENT 0.0

-exclude-compilands=<string> When dumping compilands, compiland source-file contributions, or per-compiland symbols, this option instructs llvm-pdbutil to omit any compilands that match the specified regular expression. NINDENT NDENT 0.0

-exclude-symbols=<string> When dumping global, public, or per-compiland symbols, this option instructs llvm-pdbutil to omit any symbols that match the specified regular expression. NINDENT NDENT 0.0

-exclude-types=<string> When dumping types, this option instructs llvm-pdbutil to omit any types that match the specified regular expression. NINDENT NDENT 0.0

-include-compilands=<string> When dumping compilands, compiland source-file contributions, or per-compiland symbols, limit the initial search to only those compilands that match the specified regular expression. NINDENT NDENT 0.0

-include-symbols=<string> When dumping global, public, or per-compiland symbols, limit the initial search to only those symbols that match the specified regular expression. NINDENT NDENT 0.0

-include-types=<string> When dumping types, limit the initial search to only those types that match the specified regular expression. NINDENT NDENT 0.0

-min-class-padding=<uint> Only display types that have at least the specified amount of alignment padding, accounting for padding in base classes and aggregate field members. NINDENT NDENT 0.0

-min-class-padding-imm=<uint> Only display types that have at least the specified amount of alignment padding, ignoring padding in base classes and aggregate field members. NINDENT NDENT 0.0

-min-type-size=<uint> Only display types T where sizeof(T) is greater than or equal to the specified amount. NINDENT NDENT 0.0

-no-compiler-generated Don\(aqt show compiler generated types and symbols NINDENT NDENT 0.0

-no-enum-definitions When dumping an enum, don\(aqt show the full enum (e.g. the individual enumerator values). NINDENT NDENT 0.0

-no-system-libs Don\(aqt show symbols from system libraries NINDENT

Symbol Type Options
NDENT 0.0

-all Implies all other options in this category. NINDENT NDENT 0.0

-class-definitions=<format> Displays class definitions in the specified format. NDENT 7.0 NDENT 3.5

=all - Display all class members including data, constants, typedefs, functions, etc (default)
=layout - Only display members that contribute to class size.
=none - Don\(aqt display class definitions (e.g. only display the name and base list)
NINDENT NINDENT NINDENT NDENT 0.0

-class-order Displays classes in the specified order. NDENT 7.0 NDENT 3.5

=none - Undefined / no particular sort order (default)
=name - Sort classes by name
=size - Sort classes by size
=padding - Sort classes by amount of padding
=padding-pct - Sort classes by percentage of space consumed by padding
=padding-imm - Sort classes by amount of immediate padding
=padding-pct-imm - Sort classes by percentage of space consumed by immediate padding
NINDENT NINDENT NINDENT NDENT 0.0

-class-recurse-depth=<uint> When dumping class definitions, stop after recursing the specified number of times. The default is 0, which is no limit. NINDENT NDENT 0.0

-classes Display classes NINDENT NDENT 0.0

-compilands Display compilands (e.g. object files) NINDENT NDENT 0.0

-enums Display enums NINDENT NDENT 0.0

-externals Dump external (e.g. exported) symbols NINDENT NDENT 0.0

-globals Dump global symbols NINDENT NDENT 0.0

-lines Dump the mappings between source lines and code addresses. NINDENT NDENT 0.0

-module-syms Display symbols (variables, functions, etc) for each compiland NINDENT NDENT 0.0

-sym-types=<types> Type of symbols to dump when -globals, -externals, or -module-syms is specified. (default all) NDENT 7.0 NDENT 3.5

=thunks - Display thunk symbols
=data - Display data symbols
=funcs - Display function symbols
=all - Display all symbols (default)
NINDENT NINDENT NINDENT NDENT 0.0

-symbol-order=<order> For symbols dumped via the -module-syms, -globals, or -externals options, sort the results in specified order. NDENT 7.0 NDENT 3.5

=none - Undefined / no particular sort order
=name - Sort symbols by name
=size - Sort symbols by size
NINDENT NINDENT NINDENT NDENT 0.0

-typedefs Display typedef types NINDENT NDENT 0.0

-types Display all types (implies -classes, -enums, -typedefs) NINDENT

Other Options
NDENT 0.0

-color-output Force color output on or off. By default, color if used if outputting to a terminal. NINDENT NDENT 0.0

-load-address=<uint> When displaying relative virtual addresses, assume the process is loaded at the given address and display what would be the absolute address. NINDENT

dump
USAGE: llvm-pdbutil dump [options] <input PDB file>
Summary
The dump subcommand displays low level information about the structure of a PDB file. It is used heavily by LLVM\(aqs testing infrastructure, but can also be used for PDB forensics. It serves a role similar to that of Microsoft\(aqs cvdump tool. NOTE: NDENT 0.0 NDENT 3.5 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. NINDENT NINDENT
Options
MSF Container Options
NDENT 0.0

-streams dump a summary of all of the streams in the PDB file. NINDENT NDENT 0.0

-stream-blocks In conjunction with \%-streams, add information to the output about what blocks the specified stream occupies. NINDENT NDENT 0.0

-summary Dump MSF and PDB header information. NINDENT

Module & File Options
NDENT 0.0

-modi=<uint> For all options that dump information from each module/compiland, limit to the specified module. NINDENT NDENT 0.0

-files Dump the source files that contribute to each displayed module. NINDENT NDENT 0.0

-il Dump inlinee line information (DEBUG_S_INLINEELINES CodeView subsection) NINDENT NDENT 0.0

-l Dump line information (DEBUG_S_LINES CodeView subsection) NINDENT NDENT 0.0

-modules Dump compiland information NINDENT NDENT 0.0

-xme Dump cross module exports (DEBUG_S_CROSSSCOPEEXPORTS CodeView subsection) NINDENT NDENT 0.0

-xmi Dump cross module imports (DEBUG_S_CROSSSCOPEIMPORTS CodeView subsection) NINDENT

Symbol Options
NDENT 0.0

-globals dump global symbol records NINDENT NDENT 0.0

-global-extras dump additional information about the globals, such as hash buckets and hash values. NINDENT NDENT 0.0

-publics dump public symbol records NINDENT NDENT 0.0

-public-extras dump additional information about the publics, such as hash buckets and hash values. NINDENT NDENT 0.0

-symbols dump symbols (functions, variables, etc) for each module dumped. NINDENT NDENT 0.0

-sym-data For each symbol record dumped as a result of the \%-symbols option, display the full bytes of the record in binary as well. NINDENT

Type Record Options
NDENT 0.0

-types Dump CodeView type records from TPI stream NINDENT NDENT 0.0

-type-extras Dump additional information from the TPI stream, such as hashes and the type index offsets array. NINDENT NDENT 0.0

-type-data For each type record dumped, display the full bytes of the record in binary as well. NINDENT NDENT 0.0

-type-index=<uint> Only dump types with the specified type index. NINDENT NDENT 0.0

-ids Dump CodeView type records from IPI stream. NINDENT NDENT 0.0

-id-extras Dump additional information from the IPI stream, such as hashes and the type index offsets array. NINDENT NDENT 0.0

-id-data For each ID record dumped, display the full bytes of the record in binary as well. NINDENT NDENT 0.0

-id-index=<uint> only dump ID records with the specified hexadecimal type index. NINDENT NDENT 0.0

-dependents 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). NINDENT

Miscellaneous Options
NDENT 0.0

-all Implies most other options. NINDENT NDENT 0.0

-section-contribs Dump section contributions. NINDENT NDENT 0.0

-section-headers Dump image section headers. NINDENT NDENT 0.0

-section-map Dump section map. NINDENT NDENT 0.0

-string-table Dump PDB string table. NINDENT

bytes
USAGE: llvm-pdbutil bytes [options] <input PDB file>
Summary
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\(aqs perfectly fine for the same structure to exist at different locations in two different PDBs, and \(dqfinding\(dq the structure is half the battle.
Options
MSF File Options
NDENT 0.0

-block-range=<start[-end]> Dump binary data from specified range of MSF file blocks. NINDENT NDENT 0.0

-byte-range=<start[-end]> Dump binary data from specified range of bytes in the file. NINDENT NDENT 0.0

-fpm Dump the MSF free page map. NINDENT NDENT 0.0

-stream-data=<string> Dump binary data from the specified streams. Format is SN[:Start][@Size]. For example, -stream-data=7:3@12 dumps 12 bytes from stream 7, starting at offset 3 in the stream. NINDENT

PDB Stream Options
NDENT 0.0

-name-map Dump bytes of PDB Name Map NINDENT

DBI Stream Options
NDENT 0.0

-ec Dump the edit and continue map substream of the DBI stream. NINDENT NDENT 0.0

-files Dump the file info substream of the DBI stream. NINDENT NDENT 0.0

-modi Dump the modi substream of the DBI stream. NINDENT NDENT 0.0

-sc Dump section contributions substream of the DBI stream. NINDENT NDENT 0.0

-sm Dump the section map from the DBI stream. NINDENT NDENT 0.0

-type-server Dump the type server map from the DBI stream. NINDENT

Module Options
NDENT 0.0

-mod=<uint> Limit all options in this category to the specified module index. By default, options in this category will dump bytes from all modules. NINDENT NDENT 0.0

-chunks Dump the bytes of each module\(aqs C13 debug subsection. NINDENT NDENT 0.0

-split-chunks When specified with \%-chunks, split the C13 debug subsection into a separate chunk for each subsection type, and dump them separately. NINDENT NDENT 0.0

-syms Dump the symbol record substream from each module. NINDENT

Type Record Options
NDENT 0.0

-id=<uint> Dump the record from the IPI stream with the given type index. NINDENT NDENT 0.0

-type=<uint> Dump the record from the TPI stream with the given type index. NINDENT

pdb2yaml
USAGE: llvm-pdbutil pdb2yaml [options] <input PDB file>
Summary
Options
yaml2pdb
USAGE: llvm-pdbutil yaml2pdb [options] <input YAML file>
Summary
Generate a PDB file from a YAML description. The YAML syntax is not described here. Instead, use \%llvm-pdbutil pdb2yaml and examine the output for an example starting point.
Options
NDENT 0.0

-pdb=<file-name> NINDENT Write the resulting PDB to the specified file.

merge
USAGE: llvm-pdbutil merge [options] <input PDB file 1> <input PDB file 2>
Summary
Merge two PDB files into a single file.
Options
NDENT 0.0

-pdb=<file-name> NINDENT Write the resulting PDB to the specified file.

AUTHOR
Maintained by the LLVM Team (https://llvm.org/).
COPYRIGHT
2003-2023, LLVM Project Generated by docutils manpage writer.
.