Forrest logo
back to the addr2line tool

addr2line:tldr:40afc

addr2line: Display the function name, filename and line number.
$ addr2line --exe=${path-to-executable} --functions ${address}
try on your machine

The command addr2line is a utility tool that is used to decode an address in a given executable file and provides information about the corresponding source code file and line number where that address resides.

The command itself consists of several options and arguments:

  • --exe=${path-to-executable}: This option specifies the path to the executable file in which the address is located. You need to replace ${path-to-executable} with the actual path to the executable file.

  • --functions: This option tells addr2line to display the function name associated with the given address.

  • ${address}: This is the address you want to decode. It can be a memory address or an offset relative to the base address of the executable.

When you execute the addr2line command with the specified options and address, it will look up the address in the executable file, map it to the corresponding function name, source code file, and line number, and then display this information on the terminal.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the addr2line tool