Android NDK so crash,定位目标代码使用

命令行位于:

$NDK_HOME/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-addr2line

用法示意:

arm-linux-androideabi-addr2line -e 有符号的so crash内存地址

--help:

Usage: arm-linux-androideabi-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:
  @                Read options from
  -a --addresses         Show addresses
  -b --target=  Set the binary file format
  -e --exe=  Set the input file name (default is a.out)
  -i --inlines           Unwind inlined functions
  -j --section=    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


arm-linux-androideabi-addr2line: supported targets: elf32-littlearm elf32-bigarm elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex
Report bugs to

64位使用

aarch64-linux-android-addr2line

32位使用

arm-linux-androideabi-addr2line

例子

aarch64-linux-android-addr2line -e ~/Download/libxxx.so 0000000 0151ee4c

就能解析地址

你可能感兴趣的:(android)