Next: ,Previous: c++filt,Up: Top

10 addr2line

addr2line [-b
bfdname|--target=
bfdname][-C|--demangle[=style]][-e
filename|--exe=
filename][-f|--functions] [-s|--basename][-i|--inlines][-j|--section=
name][-H|--help] [-V|--version][addr addr ...]

addr2line translates addresses into file names and line numbers. Given an address in an executable or an offset in a section of a relocatableobject, it uses the debugging information to figure out which file name andline number are associated with it.

The executable or relocatable object to use is specified with the -eoption. The default is the file a.out. The section in the relocatableobject to use is specified with the -j option.

addr2line has two modes of operation.

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

In the second, addr2line reads hexadecimal addresses fromstandard input, and prints the file name and line number for eachaddress on standard output. In this mode, addr2line may be usedin a pipe to convert dynamically chosen addresses.

The format of the output is FILENAME:LINENO. The file name andline number for each address is printed on a separate line. If the-f option is used, then each FILENAME:LINENO line ispreceded by a FUNCTIONNAME line which is the name of the functioncontaining the address.

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

The long and short forms of options, shown here as alternatives, areequivalent.

-b bfdname
--target= bfdname

Specify that the object-code format for the object files isbfdname.

-C
--demangle[= style ]

Decode (demangle) low-level symbol names into user-level names. Besides removing any initial underscore prepended by the system, thismakes C++ function names readable. Different compilers have differentmangling styles. The optional demangling style argument can be used tochoose an appropriate demangling style for your compiler. See c++filt,for more information on demangling.

-e filename
--exe= filename
Specify the name of the executable for which addresses should betranslated. The default file is a.out.
-f
--functions
Display function names as well as file and line number information.
-s
--basenames
Display only the base of each file name.
-i
--inlines
If the address belongs to a function that was inlined, the sourceinformation for all enclosing scopes back to the first non-inlinedfunction will also be printed. For example, if main inlinescallee1 which inlines callee2, and address is fromcallee2, the source information for callee1 and mainwill also be printed.
-j
--section
Read offsets relative to the specified section instead of absolute addresses.

Reference Home

Corrections, suggestions, and new documentation should be posted to the Forum.

The text of the Arduino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.

Reference Home

Corrections, suggestions, and new documentation should be posted to the Forum.

The text of the Arduino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.