Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use the addr2line command in Linux?

I am trying to use addr2line command in Unix but everytime it is giving the same output as ??:0. I am giving command as addr2line -e a.out 0x4005BDC . I got this address while running this a.out executable with valgrind tool to find the memory leakage. I also compiled the source code with -g option.

like image 990
Prak Avatar asked Oct 04 '11 13:10

Prak


People also ask

How does addr2line work?

addr2line translates program addresses into file names and line numbers. Given an address and an executable, it uses the debugging information in the executable to figure out which file name and line number are associated with a given address. The executable to use is specified with the -e option.


1 Answers

You can also use gdb instead of addr2line to examine memory address. Load executable file in gdb and print the name of a symbol which is stored at the address. 16 Examining the Symbol Table.

(gdb) info symbol 0x4005BDC  
like image 179
ks1322 Avatar answered Oct 13 '22 21:10

ks1322