blob: b8ebc8aad8908cb2f552861c9a23ff1d88b44db2 [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
4SYNOPSIS
5--------
6
Adrian Prantlf01b3f32017-10-03 23:46:57 +00007:program:`llvm-dwarfdump` [*options*] [*filename ...*]
Alexey Samsonova47b11a2014-05-19 22:53:29 +00008
9DESCRIPTION
10-----------
11
Adrian Prantlf01b3f32017-10-03 23:46:57 +000012:program:`llvm-dwarfdump` parses DWARF sections in object files,
13archives, and `.dSYM` bundles and prints their contents in
14human-readable form. Only the .debug_info section is printed unless one of
15the section-specific options or :option:`--all` is specified.
Alexey Samsonova47b11a2014-05-19 22:53:29 +000016
James Henderson86b510a2019-06-13 13:53:16 +000017If no input file is specified, `a.out` is used instead. If `-` is used as the
18input file, :program:`llvm-dwarfdump` reads the input from its standard input
19stream.
20
Alexey Samsonova47b11a2014-05-19 22:53:29 +000021OPTIONS
22-------
23
Adrian Prantlf01b3f32017-10-03 23:46:57 +000024.. option:: -a, --all
Alexey Samsonova47b11a2014-05-19 22:53:29 +000025
Adrian Prantlf01b3f32017-10-03 23:46:57 +000026 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 Henderson891cdaa2019-06-14 13:00:09 +000038 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 Prantlf01b3f32017-10-03 23:46:57 +000041
James Henderson86b510a2019-06-13 13:53:16 +000042.. option:: --color
43
44 Use colors in output.
45
Adrian Prantlf01b3f32017-10-03 23:46:57 +000046.. 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 Henderson86b510a2019-06-13 13:53:16 +000062.. option:: --help-list
63
64 Show help and usage for this command without grouping the options
65 into categories.
66
Adrian Prantlf01b3f32017-10-03 23:46:57 +000067.. option:: -i, --ignore-case
68
James Henderson94879632019-06-11 13:51:18 +000069 Ignore case distinctions when searching.
Adrian Prantlf01b3f32017-10-03 23:46:57 +000070
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 Hendersond5f38da2019-06-11 10:20:07 +000084.. option:: -o <path>
Adrian Prantlf01b3f32017-10-03 23:46:57 +000085
James Henderson86b510a2019-06-13 13:53:16 +000086 Redirect output to a file specified by <path>, where `-` is the
87 standard output stream.
Adrian Prantlf01b3f32017-10-03 23:46:57 +000088
89.. option:: -p, --show-parents
90
James Henderson891cdaa2019-06-14 13:00:09 +000091 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 Prantlf01b3f32017-10-03 23:46:57 +000094
James Henderson86b510a2019-06-13 13:53:16 +000095.. option:: --parent-recurse-depth=<N>
Adrian Prantlf01b3f32017-10-03 23:46:57 +000096
James Henderson86b510a2019-06-13 13:53:16 +000097 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 Prantlf01b3f32017-10-03 23:46:57 +0000107 entries.
108
Adrian Prantl59f30b82017-10-06 20:24:34 +0000109.. option:: --statistics
110
111 Collect debug info quality metrics and print the results
112 as machine-readable single-line JSON output.
113
James Henderson86b510a2019-06-13 13:53:16 +0000114.. option:: --summarize-types
115
116 Abbreviate the description of type unit entries.
117
Adrian Prantlf01b3f32017-10-03 23:46:57 +0000118.. 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 Henderson86b510a2019-06-13 13:53:16 +0000147.. 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 +0000148
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 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)`