Caution: This version of this document is no longer maintained. For the latest documentation, see


Convert addresses into line number/file name pairs (GNU)


addr2line_variant [-b bfdname] [-C [style]] [-e executable] [-f] [-h] [-s]
    [-v] [addr ...]

Runs on:



The addr2line_variant depends on the target platform, as follows:

Target platform: addr2line_variant:
All targets, plus native ntomulti-addr2line
ARM ntoarm-addr2line
MIPS ntomips-addr2line
PowerPC ntoppc-addr2line
SH4 ntosh-addr2line
x86 ntox86-addr2line
-b [bfdname] or --target[=bfdname]
Set the binary file format to bfdname.

Supported targets include: elf32-i386, coff-i386, elf32-little, elf32-big, elf32-littlearm, elf32-bigarm, elf32-littlemips, elf32-bigmips, elf32-powerpc, aixcoff-rs6000, elf32-powerpcle, ppcboot, elf32-shl, elf32-sh, coff-sh, coff-shl, coff-sh-small, coff-shl-small, srec, symbolsrec, tekhex, binary, and ihex.

-C [style] or --demangle[=style]
Decode (demangle) low-level symbol names into user-level names. Besides removing any initial underscore prepended by the system, this makes C++ function names readable. Different compilers have different mangling styles. The optional demangling style argument can be used to choose an appropriate demangling style for your compiler.
-e executable or --exe=executable
Set the input file name (default is a.out) to executable.
-f or --functions
Show function names as well as file and line number information.
-h or --help
Display the usage message.
-s or --basenames
Strip directory names.
-v or --version
Display the program's version information.


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.

addr2line has two modes of operation:

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 -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, addr2line will print two question marks in their place. If the line number can not be determined, addr2line will print 0.

Contributing author: