commands.sh

addr2line

linux

Convert addresses of a binary into file names and line numbers.

More info →

Options (3)

-e, --exeboolean

Display the filename and line number of the source code from an instruction address of an executable

Example: addr2line {{[-e|--exe]}} {{path/to/executable}} {{address}}
-f, --functionsboolean

Display the function name, filename, and line number

Example: addr2line {{[-e|--exe]}} {{path/to/executable}} {{[-f|--functions]}} {{address}}
-C, --demangleboolean

Demangle the function name for C++ code

Example: addr2line {{[-e|--exe]}} {{path/to/executable}} {{[-f|--functions]}} {{[-C|--demangle]}} {{address}}

Examples (3)

Display the filename and line number of the source code from an instruction address of an executable

addr2line [-e|--exe] path/to/executable address

Display the function name, filename, and line number

addr2line [-e|--exe] path/to/executable [-f|--functions] address

Demangle the function name for C++ code

addr2line [-e|--exe] path/to/executable [-f|--functions] [-C|--demangle] address
made by @shridhargupta | data from tldr-pages