如何使用addr2line?我有一个程序,给出的最后10个地址的回溯,它访问之前崩溃。但是如果我使用这些地址来addr2line,比如
addr2line -e test [address]它只是给了我
??:0有没有一种特殊的方式来编译到使用addr2line,就像我们使用gdb来使用gdb一样?
发布于 2011-05-16 18:11:18
您需要将一些调试信息编译到您的可执行文件中。例如:
$ gcc t.c # debug information not requested
$ gdb ./a.out
...
(gdb) break main
Breakpoint 1 at 0x400588
(gdb) q
$ addr2line -e a.out 0x400588
??:0 # no information returned
$ gcc -g t.c # default debug information requested with -g
$ addr2line -e a.out 0x400588
t.c:4 # line information returnedd
$ https://stackoverflow.com/questions/6015769
复制相似问题