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 | |
| 4 | SYNOPSIS |
| 5 | -------- |
| 6 | |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 7 | :program:`llvm-dwarfdump` [*options*] [*filename ...*] |
Alexey Samsonov | a47b11a | 2014-05-19 22:53:29 +0000 | [diff] [blame] | 8 | |
| 9 | DESCRIPTION |
| 10 | ----------- |
| 11 | |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 12 | :program:`llvm-dwarfdump` parses DWARF sections in object files, |
| 13 | archives, and `.dSYM` bundles and prints their contents in |
| 14 | human-readable form. Only the .debug_info section is printed unless one of |
| 15 | the section-specific options or :option:`--all` is specified. |
Alexey Samsonov | a47b11a | 2014-05-19 22:53:29 +0000 | [diff] [blame] | 16 | |
James Henderson | 86b510a | 2019-06-13 13:53:16 +0000 | [diff] [blame] | 17 | If no input file is specified, `a.out` is used instead. If `-` is used as the |
| 18 | input file, :program:`llvm-dwarfdump` reads the input from its standard input |
| 19 | stream. |
| 20 | |
Alexey Samsonov | a47b11a | 2014-05-19 22:53:29 +0000 | [diff] [blame] | 21 | OPTIONS |
| 22 | ------- |
| 23 | |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 24 | .. option:: -a, --all |
Alexey Samsonov | a47b11a | 2014-05-19 22:53:29 +0000 | [diff] [blame] | 25 | |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 26 | Disassemble all supported DWARF sections. |
| 27 | |
| 28 | .. option:: --arch=<arch> |
| 29 | |
| 30 | Dump DWARF debug information for the specified CPU architecture. |
| 31 | Architectures may be specified by name or by number. This |
| 32 | option can be specified multiple times, once for each desired |
| 33 | architecture. All CPU architectures will be printed by |
| 34 | default. |
| 35 | |
| 36 | .. option:: -c, --show-children |
| 37 | |
James Henderson | 891cdaa | 2019-06-14 13:00:09 +0000 | [diff] [blame^] | 38 | Show a debug info entry's children when selectively printing with |
| 39 | the `=<offset>` argument of :option:`--debug-info`, or options such |
| 40 | as :option:`--find` or :option:`--name`. |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 41 | |
James Henderson | 86b510a | 2019-06-13 13:53:16 +0000 | [diff] [blame] | 42 | .. option:: --color |
| 43 | |
| 44 | Use colors in output. |
| 45 | |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 46 | .. option:: -f <name>, --find=<name> |
| 47 | |
| 48 | Search for the exact text <name> in the accelerator tables |
| 49 | and print the matching debug information entries. |
| 50 | When there is no accelerator tables or the name of the DIE |
| 51 | you are looking for is not found in the accelerator tables, |
| 52 | try using the slower but more complete :option:`--name` option. |
| 53 | |
| 54 | .. option:: -F, --show-form |
| 55 | |
| 56 | Show DWARF form types after the DWARF attribute types. |
| 57 | |
| 58 | .. option:: -h, --help |
| 59 | |
| 60 | Show help and usage for this command. |
| 61 | |
James Henderson | 86b510a | 2019-06-13 13:53:16 +0000 | [diff] [blame] | 62 | .. option:: --help-list |
| 63 | |
| 64 | Show help and usage for this command without grouping the options |
| 65 | into categories. |
| 66 | |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 67 | .. option:: -i, --ignore-case |
| 68 | |
James Henderson | 9487963 | 2019-06-11 13:51:18 +0000 | [diff] [blame] | 69 | Ignore case distinctions when searching. |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 70 | |
| 71 | .. option:: -n <pattern>, --name=<pattern> |
| 72 | |
| 73 | Find and print all debug info entries whose name |
| 74 | (`DW_AT_name` attribute) matches the exact text in |
| 75 | <pattern>. Use the :option:`--regex` option to have |
| 76 | <pattern> become a regular expression for more flexible |
| 77 | pattern matching. |
| 78 | |
| 79 | .. option:: --lookup=<address> |
| 80 | |
| 81 | Lookup <address> in the debug information and print out the file, |
| 82 | function, block, and line table details. |
| 83 | |
James Henderson | d5f38da | 2019-06-11 10:20:07 +0000 | [diff] [blame] | 84 | .. option:: -o <path> |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 85 | |
James Henderson | 86b510a | 2019-06-13 13:53:16 +0000 | [diff] [blame] | 86 | Redirect output to a file specified by <path>, where `-` is the |
| 87 | standard output stream. |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 88 | |
| 89 | .. option:: -p, --show-parents |
| 90 | |
James Henderson | 891cdaa | 2019-06-14 13:00:09 +0000 | [diff] [blame^] | 91 | Show a debug info entry's parents when selectively printing with |
| 92 | the `=<offset>` argument of :option:`--debug-info`, or options such |
| 93 | as :option:`--find` or :option:`--name`. |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 94 | |
James Henderson | 86b510a | 2019-06-13 13:53:16 +0000 | [diff] [blame] | 95 | .. option:: --parent-recurse-depth=<N> |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 96 | |
James Henderson | 86b510a | 2019-06-13 13:53:16 +0000 | [diff] [blame] | 97 | Only recurse to a maximum depth of <N> when displaying parents of |
| 98 | debug info entries. |
| 99 | |
| 100 | .. option:: --quiet |
| 101 | |
| 102 | Use with :option:`--verify` to not emit to `STDOUT`. |
| 103 | |
| 104 | .. option:: -r <N>, --recurse-depth=<N> |
| 105 | |
| 106 | Only recurse to a maximum depth of <N> when dumping debug info |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 107 | entries. |
| 108 | |
Adrian Prantl | 59f30b8 | 2017-10-06 20:24:34 +0000 | [diff] [blame] | 109 | .. option:: --statistics |
| 110 | |
| 111 | Collect debug info quality metrics and print the results |
| 112 | as machine-readable single-line JSON output. |
| 113 | |
James Henderson | 86b510a | 2019-06-13 13:53:16 +0000 | [diff] [blame] | 114 | .. option:: --summarize-types |
| 115 | |
| 116 | Abbreviate the description of type unit entries. |
| 117 | |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 118 | .. option:: -x, --regex |
| 119 | |
| 120 | Treat any <pattern> strings as regular expressions when searching |
| 121 | instead of just as an exact string match. |
| 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 |
| 155 | section will be dumped. Children of items at a specific |
| 156 | offset can be dumped by also using the |
| 157 | :option:`--show-children` option where applicable. |
Alexey Samsonov | a47b11a | 2014-05-19 22:53:29 +0000 | [diff] [blame] | 158 | |
James Henderson | 86b510a | 2019-06-13 13:53:16 +0000 | [diff] [blame] | 159 | .. option:: @<FILE> |
| 160 | |
| 161 | Read command-line options from `<FILE>`. |
| 162 | |
Alexey Samsonov | a47b11a | 2014-05-19 22:53:29 +0000 | [diff] [blame] | 163 | EXIT STATUS |
| 164 | ----------- |
| 165 | |
Alexey Samsonov | 85c7d66 | 2015-06-25 23:40:15 +0000 | [diff] [blame] | 166 | :program:`llvm-dwarfdump` returns 0 if the input files were parsed and dumped |
| 167 | successfully. Otherwise, it returns 1. |
Adrian Prantl | f01b3f3 | 2017-10-03 23:46:57 +0000 | [diff] [blame] | 168 | |
| 169 | SEE ALSO |
| 170 | -------- |
| 171 | |
Jonas Devlieghere | fb7bf1d | 2017-11-02 18:44:54 +0000 | [diff] [blame] | 172 | :manpage:`dsymutil(1)` |