2 .\" Man page generated from reStructuredText.
4 .TH "LLVM-PDBUTIL" "1" "2018-08-02" "7" "LLVM"
6 llvm-pdbutil \- PDB File forensics and diagnostics
8 .nr rst2man-indent-level 0
12 level \\n[rst2man-indent-level]
13 level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
20 .\" .rstReportMargin pre:
22 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
23 . nr rst2man-indent-level +1
24 .\" .rstReportMargin post:
28 .\" indent \\n[an-margin]
29 .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
30 .nr rst2man-indent-level -1
31 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
32 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
51 \fI\%Filtering and Sorting Options\fP
53 \fI\%Symbol Type Options\fP
67 \fI\%MSF Container Options\fP
69 \fI\%Module & File Options\fP
71 \fI\%Symbol Options\fP
73 \fI\%Type Record Options\fP
75 \fI\%Miscellaneous Options\fP
87 \fI\%MSF File Options\fP
89 \fI\%PDB Stream Options\fP
91 \fI\%DBI Stream Options\fP
93 \fI\%Module Options\fP
95 \fI\%Type Record Options\fP
126 \fBllvm\-pdbutil\fP [\fIsubcommand\fP] [\fIoptions\fP]
129 Display types, symbols, CodeView records, and other information from a
130 PDB file, as well as manipulate and create PDB files. \fBllvm\-pdbutil\fP
131 is normally used by FileCheck\-based tests to test LLVM\(aqs PDB reading and
132 writing functionality, but can also be used for general PDB file investigation
133 and forensics, or as a replacement for cvdump.
136 \fBllvm\-pdbutil\fP is separated into several subcommands each tailored to
137 a different purpose. A brief summary of each command follows, with more detail
138 in the sections that follow.
143 \fI\%pretty\fP \- Dump symbol and type information in a format that
144 tries to look as much like the original source code as possible.
146 \fI\%dump\fP \- Dump low level types and structures from the PDB
147 file, including CodeView records, hash tables, PDB streams, etc.
149 \fI\%bytes\fP \- Dump data from the PDB file\(aqs streams, records,
150 types, symbols, etc as raw bytes.
152 \fI\%yaml2pdb\fP \- Given a yaml description of a PDB file, produce
153 a valid PDB file that matches that description.
155 \fI\%pdb2yaml\fP \- For a given PDB file, produce a YAML
156 description of some or all of the file in a way that the PDB can be
159 \fI\%merge\fP \- Given two PDBs, produce a third PDB that is the
160 result of merging the two input PDBs.
169 The \fBpretty\fP subcommand is built on the Windows DIA SDK, and as such is not
170 supported on non\-Windows platforms.
174 USAGE: \fBllvm\-pdbutil\fP pretty [\fIoptions\fP] <input PDB file>
177 The \fIpretty\fP subcommand displays a very high level representation of your
178 program\(aqs debug info. Since it is built on the Windows DIA SDK which is the
179 standard API that Windows tools and debuggers query debug information, it
180 presents a more authoritative view of how a debugger is going to interpret your
181 debug information than a mode which displays low\-level CodeView records.
183 .SS Filtering and Sorting Options
188 \fIexclude\fP filters take priority over \fIinclude\fP filters. So if a filter
189 matches both an include and an exclude rule, then it is excluded.
194 .B \-exclude\-compilands=<string>
195 When dumping compilands, compiland source\-file contributions, or per\-compiland
196 symbols, this option instructs \fBllvm\-pdbutil\fP to omit any compilands that
197 match the specified regular expression.
201 .B \-exclude\-symbols=<string>
202 When dumping global, public, or per\-compiland symbols, this option instructs
203 \fBllvm\-pdbutil\fP to omit any symbols that match the specified regular
208 .B \-exclude\-types=<string>
209 When dumping types, this option instructs \fBllvm\-pdbutil\fP to omit any types
210 that match the specified regular expression.
214 .B \-include\-compilands=<string>
215 When dumping compilands, compiland source\-file contributions, or per\-compiland
216 symbols, limit the initial search to only those compilands that match the
217 specified regular expression.
221 .B \-include\-symbols=<string>
222 When dumping global, public, or per\-compiland symbols, limit the initial
223 search to only those symbols that match the specified regular expression.
227 .B \-include\-types=<string>
228 When dumping types, limit the initial search to only those types that match
229 the specified regular expression.
233 .B \-min\-class\-padding=<uint>
234 Only display types that have at least the specified amount of alignment
235 padding, accounting for padding in base classes and aggregate field members.
239 .B \-min\-class\-padding\-imm=<uint>
240 Only display types that have at least the specified amount of alignment
241 padding, ignoring padding in base classes and aggregate field members.
245 .B \-min\-type\-size=<uint>
246 Only display types T where sizeof(T) is greater than or equal to the specified
251 .B \-no\-compiler\-generated
252 Don\(aqt show compiler generated types and symbols
256 .B \-no\-enum\-definitions
257 When dumping an enum, don\(aqt show the full enum (e.g. the individual enumerator
262 .B \-no\-system\-libs
263 Don\(aqt show symbols from system libraries
265 .SS Symbol Type Options
269 Implies all other options in this category.
273 .B \-class\-definitions=<format>
274 Displays class definitions in the specified format.
280 =all \- Display all class members including data, constants, typedefs, functions, etc (default)
281 =layout \- Only display members that contribute to class size.
282 =none \- Don\(aqt display class definitions (e.g. only display the name and base list)
291 Displays classes in the specified order.
297 =none \- Undefined / no particular sort order (default)
298 =name \- Sort classes by name
299 =size \- Sort classes by size
300 =padding \- Sort classes by amount of padding
301 =padding\-pct \- Sort classes by percentage of space consumed by padding
302 =padding\-imm \- Sort classes by amount of immediate padding
303 =padding\-pct\-imm \- Sort classes by percentage of space consumed by immediate padding
311 .B \-class\-recurse\-depth=<uint>
312 When dumping class definitions, stop after recursing the specified number of times. The
313 default is 0, which is no limit.
323 Display compilands (e.g. object files)
333 Dump external (e.g. exported) symbols
343 Dump the mappings between source lines and code addresses.
348 Display symbols (variables, functions, etc) for each compiland
352 .B \-sym\-types=<types>
353 Type of symbols to dump when \-globals, \-externals, or \-module\-syms is
354 specified. (default all)
360 =thunks \- Display thunk symbols
361 =data \- Display data symbols
362 =funcs \- Display function symbols
363 =all \- Display all symbols (default)
371 .B \-symbol\-order=<order>
372 For symbols dumped via the \-module\-syms, \-globals, or \-externals options, sort
373 the results in specified order.
379 =none \- Undefined / no particular sort order
380 =name \- Sort symbols by name
381 =size \- Sort symbols by size
390 Display typedef types
395 Display all types (implies \-classes, \-enums, \-typedefs)
401 Force color output on or off. By default, color if used if outputting to a
406 .B \-load\-address=<uint>
407 When displaying relative virtual addresses, assume the process is loaded at the
408 given address and display what would be the absolute address.
412 USAGE: \fBllvm\-pdbutil\fP dump [\fIoptions\fP] <input PDB file>
415 The \fBdump\fP subcommand displays low level information about the structure of a
416 PDB file. It is used heavily by LLVM\(aqs testing infrastructure, but can also be
417 used for PDB forensics. It serves a role similar to that of Microsoft\(aqs
423 The \fBdump\fP subcommand exposes internal details of the file format. As
424 such, the reader should be familiar with /PDB/index before using this
429 .SS MSF Container Options
433 dump a summary of all of the streams in the PDB file.
438 In conjunction with \fI\%\-streams\fP, add information to the output about
439 what blocks the specified stream occupies.
444 Dump MSF and PDB header information.
446 .SS Module & File Options
450 For all options that dump information from each module/compiland, limit to
451 the specified module.
456 Dump the source files that contribute to each displayed module.
461 Dump inlinee line information (DEBUG_S_INLINEELINES CodeView subsection)
466 Dump line information (DEBUG_S_LINES CodeView subsection)
471 Dump compiland information
476 Dump cross module exports (DEBUG_S_CROSSSCOPEEXPORTS CodeView subsection)
481 Dump cross module imports (DEBUG_S_CROSSSCOPEIMPORTS CodeView subsection)
487 dump global symbol records
492 dump additional information about the globals, such as hash buckets and hash
498 dump public symbol records
503 dump additional information about the publics, such as hash buckets and hash
509 dump symbols (functions, variables, etc) for each module dumped.
514 For each symbol record dumped as a result of the \fI\%\-symbols\fP option,
515 display the full bytes of the record in binary as well.
517 .SS Type Record Options
521 Dump CodeView type records from TPI stream
526 Dump additional information from the TPI stream, such as hashes and the type
532 For each type record dumped, display the full bytes of the record in binary as
537 .B \-type\-index=<uint>
538 Only dump types with the specified type index.
543 Dump CodeView type records from IPI stream.
548 Dump additional information from the IPI stream, such as hashes and the type
554 For each ID record dumped, display the full bytes of the record in binary as
559 .B \-id\-index=<uint>
560 only dump ID records with the specified hexadecimal type index.
565 When used in conjunction with \fI\%\-type\-index\fP or \fI\%\-id\-index\fP,
566 dumps the entire dependency graph for the specified index instead of just the
567 single record with the specified index. For example, if type index 0x4000 is
568 a function whose return type has index 0x3000, and you specify
569 \fI\-dependents=0x4000\fP, then this would dump both records (as well as any other
570 dependents in the tree).
572 .SS Miscellaneous Options
576 Implies most other options.
580 .B \-section\-contribs
581 Dump section contributions.
585 .B \-section\-headers
586 Dump image section headers.
596 Dump PDB string table.
600 USAGE: \fBllvm\-pdbutil\fP bytes [\fIoptions\fP] <input PDB file>
603 Like the \fBdump\fP subcommand, the \fBbytes\fP subcommand displays low level
604 information about the structure of a PDB file, but it is used for even deeper
605 forensics. The \fBbytes\fP subcommand finds various structures in a PDB file
606 based on the command line options specified, and dumps them in hex. Someone
607 working on support for emitting PDBs would use this heavily, for example, to
608 compare one PDB against another PDB to ensure byte\-for\-byte compatibility. It
609 is not enough to simply compare the bytes of an entire file, or an entire stream
610 because it\(aqs perfectly fine for the same structure to exist at different
611 locations in two different PDBs, and "finding" the structure is half the battle.
616 .B \-block\-range=<start[\-end]>
617 Dump binary data from specified range of MSF file blocks.
621 .B \-byte\-range=<start[\-end]>
622 Dump binary data from specified range of bytes in the file.
627 Dump the MSF free page map.
631 .B \-stream\-data=<string>
632 Dump binary data from the specified streams. Format is SN[:Start][@Size].
633 For example, \fI\-stream\-data=7:3@12\fP dumps 12 bytes from stream 7, starting
634 at offset 3 in the stream.
636 .SS PDB Stream Options
640 Dump bytes of PDB Name Map
642 .SS DBI Stream Options
646 Dump the edit and continue map substream of the DBI stream.
651 Dump the file info substream of the DBI stream.
656 Dump the modi substream of the DBI stream.
661 Dump section contributions substream of the DBI stream.
666 Dump the section map from the DBI stream.
671 Dump the type server map from the DBI stream.
677 Limit all options in this category to the specified module index. By default,
678 options in this category will dump bytes from all modules.
683 Dump the bytes of each module\(aqs C13 debug subsection.
688 When specified with \fI\%\-chunks\fP, split the C13 debug subsection into a
689 separate chunk for each subsection type, and dump them separately.
694 Dump the symbol record substream from each module.
696 .SS Type Record Options
700 Dump the record from the IPI stream with the given type index.
705 Dump the record from the TPI stream with the given type index.
709 USAGE: \fBllvm\-pdbutil\fP pdb2yaml [\fIoptions\fP] <input PDB file>
714 USAGE: \fBllvm\-pdbutil\fP yaml2pdb [\fIoptions\fP] <input YAML file>
717 Generate a PDB file from a YAML description. The YAML syntax is not described
718 here. Instead, use \fI\%llvm\-pdbutil pdb2yaml\fP and
719 examine the output for an example starting point.
723 .B \-pdb=<file\-name>
726 Write the resulting PDB to the specified file.
729 USAGE: \fBllvm\-pdbutil\fP merge [\fIoptions\fP] <input PDB file 1> <input PDB file 2>
732 Merge two PDB files into a single file.
736 .B \-pdb=<file\-name>
739 Write the resulting PDB to the specified file.
741 Maintained by The LLVM Team (http://llvm.org/).
743 2003-2018, LLVM Project
744 .\" Generated by docutils manpage writer.