ADDR2LINE(1)
π NAME π
addr2line β turns addresses into file names and line numbers, bestie. that's it, that's the whole job. π
it's a GNU Development Tools girlie, living her best life in the binutils friend group. π«Ά
β¨ SYNOPSIS β¨
addr2line [-b bfdnameβͺ--target=bfdname]
[-Cβͺ--demangle[=style]]
[-e filenameβͺ--exe=filename]
[-fβͺ--functions] [-sβͺ--basename]
[-Hβͺ--help] [-Vβͺ--version]
[addr addr ...]
πΈ DESCRIPTION πΈ
okay so picture this: you have a program address and you have an executable, and you're like "which file? which line? which girl?" π
addr2line translates program addresses into file names and line numbers. Given an address and an executable, it uses the debugging information inside the executable to figure out which file name and line number are associated with a given address. it's giving detective but make it debug info. πβ¨
the executable you wanna use gets specified with the -e option. and if you don't say anything? the default is the file a.out. no cap. π«Ά
addr2line has two modes of operation, and honestly both are iconic:
- In the first mode, hexadecimal addresses are specified right there on the command line, and
addr2linedisplays the file name and line number for each address. very direct, very demure. π - In the second mode,
addr2linereads hexadecimal addresses from standard input, and prints the file name and line number for each address on standard output. in this mode,addr2linemay be used in a pipe to convert dynamically chosen addresses. pipeline queen behavior fr fr. π§
the format of the output is FILENAME:LINENO. the file name and line number for each address is printed on a separate line. and if you use the -f option, then each FILENAME:LINENO line is preceded by a FUNCTIONNAME line, which is the name of the function containing the address. so you get the whole β¨contextβ¨ bestie.
now the sad part π β if the file name or function name can not be determined, addr2line will print two question marks in their place. and if the line number can not be determined, addr2line will print 0. it's doing its best, okay?? give her a break. π
π OPTIONS π
the long and short forms of options, shown here as alternatives, are equivalent. so pick your fave, they're the same, periodt. π
-bbfdname,--target=bfdname β Specify that the object-code format for the object files is bfdname. you're telling her which format the object files are in, queen of specificity. π₯-C,--demangle[=style]β Decode (demangle) low-level symbol names into user-level names. besides removing any initial underscore prepended by the system, this makes C++ function names readable. different compilers have different mangling styles, so the optional demangling style argument can be used to choose an appropriate demangling style for your compiler. it's literally a glow-up for your symbol names, the way that_ZN3foo3barEvbecomesfoo::bar()is so satisfying. π¦β¨-efilename,--exe=filename β Specify the name of the executable for which addresses should be translated. the default file isa.out. so if you don't pass this, she's just gonna go looking fora.outlike it's her ex. π-f,--functionsβ Display function names as well as file and line number information. more info, more slay. πβ¨-s,--basenamesβ Display only the base of each file name. she's keeping it short and cute, no long paths, just the vibes. π
also lurking in the synopsis:-H/--helpand-V/--version, for when you need a lil help or you wanna know what version you're running. iykyk. π
π SEE ALSO π
- Info entries for
binutils. go read those, bestie, they ate. π
π COPYRIGHT π
Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''.
okay that's the whole page bestie, we ate and left no crumbs π β¨ this little love letter to your terminal is from binutils-2.15.97, dated 2005-04-20. periodt. ππ
π¦ where this page comes from
- debian bookworm: binutils-h8300-hms 2.16.1-10+b2
- debian trixie: binutils-h8300-hms 2.16.1-13
- ubuntu jammy: binutils-h8300-hms 2.16.1-10build1
- ubuntu noble: binutils-h8300-hms 2.16.1-10build1
- ubuntu resolute: binutils-h8300-hms 2.16.1-15
- ubuntu stonking: binutils-h8300-hms 2.16.1-15
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms