Merge branch 'vendor/DIFFUTILS'
[dragonfly.git] / contrib / binutils-2.25 / binutils / doc / addr2line.1
1 .\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28)
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
6 .if t .sp .5v
7 .if n .sp
8 ..
9 .de Vb \" Begin verbatim text
10 .ft CW
11 .nf
12 .ne \\$1
13 ..
14 .de Ve \" End verbatim text
15 .ft R
16 .fi
17 ..
18 .\" Set up some character translations and predefined strings.  \*(-- will
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
21 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
22 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
23 .\" nothing in troff, for use with C<>.
24 .tr \(*W-
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26 .ie n \{\
27 .    ds -- \(*W-
28 .    ds PI pi
29 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
31 .    ds L" ""
32 .    ds R" ""
33 .    ds C` ""
34 .    ds C' ""
35 'br\}
36 .el\{\
37 .    ds -- \|\(em\|
38 .    ds PI \(*p
39 .    ds L" ``
40 .    ds R" ''
41 .    ds C`
42 .    ds C'
43 'br\}
44 .\"
45 .\" Escape single quotes in literal strings from groff's Unicode transform.
46 .ie \n(.g .ds Aq \(aq
47 .el       .ds Aq '
48 .\"
49 .\" If the F register is turned on, we'll generate index entries on stderr for
50 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
51 .\" entries marked with X<> in POD.  Of course, you'll have to process the
52 .\" output yourself in some meaningful fashion.
53 .\"
54 .\" Avoid warning from groff about undefined register 'F'.
55 .de IX
56 ..
57 .nr rF 0
58 .if \n(.g .if rF .nr rF 1
59 .if (\n(rF:(\n(.g==0)) \{
60 .    if \nF \{
61 .        de IX
62 .        tm Index:\\$1\t\\n%\t"\\$2"
63 ..
64 .        if !\nF==2 \{
65 .            nr % 0
66 .            nr F 2
67 .        \}
68 .    \}
69 .\}
70 .rr rF
71 .\"
72 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
73 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
74 .    \" fudge factors for nroff and troff
75 .if n \{\
76 .    ds #H 0
77 .    ds #V .8m
78 .    ds #F .3m
79 .    ds #[ \f1
80 .    ds #] \fP
81 .\}
82 .if t \{\
83 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
84 .    ds #V .6m
85 .    ds #F 0
86 .    ds #[ \&
87 .    ds #] \&
88 .\}
89 .    \" simple accents for nroff and troff
90 .if n \{\
91 .    ds ' \&
92 .    ds ` \&
93 .    ds ^ \&
94 .    ds , \&
95 .    ds ~ ~
96 .    ds /
97 .\}
98 .if t \{\
99 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
100 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
101 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
102 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
103 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
104 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
105 .\}
106 .    \" troff and (daisy-wheel) nroff accents
107 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
108 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
109 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
110 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
111 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
112 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
113 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
114 .ds ae a\h'-(\w'a'u*4/10)'e
115 .ds Ae A\h'-(\w'A'u*4/10)'E
116 .    \" corrections for vroff
117 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
118 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
119 .    \" for low resolution devices (crt and lpr)
120 .if \n(.H>23 .if \n(.V>19 \
121 \{\
122 .    ds : e
123 .    ds 8 ss
124 .    ds o a
125 .    ds d- d\h'-1'\(ga
126 .    ds D- D\h'-1'\(hy
127 .    ds th \o'bp'
128 .    ds Th \o'LP'
129 .    ds ae ae
130 .    ds Ae AE
131 .\}
132 .rm #[ #] #H #V #F C
133 .\" ========================================================================
134 .\"
135 .IX Title "ADDR2LINE 1"
136 .TH ADDR2LINE 1 "2014-12-23" "binutils-2.25" "GNU Development Tools"
137 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
138 .\" way too many mistakes in technical documents.
139 .if n .ad l
140 .nh
141 .SH "NAME"
142 addr2line \- convert addresses into file names and line numbers.
143 .SH "SYNOPSIS"
144 .IX Header "SYNOPSIS"
145 addr2line [\fB\-a\fR|\fB\-\-addresses\fR]
146           [\fB\-b\fR \fIbfdname\fR|\fB\-\-target=\fR\fIbfdname\fR]
147           [\fB\-C\fR|\fB\-\-demangle\fR[=\fIstyle\fR]]
148           [\fB\-e\fR \fIfilename\fR|\fB\-\-exe=\fR\fIfilename\fR]
149           [\fB\-f\fR|\fB\-\-functions\fR] [\fB\-s\fR|\fB\-\-basename\fR]
150           [\fB\-i\fR|\fB\-\-inlines\fR]
151           [\fB\-p\fR|\fB\-\-pretty\-print\fR]
152           [\fB\-j\fR|\fB\-\-section=\fR\fIname\fR]
153           [\fB\-H\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR]
154           [addr addr ...]
155 .SH "DESCRIPTION"
156 .IX Header "DESCRIPTION"
157 \&\fBaddr2line\fR translates addresses into file names and line numbers.
158 Given an address in an executable or an offset in a section of a relocatable
159 object, it uses the debugging information to figure out which file name and
160 line number are associated with it.
161 .PP
162 The executable or relocatable object to use is specified with the \fB\-e\fR
163 option.  The default is the file \fIa.out\fR.  The section in the relocatable
164 object to use is specified with the \fB\-j\fR option.
165 .PP
166 \&\fBaddr2line\fR has two modes of operation.
167 .PP
168 In the first, hexadecimal addresses are specified on the command line,
169 and \fBaddr2line\fR displays the file name and line number for each
170 address.
171 .PP
172 In the second, \fBaddr2line\fR reads hexadecimal addresses from
173 standard input, and prints the file name and line number for each
174 address on standard output.  In this mode, \fBaddr2line\fR may be used
175 in a pipe to convert dynamically chosen addresses.
176 .PP
177 The format of the output is \fB\s-1FILENAME:LINENO\s0\fR.  By default
178 each input address generates one line of output.
179 .PP
180 Two options can generate additional lines before each
181 \&\fB\s-1FILENAME:LINENO\s0\fR line (in that order).
182 .PP
183 If the \fB\-a\fR option is used then a line with the input address
184 is displayed.
185 .PP
186 If the \fB\-f\fR option is used, then a line with the
187 \&\fB\s-1FUNCTIONNAME\s0\fR is displayed.  This is the name of the function
188 containing the address.
189 .PP
190 One option can generate additional lines after the
191 \&\fB\s-1FILENAME:LINENO\s0\fR line.
192 .PP
193 If the \fB\-i\fR option is used and the code at the given address is
194 present there because of inlining by the compiler then additional
195 lines are displayed afterwards.  One or two extra lines (if the
196 \&\fB\-f\fR option is used) are displayed for each inlined function.
197 .PP
198 Alternatively if the \fB\-p\fR option is used then each input
199 address generates a single, long, output line containing the address,
200 the function name, the file name and the line number.  If the
201 \&\fB\-i\fR option has also been used then any inlined functions will
202 be displayed in the same manner, but on separate lines, and prefixed
203 by the text \fB(inlined by)\fR.
204 .PP
205 If the file name or function name can not be determined,
206 \&\fBaddr2line\fR will print two question marks in their place.  If the
207 line number can not be determined, \fBaddr2line\fR will print 0.
208 .SH "OPTIONS"
209 .IX Header "OPTIONS"
210 The long and short forms of options, shown here as alternatives, are
211 equivalent.
212 .IP "\fB\-a\fR" 4
213 .IX Item "-a"
214 .PD 0
215 .IP "\fB\-\-addresses\fR" 4
216 .IX Item "--addresses"
217 .PD
218 Display the address before the function name, file and line number
219 information.  The address is printed with a \fB0x\fR prefix to easily
220 identify it.
221 .IP "\fB\-b\fR \fIbfdname\fR" 4
222 .IX Item "-b bfdname"
223 .PD 0
224 .IP "\fB\-\-target=\fR\fIbfdname\fR" 4
225 .IX Item "--target=bfdname"
226 .PD
227 Specify that the object-code format for the object files is
228 \&\fIbfdname\fR.
229 .IP "\fB\-C\fR" 4
230 .IX Item "-C"
231 .PD 0
232 .IP "\fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR" 4
233 .IX Item "--demangle[=style]"
234 .PD
235 Decode (\fIdemangle\fR) low-level symbol names into user-level names.
236 Besides removing any initial underscore prepended by the system, this
237 makes \*(C+ function names readable.  Different compilers have different
238 mangling styles. The optional demangling style argument can be used to
239 choose an appropriate demangling style for your compiler.
240 .IP "\fB\-e\fR \fIfilename\fR" 4
241 .IX Item "-e filename"
242 .PD 0
243 .IP "\fB\-\-exe=\fR\fIfilename\fR" 4
244 .IX Item "--exe=filename"
245 .PD
246 Specify the name of the executable for which addresses should be
247 translated.  The default file is \fIa.out\fR.
248 .IP "\fB\-f\fR" 4
249 .IX Item "-f"
250 .PD 0
251 .IP "\fB\-\-functions\fR" 4
252 .IX Item "--functions"
253 .PD
254 Display function names as well as file and line number information.
255 .IP "\fB\-s\fR" 4
256 .IX Item "-s"
257 .PD 0
258 .IP "\fB\-\-basenames\fR" 4
259 .IX Item "--basenames"
260 .PD
261 Display only the base of each file name.
262 .IP "\fB\-i\fR" 4
263 .IX Item "-i"
264 .PD 0
265 .IP "\fB\-\-inlines\fR" 4
266 .IX Item "--inlines"
267 .PD
268 If the address belongs to a function that was inlined, the source
269 information for all enclosing scopes back to the first non-inlined
270 function will also be printed.  For example, if \f(CW\*(C`main\*(C'\fR inlines
271 \&\f(CW\*(C`callee1\*(C'\fR which inlines \f(CW\*(C`callee2\*(C'\fR, and address is from
272 \&\f(CW\*(C`callee2\*(C'\fR, the source information for \f(CW\*(C`callee1\*(C'\fR and \f(CW\*(C`main\*(C'\fR
273 will also be printed.
274 .IP "\fB\-j\fR" 4
275 .IX Item "-j"
276 .PD 0
277 .IP "\fB\-\-section\fR" 4
278 .IX Item "--section"
279 .PD
280 Read offsets relative to the specified section instead of absolute addresses.
281 .IP "\fB\-p\fR" 4
282 .IX Item "-p"
283 .PD 0
284 .IP "\fB\-\-pretty\-print\fR" 4
285 .IX Item "--pretty-print"
286 .PD
287 Make the output more human friendly: each location are printed on one line.
288 If option \fB\-i\fR is specified, lines for all enclosing scopes are
289 prefixed with \fB(inlined by)\fR.
290 .IP "\fB@\fR\fIfile\fR" 4
291 .IX Item "@file"
292 Read command-line options from \fIfile\fR.  The options read are
293 inserted in place of the original @\fIfile\fR option.  If \fIfile\fR
294 does not exist, or cannot be read, then the option will be treated
295 literally, and not removed.
296 .Sp
297 Options in \fIfile\fR are separated by whitespace.  A whitespace
298 character may be included in an option by surrounding the entire
299 option in either single or double quotes.  Any character (including a
300 backslash) may be included by prefixing the character to be included
301 with a backslash.  The \fIfile\fR may itself contain additional
302 @\fIfile\fR options; any such options will be processed recursively.
303 .SH "SEE ALSO"
304 .IX Header "SEE ALSO"
305 Info entries for \fIbinutils\fR.
306 .SH "COPYRIGHT"
307 .IX Header "COPYRIGHT"
308 Copyright (c) 1991\-2014 Free Software Foundation, Inc.
309 .PP
310 Permission is granted to copy, distribute and/or modify this document
311 under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3
312 or any later version published by the Free Software Foundation;
313 with no Invariant Sections, with no Front-Cover Texts, and with no
314 Back-Cover Texts.  A copy of the license is included in the
315 section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".