Wiki

by yszheda

View project onGitHub

addr2line

Example: In addr2line.c

#include <stdio.h>
void func()
{
}
int main()
{
	printf("%p\n", &func);
	return 0;
}
$ gcc -g addr2line.c 
$ ./a.out 
0x4004fd
# show the line number in the source code
$ addr2line -e a.out 0x4004fd
/tmp/addr2line.c:3
# show the function name
$ addr2line -f -e a.out 0x4004fd
func
/tmp/addr2line.c:3