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.  The file name and line
41       number for each input address is printed on separate lines.
42
43       If the -f option is used, then each FILENAME:LINENO line is preceded by
44       FUNCTIONNAME which is the name of the function containing the address.
45
46       If the -i option is used and the code at the given address is present
47       there because of inlining by the compiler then the {FUNCTIONNAME}
48       FILENAME:LINENO information for the inlining function will be displayed
49       afterwards.  This continues recursively until there is no more inlining
50       to report.
51
52       If the -a option is used then the output is prefixed by the input
53       address.
54
55       If the -p option is used then the output for each input address is
56       displayed on one, possibly quite long, line.  If -p is not used then
57       the output is broken up into multiple lines, based on the paragraphs
58       above.
59
60       If the file name or function name can not be determined, addr2line will
61       print two question marks in their place.  If the line number can not be
62       determined, addr2line will print 0.
63

OPTIONS

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

SEE ALSO

135       Info entries for binutils.
136
138       Copyright (c) 1991-2013 Free Software Foundation, Inc.
139
140       Permission is granted to copy, distribute and/or modify this document
141       under the terms of the GNU Free Documentation License, Version 1.3 or
142       any later version published by the Free Software Foundation; with no
143       Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
144       Texts.  A copy of the license is included in the section entitled "GNU
145       Free Documentation License".
146
147
148
149binutils-2.24                     2018-07-14                      ADDR2LINE(1)
Impressum