arm-eabi-addr2line工具

来源:互联网 发布:淘宝购物怎么省钱 编辑:程序博客网 时间:2024/05/17 06:42
的在music模块中的相应log如下
09-29 06:35:59.509   132   132 I DEBUG   :          #00  pc 00015db8  /system/lib/libc.so
09-29 06:35:59.509   132   132 I DEBUG   :          #01  pc 00013f18  /system/lib/libc.so
09-29 06:35:59.509   132   132 I DEBUG   :          #02  pc 000145ce  /system/lib/libc.so
09-29 06:35:59.519   132   132 I DEBUG   :          #03  pc 0001ac6a  /system/lib/libbinder.so
09-29 06:35:59.519   132   132 I DEBUG   :          #04  pc 0001ad64  /system/lib/libbinder.so
09-29 06:35:59.519   132   132 I DEBUG   :          #05  pc 0001ad90  /system/lib/libbinder.so
09-29 06:35:59.519   132   132 I DEBUG   :          #06  pc 0001ada6  /system/lib/libbinder.so
09-29 06:35:59.519   132   132 I DEBUG   :          #07  pc 0001af48  /system/lib/libbinder.so
09-29 06:35:59.529   132   132 I DEBUG   :          #08  pc 000337e0  /system/lib/libmedia.so
09-29 06:35:59.529   132   132 I DEBUG   :          #09  pc 00030b3c  /system/lib/libmedia.so
09-29 06:35:59.529   132   132 I DEBUG   :          #10  pc 0003150a  /system/lib/libmedia.so
09-29 06:35:59.529   132   132 I DEBUG   :          #11  pc 0003168e  /system/lib/libmedia.so
09-29 06:35:59.529   132   132 I DEBUG   :          #12  pc 00004764  /system/lib/libsoundpool.so
根据log中的地址信息dump出相应的出错的地方,如下:
wll@wll:~/project/TD20_MP/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin$ ./arm-eabi-addr2line -f -e /home/wll/share_xp/td28_文件/musicMonkey锁屏重启so/bendi_so/libc.so 00015db8 00013f18 00013f18
__libc_android_abort
/home/wll/project/TD20_MP/bionic/libc/unistd/abort.c:82
dlmalloc
/home/wll/project/TD20_MP/bionic/libc/bionic/dlmalloc.c:4264
dlmalloc
/home/wll/project/TD20_MP/bionic/libc/bionic/dlmalloc.c:4264
根据以上信息分析源码.

同样的  修改工程模式会出现很多的问题,报出了一堆的内存地址的错误,这时候就可以用arm-eabi-4.4.3工具进行跟踪问题,找到出错的文件和行数,具体操作如下:
wll@wll:/var/data/wll/project/TD28_1204/TD20_MP/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin$ ./arm-eabi-addr2line --help
Usage: ./arm-eabi-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>
  -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
  -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-eabi-addr2line: supported targets: elf32-littlearm elf32-bigarm elf32-little elf32-big srec symbolsrec tekhex binary ihex
Report bugs to <http://www.sourceware.org/bugzilla/>

根据报错的地址 用此工具进行跟踪
wll@wll:/var/data/wll/project/TD28_1204/TD20_MP/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin$ ./arm-eabi-addr2line -f -e engtest 0x0000b3e6
./arm-eabi-addr2line -f -e 攻城名称+0x地址       跟踪出的信息如下:
eng_full_test // 出现问题的方法
/var/data/wll/project/TD28_1204/TD20_MP/external/sprd/engineeringmodel/engtest/sprd_engtest.c:639 // 文件和行数
同样的:
wll@wll:/var/data/wll/project/TD28_1204/TD20_MP/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin$ ./arm-eabi-addr2line -f -e engtest 0x0000c857
eng_plstest_start
/var/data/wll/project/TD28_1204/TD20_MP/external/sprd/engineeringmodel/engtest/sp8810/pl_sensor.c:459
原创粉丝点击