addr2line
addr2line is a command-line utility in the GNU binutils suite that converts program addresses into corresponding source code locations. It uses the DWARF debugging information embedded in an executable or core dump to determine the exact file name and line number where an instruction originates. This makes it useful for interpreting crash reports and stack traces.
Usage typically involves specifying the target executable with -e and listing one or more addresses to translate.
- -e to define the executable containing the debugging information
- -f to print the function names along with file and line
- -p to produce a more compact, one-line per address output that includes the address, function, and
- -a to annotate each address with its translated location
limitations and considerations:
- addr2line relies on DWARF debugging information; stripped binaries or those without debugging data will have limited
- When used with core dumps or crash reports, the addresses must correspond to code within the
Overall, addr2line is a lightweight tool for translating runtime addresses into human-readable source locations, aiding debugging