Debian Codegraph @

upstream/debian-unstable/man1/addr2line.1

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "ADDR2LINE 1"
58 .TH ADDR2LINE 1 2026-03-05 binutils-2.46 "GNU Development Tools"
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 addr2line \- convert addresses or symbol+offset into file names and line numbers
65 .SH SYNOPSIS
66 .IX Header "SYNOPSIS"
67 addr2line [\fB\-a\fR|\fB\-\-addresses\fR]
68 [\fB\-b\fR \fIbfdname\fR|\fB\-\-target=\fR\fIbfdname\fR]
69 [\fB\-C\fR|\fB\-\-demangle\fR[=\fIstyle\fR]]
70 [\fB\-r\fR|\fB\-\-no\-recurse\-limit\fR]
71 [\fB\-R\fR|\fB\-\-recurse\-limit\fR]
72 [\fB\-e\fR \fIfilename\fR|\fB\-\-exe=\fR\fIfilename\fR]
73 [\fB\-f\fR|\fB\-\-functions\fR] [\fB\-s\fR|\fB\-\-basename\fR]
74 [\fB\-i\fR|\fB\-\-inlines\fR]
75 [\fB\-p\fR|\fB\-\-pretty\-print\fR]
76 [\fB\-j\fR|\fB\-\-section=\fR\fIname\fR]
77 [\fB\-H\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR]
78 [addr addr ...]
79 .SH DESCRIPTION
80 .IX Header "DESCRIPTION"
81 \&\fBaddr2line\fR translates addresses or symbol+offset into file names and line numbers.
82 Given an address or symbol+offset in an executable or an offset in a section of a relocatable
83 object, it uses the debugging information to figure out which file name and
84 line number are associated with it.
85 .PP
86 The executable or relocatable object to use is specified with the \fB\-e\fR
87 option. The default is the file \fIa.out\fR. The section in the relocatable
88 object to use is specified with the \fB\-j\fR option.
89 .PP
90 \&\fBaddr2line\fR has two modes of operation.
91 .PP
92 In the first, hexadecimal addresses or symbol+offset are specified on the command line,
93 and \fBaddr2line\fR displays the file name and line number for each
94 address.
95 .PP
96 In the second, \fBaddr2line\fR reads hexadecimal addresses or symbol+offset from
97 standard input, and prints the file name and line number for each
98 address on standard output. In this mode, \fBaddr2line\fR may be used
99 in a pipe to convert dynamically chosen addresses.
100 .PP
101 The format of the output is \fBFILENAME:LINENO\fR. By default
102 each input address generates one line of output.
103 .PP
104 Two options can generate additional lines before each
105 \&\fBFILENAME:LINENO\fR line (in that order).
106 .PP
107 If the \fB\-a\fR option is used then a line with the input address
108 is displayed.
109 .PP
110 If the \fB\-f\fR option is used, then a line with the
111 \&\fBFUNCTIONNAME\fR is displayed. This is the name of the function
112 containing the address.
113 .PP
114 One option can generate additional lines after the
115 \&\fBFILENAME:LINENO\fR line.
116 .PP
117 If the \fB\-i\fR option is used and the code at the given address is
118 present there because of inlining by the compiler then additional
119 lines are displayed afterwards. One or two extra lines (if the
120 \&\fB\-f\fR option is used) are displayed for each inlined function.
121 .PP
122 Alternatively if the \fB\-p\fR option is used then each input
123 address generates a single, long, output line containing the address,
124 the function name, the file name and the line number. If the
125 \&\fB\-i\fR option has also been used then any inlined functions will
126 be displayed in the same manner, but on separate lines, and prefixed
127 by the text \fB(inlined by)\fR.
128 .PP
129 If the file name or function name can not be determined,
130 \&\fBaddr2line\fR will print two question marks in their place. If the
131 line number can not be determined, \fBaddr2line\fR will print 0.
132 .PP
133 When symbol+offset is used, +offset is optional, except when the symbol
134 is ambigious with a hex number. The resolved symbols can be mangled
135 or unmangled, except unmangled symbols with + are not allowed.
136 .SH OPTIONS
137 .IX Header "OPTIONS"
138 The long and short forms of options, shown here as alternatives, are
139 equivalent.
140 .IP \fB\-a\fR 4
141 .IX Item "-a"
142 .PD 0
143 .IP \fB\-\-addresses\fR 4
144 .IX Item "--addresses"
145 .PD
146 Display the address before the function name, file and line number
147 information. The address is printed with a \fB0x\fR prefix to easily
148 identify it.
149 .IP "\fB\-b\fR \fIbfdname\fR" 4
150 .IX Item "-b bfdname"
151 .PD 0
152 .IP \fB\-\-target=\fR\fIbfdname\fR 4
153 .IX Item "--target=bfdname"
154 .PD
155 Specify that the object-code format for the object files is
156 \&\fIbfdname\fR.
157 .IP \fB\-C\fR 4
158 .IX Item "-C"
159 .PD 0
160 .IP \fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR 4
161 .IX Item "--demangle[=style]"
162 .PD
163 Decode (\fIdemangle\fR) low-level symbol names into user-level names.
164 Besides removing any initial underscore prepended by the system, this
165 makes C++ function names readable. Different compilers have different
166 mangling styles. The optional demangling style argument can be used to
167 choose an appropriate demangling style for your compiler.
168 .IP "\fB\-e\fR \fIfilename\fR" 4
169 .IX Item "-e filename"
170 .PD 0
171 .IP \fB\-\-exe=\fR\fIfilename\fR 4
172 .IX Item "--exe=filename"
173 .PD
174 Specify the name of the executable for which addresses should be
175 translated. The default file is \fIa.out\fR.
176 .IP \fB\-f\fR 4
177 .IX Item "-f"
178 .PD 0
179 .IP \fB\-\-functions\fR 4
180 .IX Item "--functions"
181 .PD
182 Display function names as well as file and line number information.
183 .IP \fB\-s\fR 4
184 .IX Item "-s"
185 .PD 0
186 .IP \fB\-\-basenames\fR 4
187 .IX Item "--basenames"
188 .PD
189 Display only the base of each file name.
190 .IP \fB\-i\fR 4
191 .IX Item "-i"
192 .PD 0
193 .IP \fB\-\-inlines\fR 4
194 .IX Item "--inlines"
195 .PD
196 If the address belongs to a function that was inlined, the source
197 information for all enclosing scopes back to the first non-inlined
198 function will also be printed. For example, if \f(CW\*(C`main\*(C'\fR inlines
199 \&\f(CW\*(C`callee1\*(C'\fR which inlines \f(CW\*(C`callee2\*(C'\fR, and address is from
200 \&\f(CW\*(C`callee2\*(C'\fR, the source information for \f(CW\*(C`callee1\*(C'\fR and \f(CW\*(C`main\*(C'\fR
201 will also be printed.
202 .IP \fB\-j\fR 4
203 .IX Item "-j"
204 .PD 0
205 .IP \fB\-\-section\fR 4
206 .IX Item "--section"
207 .PD
208 Read offsets relative to the specified section instead of absolute addresses.
209 .IP \fB\-p\fR 4
210 .IX Item "-p"
211 .PD 0
212 .IP \fB\-\-pretty\-print\fR 4
213 .IX Item "--pretty-print"
214 .PD
215 Make the output more human friendly: each location are printed on one line.
216 If option \fB\-i\fR is specified, lines for all enclosing scopes are
217 prefixed with \fB(inlined by)\fR.
218 .IP \fB\-r\fR 4
219 .IX Item "-r"
220 .PD 0
221 .IP \fB\-R\fR 4
222 .IX Item "-R"
223 .IP \fB\-\-recurse\-limit\fR 4
224 .IX Item "--recurse-limit"
225 .IP \fB\-\-no\-recurse\-limit\fR 4
226 .IX Item "--no-recurse-limit"
227 .IP \fB\-\-recursion\-limit\fR 4
228 .IX Item "--recursion-limit"
229 .IP \fB\-\-no\-recursion\-limit\fR 4
230 .IX Item "--no-recursion-limit"
231 .PD
232 Enables or disables a limit on the amount of recursion performed
233 whilst demangling strings. Since the name mangling formats allow for
234 an infinite level of recursion it is possible to create strings whose
235 decoding will exhaust the amount of stack space available on the host
236 machine, triggering a memory fault. The limit tries to prevent this
237 from happening by restricting recursion to 2048 levels of nesting.
238 .Sp
239 The default is for this limit to be enabled, but disabling it may be
240 necessary in order to demangle truly complicated names. Note however
241 that if the recursion limit is disabled then stack exhaustion is
242 possible and any bug reports about such an event will be rejected.
243 .Sp
244 The \fB\-r\fR option is a synonym for the
245 \&\fB\-\-no\-recurse\-limit\fR option. The \fB\-R\fR option is a
246 synonym for the \fB\-\-recurse\-limit\fR option.
247 .Sp
248 Note this option is only effective if the \fB\-C\fR or
249 \&\fB\-\-demangle\fR option has been enabled.
250 .IP \fB@\fR\fIfile\fR 4
251 .IX Item "@file"
252 Read command-line options from \fIfile\fR. The options read are
253 inserted in place of the original @\fIfile\fR option. If \fIfile\fR
254 does not exist, or cannot be read, then the option will be treated
255 literally, and not removed.
256 .Sp
257 Options in \fIfile\fR are separated by whitespace. A whitespace
258 character may be included in an option by surrounding the entire
259 option in either single or double quotes. Any character (including a
260 backslash) may be included by prefixing the character to be included
261 with a backslash. The \fIfile\fR may itself contain additional
262 @\fIfile\fR options; any such options will be processed recursively.
263 .SH "SEE ALSO"
264 .IX Header "SEE ALSO"
265 Info entries for \fIbinutils\fR.
266 .SH COPYRIGHT
267 .IX Header "COPYRIGHT"
268 Copyright (c) 1991\-2026 Free Software Foundation, Inc.
269 .PP
270 Permission is granted to copy, distribute and/or modify this document
271 under the terms of the GNU Free Documentation License, Version 1.3
272 or any later version published by the Free Software Foundation;
273 with no Invariant Sections, with no Front-Cover Texts, and with no
274 Back-Cover Texts. A copy of the license is included in the
275 section entitled "GNU Free Documentation License".