llvm-dwarfdump - dump and verify DWARF debug information¶
SYNOPSIS¶
llvm-dwarfdump [options] [filename …]
DESCRIPTION¶
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 --all is specified.
If no input file is specified, a.out is used instead. If - is used as the
input file, llvm-dwarfdump reads the input from its standard input
stream.
OPTIONS¶
:::{option} -a, –all Dump all supported DWARF sections. :::
:::{option} –arch=
:::{option} -c, –show-children
Show a debug info entry’s children when selectively printing with
the =<offset> argument of --debug-info, or options such
as --find or --name.
:::
:::{option} –color Use colors in output. :::
:::{option} –error-display=--verify. The supported values are:
quiet - Only display whether errors occurred.
summary - Display only a summary of the errors found.
details - Display each error in detail but no summary.
full - Display each error as well as a summary. [default]
:::
:::{option} -f --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} –help-list Show help and usage for this command without grouping the options into categories. :::
:::{option} -i, –ignore-case
Ignore case distinctions when using --name.
:::
:::{option} -n DW_AT_name/DW_AT_linkage_name attribute) is <name>.
:::
:::{option} –lookup=
Look up <address> in the debug information and print out the file, function, block, and line table details. ::::::{option} -o - is the
standard output stream.
:::
:::{option} -p, –show-parents
Show a debug info entry’s parents when selectively printing with
the =<offset> argument of --debug-info, or options such
as --find or --name.
:::
:::{option} –parent-recurse-depth=
:::{option} –quiet
Use with --verify to not emit to STDOUT.
:::
:::{option} -r
:::{option} –show-section-sizes Show the sizes of all debug sections, expressed in bytes. :::
:::{option} –show-sources Print all source files mentioned in the debug information. Absolute paths are given whenever possible. :::
:::{option} –statistics Collect debug info quality metrics and print the results as machine-readable single-line JSON output. The output format is described in the section below (FORMAT OF STATISTICS OUTPUT). :::
:::{option} –summarize-types Abbreviate the description of type unit entries. :::
:::{option} -t, –filter-child-tag Only dump children whose DWARF tag is one of the specified tags. Example usage:
llvm-dwarfdump -t DW_TAG_structure_type -t DW_TAG_member -c
:::
:::{option} -x, –regex
Treat any <name> strings as regular expressions when searching
with --name. If --ignore-case is also specified,
the regular expression becomes case-insensitive.
:::
:::{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} –verify-json=--verify. The output format is described
in the section below (FORMAT OF VERIFY JSON OUTPUT).
:::
:::{option} –version Display the version of the tool. :::
:::{option} –debug-abbrev, –debug-addr, –debug-aranges, –debug-cu-index, –debug-frame [=.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.
The --debug-macro option prints both the .debug_macro and the .debug_macinfo sections.
The --debug-frame and --eh-frame options are aliases, in cases where both sections are present one command outputs both.
:::
:::{option} –show-variable-coverage Show per-variable coverage metrics. The output format is described in the section below (FORMAT OF VARIABLE COVERAGE OUTPUT). :::
:::{option} –coverage-baseline
File to use as the baseline for variable coverage statistics
(implies --show-variable-coverage)
:::
:::{option} –variable-coverage-bitcode-file
File containing LLVM IR (bitcode or textual) used for calculating
variable definedness in coverage statistics (implies
--show-variable-coverage)
:::
:::{option} –variable-coverage-maybe-undefined
Use with --show-variable-coverage and
--variable-coverage-bitcode-file to consider variables
live if they are defined on at least one path (default behaviour is
to require a variable to be defined on all paths to be counted)
:::
:::{option} –combine-inline-variable-instances
Use with --show-variable-coverage to average variable
coverage across inlined subroutine instances instead of printing
them separately.
:::
:::{option} @<FILE>.
:::
FORMAT OF STATISTICS OUTPUT¶
The --statistics option generates single-line JSON output
representing quality metrics of the processed debug info. These metrics are
useful to compare changes between two compilers, particularly for judging
the effect that a change to the compiler has on the debug info quality.
The output is formatted as key-value pairs. The first pair contains a version number. The following naming scheme is used for the keys:
variables==> local variables and parameterslocal vars==> local variablesparams==> formal parameters
For aggregated values, the following keys are used:
sum_of_all_variables(...)==> the sum applied to all variables#bytes==> the number of bytes#variables - entry values ...==> the number of variables excluding the entry values etc.
FORMAT OF VERIFY JSON OUTPUT¶
The format of the JSON output created by the --verify-json is:
{
"error-categories": {
"<first category description>": {"count": 1234},
"<next category description>": {"count": 4321}
},
"error-count": 5555
}
The following is generated if there are no errors reported:
{
"error-categories": {},
"error-count": 0
}
FORMAT OF VARIABLE COVERAGE OUTPUT¶
The --show-variable-coverage option differs from
--statistics by printing per-variable debug info coverage metrics
based on the number of source lines covered instead of the number of
instruction bytes. Compared to counting instruction bytes, this is more stable
across compilations and better reflects the debugging experience. The output is
a tab-separated table containing the following columns:
Function==> Name of the function the variable was found inInstanceCount(when--combine-inline-variable-instancesis specified) ==> Number of instances of the function; this is 1 for functions that have not been inlined, and n+1 for functions that have been inlined n timesInlChain(when--combine-inline-variable-instancesis not specified) ==> Chain of call sites (file and line number) that the function has been inlined into; this will be empty if the function has not been inlinedVariable==> Name of the variableDecl==> Source location (file and line number) of the variable’s declarationLinesCovered==> Number of source lines covered by the variable’s debug information in the input fileBaseline(empty if--coverage-baselineis not specified) ==> Number of source lines covered by the variable’s debug information in the baselineCoveredRatio(empty if--coverage-baselineis not specified) ==> Ratio of the coverage compared to the baseline (calculated asLinesCovered/Baseline)LinesPresent(empty if--coverage-baselineis not specified) ==> Number of source lines covered in the variable’s baseline debug information that are also present in the input file’s line tableLinesPresentRatio(empty if--coverage-baselineis not specified) ==> Ratio of the line table coverage compared to the baseline (calculated asLinesPresent/Baseline)
EXIT STATUS¶
llvm-dwarfdump returns 0 if the input files were parsed and dumped successfully. Otherwise, it returns 1.
