Debian Codegraph @

upstream/opensuse-tumbleweed/man1/addr2line.1

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