| 1 | .\" Copyright (c) 1997 Free Software Foundation |
| 2 | .\" See COPYING for conditions for redistribution |
| 3 | .TH addr2line 1 "27 March 1997" "Cygnus Solutions" "GNU Development Tools" |
| 4 | .de BP |
| 5 | .sp |
| 6 | .ti \-.2i |
| 7 | \(** |
| 8 | .. |
| 9 | |
| 10 | .SH NAME |
| 11 | addr2line \- convert addresses into file names and line numbers |
| 12 | |
| 13 | .SH SYNOPSIS |
| 14 | .hy 0 |
| 15 | .na |
| 16 | .TP |
| 17 | .B addr2line |
| 18 | .RB "[\|" "\-b\ "\c |
| 19 | .I bfdname\c |
| 20 | .RB " | " "\-\-target="\c |
| 21 | .I bfdname\c |
| 22 | \&\|] |
| 23 | .RB "[\|" \-C | \-\-demangle "\|]" |
| 24 | .RB "[\|" "\-e\ "\c |
| 25 | .I filename\c |
| 26 | .RB " | " "\-\-exe="\c |
| 27 | .I filename\c |
| 28 | \&\|] |
| 29 | .RB "[\|" \-f | \-\-functions "\|]" |
| 30 | .RB "[\|" \-s | \-\-basenames "\|]" |
| 31 | .RB "[\|" \-H | \-\-help "\|]" |
| 32 | .RB "[\|" \-V | \-\-version "\|]" |
| 33 | .RB "[\|" addr addr ... "\|]" |
| 34 | .ad b |
| 35 | .hy 1 |
| 36 | .SH DESCRIPTION |
| 37 | \c |
| 38 | .B addr2line |
| 39 | translates program addresses into file names and line numbers. Given |
| 40 | an address and an executable, it uses the debugging information in the |
| 41 | executable to figure out which file name and line number are |
| 42 | associated with a given address. |
| 43 | |
| 44 | The executable to use is specified with the |
| 45 | .B \-e |
| 46 | option. The default is |
| 47 | .B a.out\c |
| 48 | \&. |
| 49 | |
| 50 | .B addr2line |
| 51 | has two modes of operation. |
| 52 | |
| 53 | In the first, hexadecimal addresses are specified on the command line, |
| 54 | and |
| 55 | .B addr2line |
| 56 | displays the file name and line number for each address. |
| 57 | |
| 58 | In the second, |
| 59 | .B addr2line |
| 60 | reads hexadecimal addresses from standard input, and prints the file |
| 61 | name and line number for each address on standard output. In this |
| 62 | mode, |
| 63 | .B addr2line |
| 64 | may be used in a pipe to convert dynamically chosen addresses. |
| 65 | |
| 66 | The format of the output is FILENAME:LINENO. The file name and line |
| 67 | number for each address is printed on a separate line. If the |
| 68 | .B \-f |
| 69 | option is used, then each FILENAME:LINENO line is preceded by a |
| 70 | FUNCTIONNAME line which is the name of the function containing the |
| 71 | address. |
| 72 | |
| 73 | If the file name or function name can not be determined, |
| 74 | .B addr2line |
| 75 | will print two question marks in their place. If the line number can |
| 76 | not be determined, |
| 77 | .B addr2line |
| 78 | will print 0. |
| 79 | |
| 80 | .SH OPTIONS |
| 81 | .TP |
| 82 | .BI "\-b " "bfdname"\c |
| 83 | .TP |
| 84 | .BI "\-\-target=" "bfdname" |
| 85 | Specify the object-code format for the object files to be |
| 86 | \c |
| 87 | .I bfdname\c |
| 88 | \&. |
| 89 | |
| 90 | .TP |
| 91 | .B \-C |
| 92 | .TP |
| 93 | .B \-\-demangle |
| 94 | Decode (\fIdemangle\fP) low-level symbol names into user-level names. |
| 95 | Besides removing any initial underscore prepended by the system, this |
| 96 | makes C++ function names readable. |
| 97 | |
| 98 | .TP |
| 99 | .BI "\-e " "filename"\c |
| 100 | .TP |
| 101 | .BI "\-\-exe=" "filename" |
| 102 | Specify the name of the executable for which addresses should be |
| 103 | translated. The default file is |
| 104 | .B a.out\c |
| 105 | \&. |
| 106 | |
| 107 | .TP |
| 108 | .B \-f |
| 109 | .TP |
| 110 | .B \-\-functions |
| 111 | Display function names as well as file and line number information. |
| 112 | |
| 113 | .TP |
| 114 | .B \-s |
| 115 | .TP |
| 116 | .B \-\-basenames |
| 117 | Display only the base of each file name. |
| 118 | |
| 119 | .SH "SEE ALSO" |
| 120 | .RB "`\|" binutils "\|'" |
| 121 | entry in |
| 122 | .B |
| 123 | info\c |
| 124 | \&; |
| 125 | .I |
| 126 | The GNU Binary Utilities\c |
| 127 | \&, Roland H. Pesch (October 1991). |