summaryrefslogtreecommitdiff
path: root/docs/CommandGuide
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-12-18 20:10:56 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-12-18 20:10:56 +0000
commit044eb2f6afba375a914ac9d8024f8f5142bb912e (patch)
tree1475247dc9f9fe5be155ebd4c9069c75aadf8c20 /docs/CommandGuide
parenteb70dddbd77e120e5d490bd8fbe7ff3f8fa81c6b (diff)
Notes
Diffstat (limited to 'docs/CommandGuide')
-rw-r--r--docs/CommandGuide/FileCheck.rst16
-rw-r--r--docs/CommandGuide/dsymutil.rst89
-rw-r--r--docs/CommandGuide/index.rst2
-rw-r--r--docs/CommandGuide/llc.rst8
-rw-r--r--docs/CommandGuide/lli.rst12
-rw-r--r--docs/CommandGuide/llvm-cov.rst48
-rw-r--r--docs/CommandGuide/llvm-dwarfdump.rst134
-rw-r--r--docs/CommandGuide/llvm-pdbutil.rst585
8 files changed, 861 insertions, 33 deletions
diff --git a/docs/CommandGuide/FileCheck.rst b/docs/CommandGuide/FileCheck.rst
index 8830c394b212..9078f65e01c5 100644
--- a/docs/CommandGuide/FileCheck.rst
+++ b/docs/CommandGuide/FileCheck.rst
@@ -86,6 +86,11 @@ OPTIONS
All other variables get undefined after each encountered ``CHECK-LABEL``.
+.. option:: -D<VAR=VALUE>
+
+ Sets a filecheck variable ``VAR`` with value ``VALUE`` that can be used in
+ ``CHECK:`` lines.
+
.. option:: -version
Show the version number of this program.
@@ -397,10 +402,11 @@ All FileCheck directives take a pattern to match.
For most uses of FileCheck, fixed string matching is perfectly sufficient. For
some things, a more flexible form of matching is desired. To support this,
FileCheck allows you to specify regular expressions in matching strings,
-surrounded by double braces: ``{{yourregex}}``. Because we want to use fixed
-string matching for a majority of what we do, FileCheck has been designed to
-support mixing and matching fixed string matching with regular expressions.
-This allows you to write things like this:
+surrounded by double braces: ``{{yourregex}}``. FileCheck implements a POSIX
+regular expression matcher; it supports Extended POSIX regular expressions
+(ERE). Because we want to use fixed string matching for a majority of what we
+do, FileCheck has been designed to support mixing and matching fixed string
+matching with regular expressions. This allows you to write things like this:
.. code-block:: llvm
@@ -434,7 +440,7 @@ The first check line matches a regex ``%[a-z]+`` and captures it into the
variable ``REGISTER``. The second line verifies that whatever is in
``REGISTER`` occurs later in the file after an "``andw``". :program:`FileCheck`
variable references are always contained in ``[[ ]]`` pairs, and their names can
-be formed with the regex ``[a-zA-Z][a-zA-Z0-9]*``. If a colon follows the name,
+be formed with the regex ``[a-zA-Z_][a-zA-Z0-9_]*``. If a colon follows the name,
then it is a definition of the variable; otherwise, it is a use.
:program:`FileCheck` variables can be defined multiple times, and uses always
diff --git a/docs/CommandGuide/dsymutil.rst b/docs/CommandGuide/dsymutil.rst
new file mode 100644
index 000000000000..a29bc3c295c7
--- /dev/null
+++ b/docs/CommandGuide/dsymutil.rst
@@ -0,0 +1,89 @@
+dsymutil - manipulate archived DWARF debug symbol files
+=======================================================
+
+SYNOPSIS
+--------
+
+| :program:`dsymutil` [*options*] *executable*
+
+DESCRIPTION
+-----------
+
+:program:`dsymutil` links the DWARF debug information found in the object files
+for an executable *executable* by using debug symbols information contained in
+its symbol table. By default, the linked debug information is placed in a
+``.dSYM`` bundle with the same name as the executable.
+
+OPTIONS
+-------
+.. option:: --arch=<arch>
+
+ Link DWARF debug information only for specified CPU architecture types.
+ Architectures may be specified by name. When using this option, an error will
+ be returned if any architectures can not be properly linked. This option can
+ be specified multiple times, once for each desired architecture. All CPU
+ architectures will be linked by default and any architectures that can't be
+ properly linked will cause :program:`dsymutil` to return an error.
+
+.. option:: --dump-debug-map
+
+ Dump the *executable*'s debug-map (the list of the object files containing the
+ debug information) in YAML format and exit. Not DWARF link will take place.
+
+.. option:: -f, --flat
+
+ Produce a flat dSYM file. A ``.dwarf`` extension will be appended to the
+ executable name unless the output file is specified using the -o option.
+
+.. option:: --no-odr
+
+ Do not use ODR (One Definition Rule) for uniquing C++ types.
+
+.. option:: --no-output
+
+ Do the link in memory, but do not emit the result file.
+
+.. option:: --no-swiftmodule-timestamp
+
+ Don't check the timestamp for swiftmodule files.
+
+.. option:: -j <n>, --num-threads=<n>
+
+ Specifies the maximum number (``n``) of simultaneous threads to use when
+ linking multiple architectures.
+
+.. option:: -o <filename>
+
+ Specifies an alternate ``path`` to place the dSYM bundle. The default dSYM
+ bundle path is created by appending ``.dSYM`` to the executable name.
+
+.. option:: --oso-prepend-path=<path>
+
+ Specifies a ``path`` to prepend to all debug symbol object file paths.
+
+.. option:: -s, --symtab
+
+ Dumps the symbol table found in *executable* or object file(s) and exits.
+
+.. option:: -v, --verbose
+
+ Display verbose information when linking.
+
+.. option:: --version
+
+ Display the version of the tool.
+
+.. option:: -y
+
+ Treat *executable* as a YAML debug-map rather than an executable.
+
+EXIT STATUS
+-----------
+
+:program:`dsymutil` returns 0 if the DWARF debug information was linked
+successfully. Otherwise, it returns 1.
+
+SEE ALSO
+--------
+
+:manpage:`llvm-dwarfdump(1)`
diff --git a/docs/CommandGuide/index.rst b/docs/CommandGuide/index.rst
index 46db57f1c845..805df00c1738 100644
--- a/docs/CommandGuide/index.rst
+++ b/docs/CommandGuide/index.rst
@@ -30,6 +30,7 @@ Basic Commands
llvm-stress
llvm-symbolizer
llvm-dwarfdump
+ dsymutil
Debugging Tools
~~~~~~~~~~~~~~~
@@ -51,4 +52,5 @@ Developer Tools
tblgen
lit
llvm-build
+ llvm-pdbutil
llvm-readobj
diff --git a/docs/CommandGuide/llc.rst b/docs/CommandGuide/llc.rst
index 5094259f9f95..95945e68d13f 100644
--- a/docs/CommandGuide/llc.rst
+++ b/docs/CommandGuide/llc.rst
@@ -132,6 +132,14 @@ End-user Options
Specify which EABI version should conform to. Valid EABI versions are *gnu*,
*4* and *5*. Default value (*default*) depends on the triple.
+.. option:: -stack-size-section
+
+ Emit the .stack_sizes section which contains stack size metadata. The section
+ contains an array of pairs of function symbol references (8 byte) and stack
+ sizes (unsigned LEB128). The stack size values only include the space allocated
+ in the function prologue. Functions with dynamic stack allocations are not
+ included.
+
Tuning/Configuration Options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/docs/CommandGuide/lli.rst b/docs/CommandGuide/lli.rst
index 9da13ee47e0e..58481073d069 100644
--- a/docs/CommandGuide/lli.rst
+++ b/docs/CommandGuide/lli.rst
@@ -122,7 +122,7 @@ CODE GENERATION OPTIONS
Choose the code model from:
- .. code-block:: perl
+ .. code-block:: text
default: Target default code model
small: Small code model
@@ -154,7 +154,7 @@ CODE GENERATION OPTIONS
Instruction schedulers available (before register allocation):
- .. code-block:: perl
+ .. code-block:: text
=default: Best scheduler for the target
=none: No scheduling: breadth first sequencing
@@ -168,7 +168,7 @@ CODE GENERATION OPTIONS
Register allocator to use (default=linearscan)
- .. code-block:: perl
+ .. code-block:: text
=bigblock: Big-block register allocator
=linearscan: linear scan register allocator =local - local register allocator
@@ -178,7 +178,7 @@ CODE GENERATION OPTIONS
Choose relocation model from:
- .. code-block:: perl
+ .. code-block:: text
=default: Target default relocation model
=static: Non-relocatable code =pic - Fully relocatable, position independent code
@@ -188,7 +188,7 @@ CODE GENERATION OPTIONS
Spiller to use (default=local)
- .. code-block:: perl
+ .. code-block:: text
=simple: simple spiller
=local: local spiller
@@ -197,7 +197,7 @@ CODE GENERATION OPTIONS
Choose style of code to emit from X86 backend:
- .. code-block:: perl
+ .. code-block:: text
=att: Emit AT&T-style assembly
=intel: Emit Intel-style assembly
diff --git a/docs/CommandGuide/llvm-cov.rst b/docs/CommandGuide/llvm-cov.rst
index 47db8d04e0b2..478ba0fb15e0 100644
--- a/docs/CommandGuide/llvm-cov.rst
+++ b/docs/CommandGuide/llvm-cov.rst
@@ -195,44 +195,53 @@ OPTIONS
.. option:: -show-line-counts
- Show the execution counts for each line. This is enabled by default, unless
- another ``-show`` option is used.
+ Show the execution counts for each line. Defaults to true, unless another
+ ``-show`` option is used.
.. option:: -show-expansions
Expand inclusions, such as preprocessor macros or textual inclusions, inline
- in the display of the source file.
+ in the display of the source file. Defaults to false.
.. option:: -show-instantiations
For source regions that are instantiated multiple times, such as templates in
``C++``, show each instantiation separately as well as the combined summary.
+ Defaults to true.
.. option:: -show-regions
Show the execution counts for each region by displaying a caret that points to
- the character where the region starts.
+ the character where the region starts. Defaults to false.
.. option:: -show-line-counts-or-regions
Show the execution counts for each line if there is only one region on the
line, but show the individual regions if there are multiple on the line.
+ Defaults to false.
-.. option:: -use-color[=VALUE]
+.. option:: -use-color
Enable or disable color output. By default this is autodetected.
-.. option:: -arch=<name>
+.. option:: -arch=[*NAMES*]
- If the covered binary is a universal binary, select the architecture to use.
- It is an error to specify an architecture that is not included in the
- universal binary or to use an architecture that does not match a
- non-universal binary.
+ Specify a list of architectures such that the Nth entry in the list
+ corresponds to the Nth specified binary. If the covered object is a universal
+ binary, this specifies the architecture to use. It is an error to specify an
+ architecture that is not included in the universal binary or to use an
+ architecture that does not match a non-universal binary.
.. option:: -name=<NAME>
Show code coverage only for functions with the given name.
+.. option:: -name-whitelist=<FILE>
+
+ Show code coverage only for functions listed in the given file. Each line in
+ the file should start with `whitelist_fun:`, immediately followed by the name
+ of the function to accept. This name can be a wildcard expression.
+
.. option:: -name-regex=<PATTERN>
Show code coverage only for functions that match the given regular expression.
@@ -288,6 +297,12 @@ OPTIONS
Show code coverage only for functions with region coverage less than the given
threshold.
+.. option:: -path-equivalence=<from>,<to>
+
+ Map the paths in the coverage data to local source file paths. This allows you
+ to generate the coverage data on one machine, and then use llvm-cov on a
+ different machine where you have the same files on a different path.
+
.. program:: llvm-cov report
.. _llvm-cov-report:
@@ -330,7 +345,11 @@ OPTIONS
.. option:: -show-functions
- Show coverage summaries for each function.
+ Show coverage summaries for each function. Defaults to false.
+
+.. option:: -show-instantiation-summary
+
+ Show statistics for all function instantiations. Defaults to false.
.. program:: llvm-cov export
@@ -363,3 +382,10 @@ OPTIONS
It is an error to specify an architecture that is not included in the
universal binary or to use an architecture that does not match a
non-universal binary.
+
+.. option:: -summary-only
+
+ Export only summary information for each file in the coverage data. This mode
+ will not export coverage information for smaller units such as individual
+ functions or regions. The result will be the same as produced by :program:
+ `llvm-cov report` command, but presented in JSON format rather than text.
diff --git a/docs/CommandGuide/llvm-dwarfdump.rst b/docs/CommandGuide/llvm-dwarfdump.rst
index 30c18adb7713..a3b62664cbe5 100644
--- a/docs/CommandGuide/llvm-dwarfdump.rst
+++ b/docs/CommandGuide/llvm-dwarfdump.rst
@@ -1,30 +1,142 @@
-llvm-dwarfdump - print contents of DWARF sections
-=================================================
+llvm-dwarfdump - dump and verify DWARF debug information
+========================================================
SYNOPSIS
--------
-:program:`llvm-dwarfdump` [*options*] [*filenames...*]
+:program:`llvm-dwarfdump` [*options*] [*filename ...*]
DESCRIPTION
-----------
-:program:`llvm-dwarfdump` parses DWARF sections in the object files
-and prints their contents in human-readable form.
+:program:`llvm-dwarfdump` parses DWARF sections in object files,
+archives, and `.dSYM` bundles and prints their contents in
+human-readable form. Only the .debug_info section is printed unless one of
+the section-specific options or :option:`--all` is specified.
OPTIONS
-------
-.. option:: -debug-dump=section
+.. option:: -a, --all
- Specify the DWARF section to dump.
- For example, use ``abbrev`` to dump the contents of ``.debug_abbrev`` section,
- ``loc.dwo`` to dump the contents of ``.debug_loc.dwo`` etc.
- See ``llvm-dwarfdump --help`` for the complete list of supported sections.
- Use ``all`` to dump all DWARF sections. It is the default.
+ Disassemble all supported DWARF sections.
+
+.. option:: --arch=<arch>
+
+ Dump DWARF debug information for the specified CPU architecture.
+ Architectures may be specified by name or by number. This
+ option can be specified multiple times, once for each desired
+ architecture. All CPU architectures will be printed by
+ default.
+
+.. option:: -c, --show-children
+
+ Show a debug info entry's children when using
+ the :option:`--debug-info`, :option:`--find`,
+ and :option:`--name` options.
+
+.. option:: -f <name>, --find=<name>
+
+ Search for the exact text <name> in the accelerator tables
+ and print the matching debug information entries.
+ When there is no accelerator tables or the name of the DIE
+ you are looking for is not found in the accelerator tables,
+ try using the slower but more complete :option:`--name` option.
+
+.. option:: -F, --show-form
+
+ Show DWARF form types after the DWARF attribute types.
+
+.. option:: -h, --help
+
+ Show help and usage for this command.
+
+.. option:: -i, --ignore-case
+
+ Ignore case distinctions in when searching entries by name
+ or by regular expression.
+
+.. option:: -n <pattern>, --name=<pattern>
+
+ Find and print all debug info entries whose name
+ (`DW_AT_name` attribute) matches the exact text in
+ <pattern>. Use the :option:`--regex` option to have
+ <pattern> become a regular expression for more flexible
+ pattern matching.
+
+.. option:: --lookup=<address>
+
+ Lookup <address> in the debug information and print out the file,
+ function, block, and line table details.
+
+.. option:: -o <path>, --out-file=<path>
+
+ Redirect output to a file specified by <path>.
+
+.. option:: -p, --show-parents
+
+ Show a debug info entry's parent objects when using the
+ :option:`--debug-info`, :option:`--find`, and
+ :option:`--name` options.
+
+.. option:: -r <n>, --recurse-depth=<n>
+
+ Only recurse to a maximum depth of <n> when dumping debug info
+ entries.
+
+.. option:: --statistics
+
+ Collect debug info quality metrics and print the results
+ as machine-readable single-line JSON output.
+
+.. option:: -x, --regex
+
+ Treat any <pattern> strings as regular expressions when searching
+ instead of just as an exact string match.
+
+.. option:: -u, --uuid
+
+ Show the UUID for each architecture.
+
+.. option:: --diff
+
+ Dump the output in a format that is more friendly for comparing
+ DWARF output from two different files.
+
+.. option:: -v, --verbose
+
+ Display verbose information when dumping. This can help to debug
+ DWARF issues.
+
+.. option:: --verify
+
+ Verify the structure of the DWARF information by verifying the
+ compile unit chains, DIE relationships graph, address
+ ranges, and more.
+
+.. option:: --version
+
+ Display the version of the tool.
+
+.. option:: --debug-abbrev, --debug-aranges, --debug-cu-index, --debug-frame [=<offset>], --debug-gnu-pubnames, --debug-gnu-pubtypes, --debug-info [=<offset>], --debug-line [=<offset>], --debug-loc [=<offset>], --debug-macro, --debug-pubnames, --debug-pubtypes, --debug-ranges, --debug-str, --debug-str-offsets, --debug-tu-index, --debug-types, --eh-frame, --gdb-index, --apple-names, --apple-types, --apple-namespaces, --apple-objc
+
+ Dump the specified DWARF section by name. Only the
+ `.debug_info` section is shown by default. Some entries
+ support adding an `=<offset>` as a way to provide an
+ optional offset of the exact entry to dump within the
+ respective section. When an offset is provided, only the
+ entry at that offset will be dumped, else the entire
+ section will be dumped. Children of items at a specific
+ offset can be dumped by also using the
+ :option:`--show-children` option where applicable.
EXIT STATUS
-----------
:program:`llvm-dwarfdump` returns 0 if the input files were parsed and dumped
successfully. Otherwise, it returns 1.
+
+SEE ALSO
+--------
+
+:manpage:`dsymutil(1)`
diff --git a/docs/CommandGuide/llvm-pdbutil.rst b/docs/CommandGuide/llvm-pdbutil.rst
new file mode 100644
index 000000000000..29d487e0e740
--- /dev/null
+++ b/docs/CommandGuide/llvm-pdbutil.rst
@@ -0,0 +1,585 @@
+llvm-pdbutil - PDB File forensics and diagnostics
+=================================================
+
+.. contents::
+ :local:
+
+Synopsis
+--------
+
+:program:`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. :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.
+
+Subcommands
+-----------
+
+: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.
+
+.. _pretty_subcommand:
+
+pretty
+~~~~~~
+
+.. program:: llvm-pdbutil pretty
+
+.. important::
+ 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>
+
+Summary
+^^^^^^^^^^^
+
+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.
+
+Options
+^^^^^^^
+
+Filtering and Sorting Options
++++++++++++++++++++++++++++++
+
+.. note::
+ *exclude* filters take priority over *include* filters. So if a filter
+ matches both an include and an exclude rule, then it is excluded.
+
+.. option:: -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.
+
+.. option:: -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.
+
+.. option:: -exclude-types=<string>
+
+ When dumping types, this option instructs **llvm-pdbutil** to omit any types
+ that match the specified regular expression.
+
+.. option:: -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.
+
+.. option:: -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.
+
+.. option:: -include-types=<string>
+
+ When dumping types, limit the initial search to only those types that match
+ the specified regular expression.
+
+.. option:: -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.
+
+.. option:: -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.
+
+.. option:: -min-type-size=<uint>
+
+ Only display types T where sizeof(T) is greater than or equal to the specified
+ amount.
+
+.. option:: -no-compiler-generated
+
+ Don't show compiler generated types and symbols
+
+.. option:: -no-enum-definitions
+
+ When dumping an enum, don't show the full enum (e.g. the individual enumerator
+ values).
+
+.. option:: -no-system-libs
+
+ Don't show symbols from system libraries
+
+Symbol Type Options
++++++++++++++++++++
+.. option:: -all
+
+ Implies all other options in this category.
+
+.. option:: -class-definitions=<format>
+
+ Displays class definitions in the specified format.
+
+ .. code-block:: text
+
+ =all - Display all class members including data, constants, typedefs, functions, etc (default)
+ =layout - Only display members that contribute to class size.
+ =none - Don't display class definitions (e.g. only display the name and base list)
+
+.. option:: -class-order
+
+ Displays classes in the specified order.
+
+ .. code-block:: text
+
+ =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
+
+.. option:: -class-recurse-depth=<uint>
+
+ When dumping class definitions, stop after recursing the specified number of times. The
+ default is 0, which is no limit.
+
+.. option:: -classes
+
+ Display classes
+
+.. option:: -compilands
+
+ Display compilands (e.g. object files)
+
+.. option:: -enums
+
+ Display enums
+
+.. option:: -externals
+
+ Dump external (e.g. exported) symbols
+
+.. option:: -globals
+
+ Dump global symbols
+
+.. option:: -lines
+
+ Dump the mappings between source lines and code addresses.
+
+.. option:: -module-syms
+
+ Display symbols (variables, functions, etc) for each compiland
+
+.. option:: -sym-types=<types>
+
+ Type of symbols to dump when -globals, -externals, or -module-syms is
+ specified. (default all)
+
+ .. code-block:: text
+
+ =thunks - Display thunk symbols
+ =data - Display data symbols
+ =funcs - Display function symbols
+ =all - Display all symbols (default)
+
+.. option:: -symbol-order=<order>
+
+ For symbols dumped via the -module-syms, -globals, or -externals options, sort
+ the results in specified order.
+
+ .. code-block:: text
+
+ =none - Undefined / no particular sort order
+ =name - Sort symbols by name
+ =size - Sort symbols by size
+
+.. option:: -typedefs
+
+ Display typedef types
+
+.. option:: -types
+
+ Display all types (implies -classes, -enums, -typedefs)
+
+Other Options
++++++++++++++
+
+.. option:: -color-output
+
+ Force color output on or off. By default, color if used if outputting to a
+ terminal.
+
+.. option:: -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.
+
+.. _dump_subcommand:
+
+dump
+~~~~
+
+USAGE: :program:`llvm-pdbutil` dump [*options*] <input PDB file>
+
+.. program:: llvm-pdbutil dump
+
+Summary
+^^^^^^^^^^^
+
+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 :doc:`/PDB/index` before using this
+ command.
+
+Options
+^^^^^^^
+
+MSF Container Options
++++++++++++++++++++++
+
+.. option:: -streams
+
+ dump a summary of all of the streams in the PDB file.
+
+.. option:: -stream-blocks
+
+ In conjunction with :option:`-streams`, add information to the output about
+ what blocks the specified stream occupies.
+
+.. option:: -summary
+
+ Dump MSF and PDB header information.
+
+Module & File Options
++++++++++++++++++++++
+
+.. option:: -modi=<uint>
+
+ For all options that dump information from each module/compiland, limit to
+ the specified module.
+
+.. option:: -files
+
+ Dump the source files that contribute to each displayed module.
+
+.. option:: -il
+
+ Dump inlinee line information (DEBUG_S_INLINEELINES CodeView subsection)
+
+.. option:: -l
+
+ Dump line information (DEBUG_S_LINES CodeView subsection)
+
+.. option:: -modules
+
+ Dump compiland information
+
+.. option:: -xme
+
+ Dump cross module exports (DEBUG_S_CROSSSCOPEEXPORTS CodeView subsection)
+
+.. option:: -xmi
+
+ Dump cross module imports (DEBUG_S_CROSSSCOPEIMPORTS CodeView subsection)
+
+Symbol Options
+++++++++++++++
+
+.. option:: -globals
+
+ dump global symbol records
+
+.. option:: -global-extras
+
+ dump additional information about the globals, such as hash buckets and hash
+ values.
+
+.. option:: -publics
+
+ dump public symbol records
+
+.. option:: -public-extras
+
+ dump additional information about the publics, such as hash buckets and hash
+ values.
+
+.. option:: -symbols
+
+ dump symbols (functions, variables, etc) for each module dumped.
+
+.. option:: -sym-data
+
+ For each symbol record dumped as a result of the :option:`-symbols` option,
+ display the full bytes of the record in binary as well.
+
+Type Record Options
++++++++++++++++++++
+
+.. option:: -types
+
+ Dump CodeView type records from TPI stream
+
+.. option:: -type-extras
+
+ Dump additional information from the TPI stream, such as hashes and the type
+ index offsets array.
+
+.. option:: -type-data
+
+ For each type record dumped, display the full bytes of the record in binary as
+ well.
+
+.. option:: -type-index=<uint>
+
+ Only dump types with the specified type index.
+
+.. option:: -ids
+
+ Dump CodeView type records from IPI stream.
+
+.. option:: -id-extras
+
+ Dump additional information from the IPI stream, such as hashes and the type
+ index offsets array.
+
+.. option:: -id-data
+
+ For each ID record dumped, display the full bytes of the record in binary as
+ well.
+
+.. option:: -id-index=<uint>
+
+ only dump ID records with the specified hexadecimal type index.
+
+.. option:: -dependents
+
+ When used in conjunction with :option:`-type-index` or :option:`-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).
+
+Miscellaneous Options
++++++++++++++++++++++
+
+.. option:: -all
+
+ Implies most other options.
+
+.. option:: -section-contribs
+
+ Dump section contributions.
+
+.. option:: -section-headers
+
+ Dump image section headers.
+
+.. option:: -section-map
+
+ Dump section map.
+
+.. option:: -string-table
+
+ Dump PDB string table.
+
+.. _bytes_subcommand:
+
+bytes
+~~~~~
+
+USAGE: :program:`llvm-pdbutil` bytes [*options*] <input PDB file>
+
+.. program:: llvm-pdbutil bytes
+
+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's perfectly fine for the same structure to exist at different
+locations in two different PDBs, and "finding" the structure is half the battle.
+
+Options
+^^^^^^^
+
+MSF File Options
+++++++++++++++++
+
+.. option:: -block-range=<start[-end]>
+
+ Dump binary data from specified range of MSF file blocks.
+
+.. option:: -byte-range=<start[-end]>
+
+ Dump binary data from specified range of bytes in the file.
+
+.. option:: -fpm
+
+ Dump the MSF free page map.
+
+.. option:: -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.
+
+PDB Stream Options
+++++++++++++++++++
+
+.. option:: -name-map
+
+ Dump bytes of PDB Name Map
+
+DBI Stream Options
+++++++++++++++++++
+
+.. option:: -ec
+
+ Dump the edit and continue map substream of the DBI stream.
+
+.. option:: -files
+
+ Dump the file info substream of the DBI stream.
+
+.. option:: -modi
+
+ Dump the modi substream of the DBI stream.
+
+.. option:: -sc
+
+ Dump section contributions substream of the DBI stream.
+
+.. option:: -sm
+
+ Dump the section map from the DBI stream.
+
+.. option:: -type-server
+
+ Dump the type server map from the DBI stream.
+
+Module Options
+++++++++++++++
+
+.. option:: -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.
+
+.. option:: -chunks
+
+ Dump the bytes of each module's C13 debug subsection.
+
+.. option:: -split-chunks
+
+ When specified with :option:`-chunks`, split the C13 debug subsection into a
+ separate chunk for each subsection type, and dump them separately.
+
+.. option:: -syms
+
+ Dump the symbol record substream from each module.
+
+Type Record Options
++++++++++++++++++++
+
+.. option:: -id=<uint>
+
+ Dump the record from the IPI stream with the given type index.
+
+.. option:: -type=<uint>
+
+ Dump the record from the TPI stream with the given type index.
+
+.. _pdb2yaml_subcommand:
+
+pdb2yaml
+~~~~~~~~
+
+USAGE: :program:`llvm-pdbutil` pdb2yaml [*options*] <input PDB file>
+
+.. program:: llvm-pdbutil pdb2yaml
+
+Summary
+^^^^^^^
+
+Options
+^^^^^^^
+
+.. _yaml2pdb_subcommand:
+
+yaml2pdb
+~~~~~~~~
+
+USAGE: :program:`llvm-pdbutil` yaml2pdb [*options*] <input YAML file>
+
+.. program:: llvm-pdbutil yaml2pdb
+
+Summary
+^^^^^^^
+
+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.
+
+Options
+^^^^^^^
+
+.. option:: -pdb=<file-name>
+
+Write the resulting PDB to the specified file.
+
+.. _merge_subcommand:
+
+merge
+~~~~~
+
+USAGE: :program:`llvm-pdbutil` merge [*options*] <input PDB file 1> <input PDB file 2>
+
+.. program:: llvm-pdbutil merge
+
+Summary
+^^^^^^^
+
+Merge two PDB files into a single file.
+
+Options
+^^^^^^^
+
+.. option:: -pdb=<file-name>
+
+Write the resulting PDB to the specified file.