blob: 1a128e5cb4b82bd3ed7b840aeb306af974cefa9c [file] [log] [blame]
Adrian Prantlf01b3f32017-10-03 23:46:57 +00001llvm-dwarfdump - dump and verify DWARF debug information
2========================================================
Alexey Samsonova47b11a2014-05-19 22:53:29 +00003
James Hendersona0566842019-06-27 13:24:46 +00004.. program:: llvm-dwarfdump
5
Alexey Samsonova47b11a2014-05-19 22:53:29 +00006SYNOPSIS
7--------
8
Adrian Prantlf01b3f32017-10-03 23:46:57 +00009:program:`llvm-dwarfdump` [*options*] [*filename ...*]
Alexey Samsonova47b11a2014-05-19 22:53:29 +000010
11DESCRIPTION
12-----------
13
Adrian Prantlf01b3f32017-10-03 23:46:57 +000014:program:`llvm-dwarfdump` parses DWARF sections in object files,
15archives, and `.dSYM` bundles and prints their contents in
16human-readable form. Only the .debug_info section is printed unless one of
17the section-specific options or :option:`--all` is specified.
Alexey Samsonova47b11a2014-05-19 22:53:29 +000018
James Henderson86b510a2019-06-13 13:53:16 +000019If no input file is specified, `a.out` is used instead. If `-` is used as the
20input file, :program:`llvm-dwarfdump` reads the input from its standard input
21stream.
22
Alexey Samsonova47b11a2014-05-19 22:53:29 +000023OPTIONS
24-------
25
Adrian Prantlf01b3f32017-10-03 23:46:57 +000026.. option:: -a, --all
Alexey Samsonova47b11a2014-05-19 22:53:29 +000027
Adrian Prantlf01b3f32017-10-03 23:46:57 +000028 Disassemble all supported DWARF sections.
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 Henderson891cdaa2019-06-14 13:00:09 +000040 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 Prantlf01b3f32017-10-03 23:46:57 +000043
James Henderson86b510a2019-06-13 13:53:16 +000044.. option:: --color
45
46 Use colors in output.
47
Adrian Prantlf01b3f32017-10-03 23:46:57 +000048.. 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 Henderson86b510a2019-06-13 13:53:16 +000064.. option:: --help-list
65
66 Show help and usage for this command without grouping the options
67 into categories.
68
Adrian Prantlf01b3f32017-10-03 23:46:57 +000069.. option:: -i, --ignore-case
70
James Henderson94879632019-06-11 13:51:18 +000071 Ignore case distinctions when searching.
Adrian Prantlf01b3f32017-10-03 23:46:57 +000072
73.. option:: -n <pattern>, --name=<pattern>
74
75 Find and print all debug info entries whose name
76 (`DW_AT_name` attribute) matches the exact text in
77 <pattern>. Use the :option:`--regex` option to have
78 <pattern> become a regular expression for more flexible
79 pattern matching.
80
81.. option:: --lookup=<address>
82
83 Lookup <address> in the debug information and print out the file,
84 function, block, and line table details.
85
James Hendersond5f38da2019-06-11 10:20:07 +000086.. option:: -o <path>
Adrian Prantlf01b3f32017-10-03 23:46:57 +000087
James Henderson86b510a2019-06-13 13:53:16 +000088 Redirect output to a file specified by <path>, where `-` is the
89 standard output stream.
Adrian Prantlf01b3f32017-10-03 23:46:57 +000090
91.. option:: -p, --show-parents
92
James Henderson891cdaa2019-06-14 13:00:09 +000093 Show a debug info entry's parents when selectively printing with
94 the `=<offset>` argument of :option:`--debug-info`, or options such
95 as :option:`--find` or :option:`--name`.
Adrian Prantlf01b3f32017-10-03 23:46:57 +000096
James Henderson86b510a2019-06-13 13:53:16 +000097.. option:: --parent-recurse-depth=<N>
Adrian Prantlf01b3f32017-10-03 23:46:57 +000098
James Henderson86b510a2019-06-13 13:53:16 +000099 Only recurse to a maximum depth of <N> when displaying parents of
100 debug info entries.
101
102.. option:: --quiet
103
104 Use with :option:`--verify` to not emit to `STDOUT`.
105
106.. option:: -r <N>, --recurse-depth=<N>
107
108 Only recurse to a maximum depth of <N> when dumping debug info
Adrian Prantlf01b3f32017-10-03 23:46:57 +0000109 entries.
110
Adrian Prantl59f30b82017-10-06 20:24:34 +0000111.. option:: --statistics
112
113 Collect debug info quality metrics and print the results
114 as machine-readable single-line JSON output.
115
James Henderson86b510a2019-06-13 13:53:16 +0000116.. option:: --summarize-types
117
118 Abbreviate the description of type unit entries.
119
Adrian Prantlf01b3f32017-10-03 23:46:57 +0000120.. option:: -x, --regex
121
122 Treat any <pattern> strings as regular expressions when searching
123 instead of just as an exact string match.
124
125.. option:: -u, --uuid
126
127 Show the UUID for each architecture.
128
129.. option:: --diff
130
131 Dump the output in a format that is more friendly for comparing
132 DWARF output from two different files.
133
134.. option:: -v, --verbose
135
136 Display verbose information when dumping. This can help to debug
137 DWARF issues.
138
139.. option:: --verify
140
141 Verify the structure of the DWARF information by verifying the
142 compile unit chains, DIE relationships graph, address
143 ranges, and more.
144
145.. option:: --version
146
147 Display the version of the tool.
148
James Henderson86b510a2019-06-13 13:53:16 +0000149.. 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 Prantlf01b3f32017-10-03 23:46:57 +0000150
151 Dump the specified DWARF section by name. Only the
152 `.debug_info` section is shown by default. Some entries
153 support adding an `=<offset>` as a way to provide an
154 optional offset of the exact entry to dump within the
155 respective section. When an offset is provided, only the
156 entry at that offset will be dumped, else the entire
James Henderson38d99032019-07-04 08:49:04 +0000157 section will be dumped.
Alexey Samsonova47b11a2014-05-19 22:53:29 +0000158
James Henderson86b510a2019-06-13 13:53:16 +0000159.. option:: @<FILE>
160
161 Read command-line options from `<FILE>`.
162
Alexey Samsonova47b11a2014-05-19 22:53:29 +0000163EXIT STATUS
164-----------
165
Alexey Samsonov85c7d662015-06-25 23:40:15 +0000166:program:`llvm-dwarfdump` returns 0 if the input files were parsed and dumped
167successfully. Otherwise, it returns 1.
Adrian Prantlf01b3f32017-10-03 23:46:57 +0000168
169SEE ALSO
170--------
171
Jonas Devliegherefb7bf1d2017-11-02 18:44:54 +0000172:manpage:`dsymutil(1)`