Forrest logo
back to the addr2line tool

addr2line:tldr:b9170

addr2line: Display the filename and line number of the source code from an instruction address of an executable.
$ addr2line --exe=${path-to-executable} ${address}
try on your machine

The command "addr2line --exe=${path-to-executable} ${address}" is used to retrieve the source code file name and line number corresponding to a given address in a compiled executable.

Here is a breakdown of the command:

  • "addr2line" is the name of the utility program used for address to line number translation.
  • "--exe=${path-to-executable}" is an option specifying the path to the executable file that you want to analyze. You need to replace "${path-to-executable}" with the actual path to the executable on your system.
  • "${address}" is the address for which you want to obtain the associated source code file and line number. You need to replace "${address}" with the actual address to be translated.

By executing this command, addr2line will analyze the executable file and use the provided address to determine the corresponding source code file name and line number. It can be useful for debugging purposes, especially when you have a memory address or crash dump and need to identify the exact location in the source code where the problem occurred.

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