Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 1 | llvm-dwarfdump - dump and verify DWARF debug information |
| 2 | ======================================================== |
Alexey Samsonov | a47b11a | 2014-05-19 22:53:29 +0000 | [diff] [blame] | 3 | |
James Henderson | a056684 | 2019-06-27 13:24:46 +0000 | [diff] [blame] | 4 | .. program:: llvm-dwarfdump |
| 5 | |
Alexey Samsonov | a47b11a | 2014-05-19 22:53:29 +0000 | [diff] [blame] | 6 | SYNOPSIS |
| 7 | -------- |
| 8 | |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 9 | :program:`llvm-dwarfdump` [*options*] [*filename ...*] |
Alexey Samsonov | a47b11a | 2014-05-19 22:53:29 +0000 | [diff] [blame] | 10 | |
| 11 | DESCRIPTION |
| 12 | ----------- |
| 13 | |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 14 | :program:`llvm-dwarfdump` parses DWARF sections in object files, |
| 15 | archives, and `.dSYM` bundles and prints their contents in |
| 16 | human-readable form. Only the .debug_info section is printed unless one of |
| 17 | the section-specific options or :option:`--all` is specified. |
Alexey Samsonov | a47b11a | 2014-05-19 22:53:29 +0000 | [diff] [blame] | 18 | |
James Henderson | 86b510a | 2019-06-13 13:53:16 +0000 | [diff] [blame] | 19 | If no input file is specified, `a.out` is used instead. If `-` is used as the |
| 20 | input file, :program:`llvm-dwarfdump` reads the input from its standard input |
| 21 | stream. |
| 22 | |
Alexey Samsonov | a47b11a | 2014-05-19 22:53:29 +0000 | [diff] [blame] | 23 | OPTIONS |
| 24 | ------- |
| 25 | |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 26 | .. option:: -a, --all |
Alexey Samsonov | a47b11a | 2014-05-19 22:53:29 +0000 | [diff] [blame] | 27 | |
James Henderson | 6664142 | 2019-07-10 08:56:13 +0000 | [diff] [blame] | 28 | Dump all supported DWARF sections. |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 29 | |
| 30 | .. option:: --arch=<arch> |
| 31 | |
| 32 | Dump DWARF debug information for the specified CPU architecture. |
| 33 | Architectures may be specified by name or by number. This |
| 34 | option can be specified multiple times, once for each desired |
| 35 | architecture. All CPU architectures will be printed by |
| 36 | default. |
| 37 | |
| 38 | .. option:: -c, --show-children |
| 39 | |
James Henderson | 891cdaa | 2019-06-14 13:00:09 +0000 | [diff] [blame] | 40 | Show a debug info entry's children when selectively printing with |
| 41 | the `=<offset>` argument of :option:`--debug-info`, or options such |
| 42 | as :option:`--find` or :option:`--name`. |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 43 | |
James Henderson | 86b510a | 2019-06-13 13:53:16 +0000 | [diff] [blame] | 44 | .. option:: --color |
| 45 | |
| 46 | Use colors in output. |
| 47 | |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 48 | .. option:: -f <name>, --find=<name> |
| 49 | |
| 50 | Search for the exact text <name> in the accelerator tables |
| 51 | and print the matching debug information entries. |
| 52 | When there is no accelerator tables or the name of the DIE |
| 53 | you are looking for is not found in the accelerator tables, |
| 54 | try using the slower but more complete :option:`--name` option. |
| 55 | |
| 56 | .. option:: -F, --show-form |
| 57 | |
| 58 | Show DWARF form types after the DWARF attribute types. |
| 59 | |
| 60 | .. option:: -h, --help |
| 61 | |
| 62 | Show help and usage for this command. |
| 63 | |
James Henderson | 86b510a | 2019-06-13 13:53:16 +0000 | [diff] [blame] | 64 | .. option:: --help-list |
| 65 | |
| 66 | Show help and usage for this command without grouping the options |
| 67 | into categories. |
| 68 | |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 69 | .. option:: -i, --ignore-case |
| 70 | |
James Henderson | 4363edb | 2019-07-09 10:03:12 +0000 | [diff] [blame] | 71 | Ignore case distinctions when using :option:`--name`. |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 72 | |
James Henderson | 4363edb | 2019-07-09 10:03:12 +0000 | [diff] [blame] | 73 | .. option:: -n <name>, --name=<name> |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 74 | |
| 75 | Find and print all debug info entries whose name |
James Henderson | 4363edb | 2019-07-09 10:03:12 +0000 | [diff] [blame] | 76 | (`DW_AT_name` attribute) is <name>. |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 77 | |
| 78 | .. option:: --lookup=<address> |
| 79 | |
James Henderson | e0a3ee7 | 2019-07-09 14:20:58 +0000 | [diff] [blame] | 80 | Look up <address> in the debug information and print out the file, |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 81 | function, block, and line table details. |
| 82 | |
James Henderson | d5f38da | 2019-06-11 10:20:07 +0000 | [diff] [blame] | 83 | .. option:: -o <path> |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 84 | |
James Henderson | 86b510a | 2019-06-13 13:53:16 +0000 | [diff] [blame] | 85 | Redirect output to a file specified by <path>, where `-` is the |
| 86 | standard output stream. |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 87 | |
| 88 | .. option:: -p, --show-parents |
| 89 | |
James Henderson | 891cdaa | 2019-06-14 13:00:09 +0000 | [diff] [blame] | 90 | Show a debug info entry's parents when selectively printing with |
| 91 | the `=<offset>` argument of :option:`--debug-info`, or options such |
| 92 | as :option:`--find` or :option:`--name`. |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 93 | |
James Henderson | 86b510a | 2019-06-13 13:53:16 +0000 | [diff] [blame] | 94 | .. option:: --parent-recurse-depth=<N> |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 95 | |
James Henderson | 4363edb | 2019-07-09 10:03:12 +0000 | [diff] [blame] | 96 | When displaying debug info entry parents, only show them to a |
| 97 | maximum depth of <N>. |
James Henderson | 86b510a | 2019-06-13 13:53:16 +0000 | [diff] [blame] | 98 | |
| 99 | .. option:: --quiet |
| 100 | |
| 101 | Use with :option:`--verify` to not emit to `STDOUT`. |
| 102 | |
| 103 | .. option:: -r <N>, --recurse-depth=<N> |
| 104 | |
James Henderson | 4363edb | 2019-07-09 10:03:12 +0000 | [diff] [blame] | 105 | When displaying debug info entries, only show children to a maximum |
| 106 | depth of <N>. |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 107 | |
Adrian Prantl | 59f30b8 | 2017-10-06 20:24:34 +0000 | [diff] [blame] | 108 | .. option:: --statistics |
| 109 | |
| 110 | Collect debug info quality metrics and print the results |
| 111 | as machine-readable single-line JSON output. |
| 112 | |
James Henderson | 86b510a | 2019-06-13 13:53:16 +0000 | [diff] [blame] | 113 | .. option:: --summarize-types |
| 114 | |
| 115 | Abbreviate the description of type unit entries. |
| 116 | |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 117 | .. option:: -x, --regex |
| 118 | |
James Henderson | 4363edb | 2019-07-09 10:03:12 +0000 | [diff] [blame] | 119 | Treat any <name> strings as regular expressions when searching |
| 120 | with :option:`--name`. If :option:`--ignore-case` is also specified, |
| 121 | the regular expression becomes case-insensitive. |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 122 | |
| 123 | .. option:: -u, --uuid |
| 124 | |
| 125 | Show the UUID for each architecture. |
| 126 | |
| 127 | .. option:: --diff |
| 128 | |
| 129 | Dump the output in a format that is more friendly for comparing |
| 130 | DWARF output from two different files. |
| 131 | |
| 132 | .. option:: -v, --verbose |
| 133 | |
| 134 | Display verbose information when dumping. This can help to debug |
| 135 | DWARF issues. |
| 136 | |
| 137 | .. option:: --verify |
| 138 | |
| 139 | Verify the structure of the DWARF information by verifying the |
| 140 | compile unit chains, DIE relationships graph, address |
| 141 | ranges, and more. |
| 142 | |
| 143 | .. option:: --version |
| 144 | |
| 145 | Display the version of the tool. |
| 146 | |
James Henderson | 86b510a | 2019-06-13 13:53:16 +0000 | [diff] [blame] | 147 | .. option:: --debug-abbrev, --debug-addr, --debug-aranges, --debug-cu-index, --debug-frame [=<offset>], --debug-gnu-pubnames, --debug-gnu-pubtypes, --debug-info [=<offset>], --debug-line [=<offset>], --debug-line-str, --debug-loc [=<offset>], --debug-loclists [=<offset>], --debug-macro, --debug-names, --debug-pubnames, --debug-pubtypes, --debug-ranges, --debug-rnglists, --debug-str, --debug-str-offsets, --debug-tu-index, --debug-types, --eh-frame [=<offset>], --gdb-index, --apple-names, --apple-types, --apple-namespaces, --apple-objc |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 148 | |
| 149 | Dump the specified DWARF section by name. Only the |
| 150 | `.debug_info` section is shown by default. Some entries |
| 151 | support adding an `=<offset>` as a way to provide an |
| 152 | optional offset of the exact entry to dump within the |
| 153 | respective section. When an offset is provided, only the |
| 154 | entry at that offset will be dumped, else the entire |
James Henderson | 38d9903 | 2019-07-04 08:49:04 +0000 | [diff] [blame] | 155 | section will be dumped. |
Alexey Samsonov | a47b11a | 2014-05-19 22:53:29 +0000 | [diff] [blame] | 156 | |
James Henderson | 86b510a | 2019-06-13 13:53:16 +0000 | [diff] [blame] | 157 | .. option:: @<FILE> |
| 158 | |
| 159 | Read command-line options from `<FILE>`. |
| 160 | |
Alexey Samsonov | a47b11a | 2014-05-19 22:53:29 +0000 | [diff] [blame] | 161 | EXIT STATUS |
| 162 | ----------- |
| 163 | |
Alexey Samsonov | 85c7d66 | 2015-06-25 23:40:15 +0000 | [diff] [blame] | 164 | :program:`llvm-dwarfdump` returns 0 if the input files were parsed and dumped |
| 165 | successfully. Otherwise, it returns 1. |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 166 | |
| 167 | SEE ALSO |
| 168 | -------- |
| 169 | |
Jonas Devlieghere | fb7bf1d | 2017-11-02 18:44:54 +0000 | [diff] [blame] | 170 | :manpage:`dsymutil(1)` |