addr2line

addr2line

Usage: addr2line [option(s)] [addr(s)]
 Convert addresses into line number/file name pairs.
 If no addresses are specified on the command line, they will be read from stdin
 The options are:
  @<file>                Read options from <file>
  -a --addresses         Show addresses
  -b --target=<bfdname>  Set the binary file format
  -e --exe=<executable>  Set the input file name (default is a.out)
  -i --inlines           Unwind inlined functions
  -j --section=<name>    Read section-relative offsets instead of addresses
  -p --pretty-print      Make the output easier to read for humans
  -s --basenames         Strip directory names
  -f --functions         Show function names
  -C --demangle[=style]  Demangle function names
  -h --help              Display this information
  -v --version           Display the program's version

addr2line: supported targets: elf64-x86-64 elf32-i386 elf32-x86-64 a.out-i386-linux pei-i386 pei-x86-64 elf64-l1om elf64-k1om elf64-little elf64-big elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex
Report bugs to <
http://www.sourceware.org/bugzilla/>


addr2line -f -C -p -e  xx.so

arm-linux-androideabi-addr2line -f -C -e symbols address


注意 backtrace 中 #00  pc 的最后一列(使用括号括住),其中在函数名的后面有一个+N,这个N就是崩溃位置的偏移量(注意它是10进制数,而 symbol address 是16进制数,你需要先做转换才能相加)

release 版本的库文件也是有 DYNAMIC SYMBOL TABLE 的,你可以使用命令 objdump -T -R <your so> (并重定向到一个文本文件中)来查看,然后你可以用同样的命令去查看 debug 版本的 DYNAMIC SYMBOL TABLE,通过比较,不难发现,他们的格式是一样的,你需要关注的只是第一列(symbol address)和最后一列(symbol name)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值