summaryrefslogtreecommitdiff
path: root/binutils/addr2line.1
blob: 87ce103f8e32e0f181b8693d4abab3989d500f44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
.\" Copyright (c) 1997 Free Software Foundation
.\" See COPYING for conditions for redistribution
.TH addr2line 1 "27 March 1997" "Cygnus Solutions" "GNU Development Tools"
.de BP
.sp
.ti \-.2i
\(**
..

.SH NAME
addr2line \- convert addresses into file names and line numbers

.SH SYNOPSIS
.hy 0
.na
.TP
.B addr2line
.RB "[\|" "\-b\ "\c
.I bfdname\c
.RB " | " "\-\-target="\c
.I bfdname\c
\&\|]
.RB "[\|" \-C | \-\-demangle "\|]"
.RB "[\|" "\-e\ "\c
.I filename\c
.RB " | " "\-\-exe="\c
.I filename\c
\&\|]
.RB "[\|" \-f | \-\-functions "\|]"
.RB "[\|" \-s | \-\-basenames "\|]"
.RB "[\|" \-H | \-\-help "\|]"
.RB "[\|" \-V | \-\-version "\|]"
.RB "[\|" addr addr ...  "\|]"
.ad b
.hy 1
.SH DESCRIPTION
\c
.B addr2line
translates program addresses into file names and line numbers.  Given
an address and an executable, it uses the debugging information in the
executable to figure out which file name and line number are
associated with a given address.

The executable to use is specified with the
.B \-e
option.  The default is
.B a.out\c
\&.

.B addr2line
has two modes of operation.

In the first, hexadecimal addresses are specified on the command line,
and
.B addr2line
displays the file name and line number for each address.

In the second,
.B addr2line
reads hexadecimal addresses from standard input, and prints the file
name and line number for each address on standard output.  In this
mode,
.B addr2line
may be used in a pipe to convert dynamically chosen addresses.

The format of the output is FILENAME:LINENO.  The file name and line
number for each address is printed on a separate line.  If the
.B \-f
option is used, then each FILENAME:LINENO line is preceded by a
FUNCTIONNAME line which is the name of the function containing the
address.

If the file name or function name can not be determined,
.B addr2line
will print two question marks in their place.  If the line number can
not be determined,
.B addr2line
will print 0.

.SH OPTIONS
.TP
.BI "\-b " "bfdname"\c
.TP
.BI "\-\-target=" "bfdname"
Specify the object-code format for the object files to be
\c
.I bfdname\c
\&.

.TP
.B \-C
.TP
.B \-\-demangle
Decode (\fIdemangle\fP) low-level symbol names into user-level names.
Besides removing any initial underscore prepended by the system, this
makes C++ function names readable.

.TP
.BI "\-e " "filename"\c
.TP
.BI "\-\-exe=" "filename"
Specify the name of the executable for which addresses should be
translated.  The default file is
.B a.out\c
\&.

.TP
.B \-f
.TP
.B \-\-functions
Display function names as well as file and line number information.

.TP
.B \-s
.TP
.B \-\-basenames
Display only the base of each file name.

.SH "SEE ALSO"
.RB "`\|" binutils "\|'"
entry in 
.B
info\c
\&; 
.I
The GNU Binary Utilities\c
\&, Roland H. Pesch (October 1991).