1 .\" Copyright (c) 2009,2010 Joseph Koshy <jkoshy@users.sourceforge.net>
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer
9 .\" in this position and unchanged.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
15 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 .\" $Id: addr2line.1 3642 2018-10-14 14:24:28Z jkoshy $
32 .Nd translate program addresses to source file names and line numbers
35 .Op Fl a | Fl -addresses
36 .Op Fl b Ar target | Fl -target Ns = Ns Ar target
37 .Op Fl e Ar pathname | Fl -exe Ns = Ns Ar pathname
38 .Op Fl f | Fl -functions
39 .Op Fl i | Fl -inlines
40 .Op Fl j Ar sectionname | Fl -section Ns = Ns Ar sectionname
41 .Op Fl p | Fl -pretty-print
42 .Op Fl s | Fl -basename
43 .Op Fl C | Fl -demangle
45 .Op Fl V | Fl -version
46 .Op Ar hexaddress Ns ...
50 utility translates program addresses specified by the command line
53 to their corresponding source file names and line numbers.
54 If no arguments are given to
56 it will read these addresses from standard input.
58 Program addresses specified by arguments
60 are encoded using the conventions accepted by
65 will use the executable
69 option may be used to specified a different ELF object.
73 utility recognizes the following options:
74 .Bl -tag -width indent
75 .It Fl a | Fl -addresses
76 Display the address prior to the line number information.
77 .It Fl b Ar target | Fl -target Ns = Ns Ar target
78 This option is recognized by
81 It is supported for compatibility with GNU binutils.
82 .It Fl e Ar pathname | Fl -exe Ns = Ns Ar pathname
83 Use the ELF object specified by argument
85 to translate addresses.
86 If this option is not specified,
90 .It Fl f | Fl -functions
91 Display function names in addition to file and line number information.
92 .It Fl i | Fl -inlines
93 If the address specified belongs to an inlined function, also display the line
94 number information for its caller, recursively until the first non-inlined
96 .It Fl j Ar sectionname | Fl -section Ns = Ns Ar sectionname
97 The values specified by arguments
99 are to be treated as offsets into the section named
101 .It Fl p | -pretty-print
102 Display the line number information on one line, in human readable manner.
104 Display only the base name for each file name.
105 .It Fl C | Fl -demangle
108 Print a help message.
109 .It Fl V | Fl -version
110 Print a version identifier and exit.
115 option was not specified,
117 will print the file name and line number for each address specified
122 option was specified,
124 will print a line containing the name of the function corresponding
127 followed by a line with the file name and line number.
131 option was specified,
133 will print line number information and function name on one line in
134 human readable manner. If the
136 option was also specified,
138 will print the caller function information prefixed with
143 utility prints the file name and line number using the format
144 .Dq FILENAME:LINENUMBER .
146 If a file or function name could not be determined,
148 will print a question mark in their place.
149 If the line number could not be determined,
151 will print a zero in its place.
153 To map address 080483c4 in the default executable
155 to a source file name and line number use:
156 .D1 "% addr2line 080483c4"
158 To map address 080483c4 in executable
161 .D1 "% addr2line -e helloworld 080483c4"
165 act as a filter reading addresses from its standard input use:
168 To print the function name corresponding to an address in addition to
169 its source file and line number use:
170 .D1 "% addr2line -f 080483c4"
181 utility was written by
182 .An Kai Wang Aq Mt kaiwang27@users.sourceforge.net .