1ADDR2LINE(1)                 GNU Development Tools                ADDR2LINE(1)
2
3
4

NAME

6       addr2line - convert addresses into file names and line numbers.
7

SYNOPSIS

9       addr2line [-a|--addresses]
10                 [-b bfdname|--target=bfdname]
11                 [-C|--demangle[=style]]
12                 [-e filename|--exe=filename]
13                 [-f|--functions] [-s|--basename]
14                 [-i|--inlines]
15                 [-p|--pretty-print]
16                 [-j|--section=name]
17                 [-H|--help] [-V|--version]
18                 [addr addr ...]
19

DESCRIPTION

21       addr2line translates addresses into file names and line numbers.  Given
22       an address in an executable or an offset in a section of a relocatable
23       object, it uses the debugging information to figure out which file name
24       and line number are associated with it.
25
26       The executable or relocatable object to use is specified with the -e
27       option.  The default is the file a.out.  The section in the relocatable
28       object to use is specified with the -j option.
29
30       addr2line has two modes of operation.
31
32       In the first, hexadecimal addresses are specified on the command line,
33       and addr2line displays the file name and line number for each address.
34
35       In the second, addr2line reads hexadecimal addresses from standard
36       input, and prints the file name and line number for each address on
37       standard output.  In this mode, addr2line may be used in a pipe to
38       convert dynamically chosen addresses.
39
40       The format of the output is FILENAME:LINENO.  By default each input
41       address generates one line of output.
42
43       Two options can generate additional lines before each FILENAME:LINENO
44       line (in that order).
45
46       If the -a option is used then a line with the input address is
47       displayed.
48
49       If the -f option is used, then a line with the FUNCTIONNAME is
50       displayed.  This is the name of the function containing the address.
51
52       One option can generate additional lines after the FILENAME:LINENO
53       line.
54
55       If the -i option is used and the code at the given address is present
56       there because of inlining by the compiler then additional lines are
57       displayed afterwards.  One or two extra lines (if the -f option is
58       used) are displayed for each inlined function.
59
60       Alternatively if the -p option is used then each input address
61       generates a single, long, output line containing the address, the
62       function name, the file name and the line number.  If the -i option has
63       also been used then any inlined functions will be displayed in the same
64       manner, but on separate lines, and prefixed by the text (inlined by).
65
66       If the file name or function name can not be determined, addr2line will
67       print two question marks in their place.  If the line number can not be
68       determined, addr2line will print 0.
69

OPTIONS

71       The long and short forms of options, shown here as alternatives, are
72       equivalent.
73
74       -a
75       --addresses
76           Display the address before the function name, file and line number
77           information.  The address is printed with a 0x prefix to easily
78           identify it.
79
80       -b bfdname
81       --target=bfdname
82           Specify that the object-code format for the object files is
83           bfdname.
84
85       -C
86       --demangle[=style]
87           Decode (demangle) low-level symbol names into user-level names.
88           Besides removing any initial underscore prepended by the system,
89           this makes C++ function names readable.  Different compilers have
90           different mangling styles. The optional demangling style argument
91           can be used to choose an appropriate demangling style for your
92           compiler.
93
94       -e filename
95       --exe=filename
96           Specify the name of the executable for which addresses should be
97           translated.  The default file is a.out.
98
99       -f
100       --functions
101           Display function names as well as file and line number information.
102
103       -s
104       --basenames
105           Display only the base of each file name.
106
107       -i
108       --inlines
109           If the address belongs to a function that was inlined, the source
110           information for all enclosing scopes back to the first non-inlined
111           function will also be printed.  For example, if "main" inlines
112           "callee1" which inlines "callee2", and address is from "callee2",
113           the source information for "callee1" and "main" will also be
114           printed.
115
116       -j
117       --section
118           Read offsets relative to the specified section instead of absolute
119           addresses.
120
121       -p
122       --pretty-print
123           Make the output more human friendly: each location are printed on
124           one line.  If option -i is specified, lines for all enclosing
125           scopes are prefixed with (inlined by).
126
127       @file
128           Read command-line options from file.  The options read are inserted
129           in place of the original @file option.  If file does not exist, or
130           cannot be read, then the option will be treated literally, and not
131           removed.
132
133           Options in file are separated by whitespace.  A whitespace
134           character may be included in an option by surrounding the entire
135           option in either single or double quotes.  Any character (including
136           a backslash) may be included by prefixing the character to be
137           included with a backslash.  The file may itself contain additional
138           @file options; any such options will be processed recursively.
139

SEE ALSO

141       Info entries for binutils.
142
144       Copyright (c) 1991-2018 Free Software Foundation, Inc.
145
146       Permission is granted to copy, distribute and/or modify this document
147       under the terms of the GNU Free Documentation License, Version 1.3 or
148       any later version published by the Free Software Foundation; with no
149       Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
150       Texts.  A copy of the license is included in the section entitled "GNU
151       Free Documentation License".
152
153
154
155binutils-2.30                     2018-01-27                      ADDR2LINE(1)
Impressum