android 的堆栈调试

 最近调试android,kernel崩溃了,android的调试没有linux平台那么方便,google了一把,在网上发现可以借助堆栈信息确定出错的函数。
下面是堆栈出错时的堆栈信息:
I/HYJ***tUtility( 1050): #############get() media.maxVolume
I/DEBUG   (  661): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (  661): Build fingerprint: 'Hi3716C/Hi3716C/Hi3716C/:2.2/Sbox8800/88000121:eng/test-keys'
I/DEBUG   (  661): pid: 985, tid: 1112  >>> system_server <<<
I/DEBUG   (  661): signal 11 (SIGSEGV), fault addr deadbaad
I/DEBUG   (  661):  r0 00000000  r1 afd14879  r2 00000027  r3 00000070
I/DEBUG   (  661):  r4 afd42328  r5 00000000  r6 00000000  r7 0000a000
I/DEBUG   (  661):  r8 556f99b8  r9 45d2de6c  10 45d2de58  fp 556f9d00
I/DEBUG   (  661):  ip 00001728  sp 556f9920  lr deadbaad  pc afd11ec0  cpsr 60000030
I/DEBUG   (  661):  d0  0000000000000000  d1  3ff0000000000000
I/DEBUG   (  661):  d2  0000000050baf6de  d3  0000000000000000
I/DEBUG   (  661):  d4  00000009000000b4  d5  bf50000000000000
I/DEBUG   (  661):  d6  4079280000000000  d7  40494240424a1200
I/DEBUG   (  661):  d8  0000000000000000  d9  0000000000000000
I/DEBUG   (  661):  d10 0000000000000000  d11 0000000000000000
I/DEBUG   (  661):  d12 0000000000000000  d13 0000000000000000
I/DEBUG   (  661):  d14 0000000000000000  d15 0000000000000000
I/DEBUG   (  661):  scr 60000012
I/DEBUG   (  661): 
I/DEBUG   (  661):          #00  pc 00011ec0  /system/lib/libc.so
I/DEBUG   (  661):          #01  pc 0000bdf2  /system/lib/libc.so
I/DEBUG   (  661):          #02  pc 0000cd52  /system/lib/libc.so
I/DEBUG   (  661):          #03  pc 00020a02  /system/lib/libhi_mpi.so
I/DEBUG   (  661):          #04  pc 0001e4a6  /system/lib/libhi_mpi.so
I/DEBUG   (  661):          #05  pc 000439ba  /system/lib/libhi_mpi.so
I/DEBUG   (  661):          #06  pc 0005ab02  /system/lib/libandroid_runtime.so
I/DEBUG   (  661):          #07  pc 00010df4  /system/lib/libdvm.so
I/DEBUG   (  661):          #08  pc 0003f100  /system/lib/libdvm.so
I/DEBUG   (  661):          #09  pc 00015d58  /system/lib/libdvm.so
I/DEBUG   (  661):          #10  pc 0001c758  /system/lib/libdvm.so
I/DEBUG   (  661):          #11  pc 0001b5ec  /system/lib/libdvm.so
I/DEBUG   (  661):          #12  pc 0005649c  /system/lib/libdvm.so
I/DEBUG   (  661):          #13  pc 000422d2  /system/lib/libdvm.code = 19,value = 1
so
I/DEBUG   (  661):          #14  pc 0004dd50  /system/lib/libandroid_runtime.so
I/DEBUG   (  661):          #15  pc 0004e08e  /system/lib/libandroid_runtime.so
I/DEBUG   (  661):          #16  pc 00013440  /system/lib/libbinder.so
I/DEBUG   (  661):          #17  pc 00016c88  /system/lib/libbinder.so
I/DEBUG   (  661):          #18  pc 00016e70  /system/lib/libbinder.so
I/DEBUG   (  661):          #19  pc 0001cef8  /system/lib/libbinder.so
I/DEBUG   (  661):          #20  pc 0001c316  /system/lib/libutils.so
I/DEBUG   (  661):          #21  pc 00033eca  /system/lib/libandroid_runtime.so
I/DEBUG   (  661):          #22  pc 0001c7e8  /system/lib/libutils.so
I/DEBUG   (  661):          #23  pc 000110fc  /system/lib/libc.so
I/DEBUG   (  661):          #24  pc 00010bcc  /system/lib/libc.so
I/DEBUG   (  661): 
I/DEBUG   (  661): code around pc:
I/DEBUG   (  661): afd11ea0 2d00682d e029d1fb b12b68db c05cf8df 
I/DEBUG   (  661): afd11eb0 f8442001 4798000c e054f8df 26002227 
I/DEBUG   (  661): afd11ec0 2000f88e edbcf7fb f7fc2106 f04feeda 
I/DEBUG   (  661): afd11ed0 91035180 460aa901 96012006 f7fc9602 
I/DEBUG   (  661): afd11ee0 a905ea60 20024632 ea6af7fc eda8f7fb 
I/DEBUG   (  661): 
I/DEBUG   (  661): code around lr:
I/DEBUG   (  661): deadba8c ffffffff ffffffff ffffffff ffffffff 
I/DEBUG   (  661): deadba9c ffffffff ffffffff ffffffff ffffffff 
I/DEBUG   (  661): deadbaac ffffffff ffffffff ffffffff ffffffff 
I/DEBUG   (  661): deadbabc ffffffff ffffffff ffffffff ffffffff 
I/DEBUG   (  661): deadbacc ffffffff ffffffff ffffffff ffffffff 
I/DEBUG   (  661): 
I/DEBUG   (  661): stack:
I/DEBUG   (  661):     556f98e0  0000022f  
I/DEBUG   (  661):     556f98e4  afd148a9  /system/lib/libc.so
I/DEBUG   (  661):     556f98e8  afd425a0  /system/lib/libc.so
I/DEBUG   (  661):     556f98ec  afd4254c  /system/lib/libc.so
I/DEBUG   (  661):     556f98f0  00000000  
I/DEBUG   (  661):     556f98f4  afd158c3  /system/lib/libc.so
I/DEBUG   (  661):     556f98f8  afd14879  /system/lib/libc.so
I/DEBUG   (  661):     556f98fc  afd14879  /system/lib/libc.so
I/DEBUG   (  661):     556f9900  00000070  
I/DEBUG   (  661):     556f9904  afd42328  /system/lib/libc.so
I/DEBUG   (  661):     556f9908  00000000  
I/DEBUG   (  661):     556f990c  556f9934  
I/DEBUG   (  661):     556f9910  0000a000  [heap]
I/DEBUG   (  661):     556f9914  ad14b1b  /system/lib/libc.so
I/DEBUG   (  661):     556f9918  df002777  
I/DEBUG   (  661):     556f991c  e3a070ad  
I/DEBUG   (  661): #00 556f9920  afd438dc  /system/lib/libc.so
I/DEBUG   (  661):     556f9924  afd105a8  /system/lib/libc.so
I/DEBUG   (  661):     556f9928  afd42328  /system/lib/libc.so
I/DEBUG   (  661):     556f992c  00000004  
I/DEBUG   (  661):     556f9930  0029b1f8  [heap]
I/DEBUG   (  661):     556f9934  fffffbdf  
I/DEBUG   (  661):     556f9938  afd42328  /system/lib/libc.so
I/DEBUG   (  661):     556f993c  afd43724  /system/lib/libc.so
I/DEBUG   (  661):     556f9940  0029b1f8  [heap]
I/DEBUG   (  661):     556f9944  afd0bdf7  /system/lib/libc.so
I/DEBUG   (  661): #01 556f9948  80e820dc  /system/lib/libhi_mpi.so
I/DEBUG   (  661):     556f994c  15aed43f  
I/DEBUG   (  661):     556f9950  000013fc  
I/DEBUG   (  661):     556f9954  80e53bdb  /system/lib/libhi_mpi.so
I/DEBUG   (  661):     556f9958  80e87db4  
I/DEBUG   (  661):     556f995c  0029b1f8  [heap]
I/DEBUG   (  661):     556f9960  00000004  
I/DEBUG   (  661):     556f9964  80e87aa8  
I/DEBUG   (  661):     556f9968  80e87e68  
I/DEBUG   (  661):     556f996c  afd0cd55  /system/lib/libc.so
E/        (  672): stop swarp_rec ok
I/NetConfigProcessor( 1093): ====get===defaultnetmode==static
D/ParameterManager( 1093): ===get=== defaultnetmode==static
D/NetLinkService( 1093): ....handleMessage...netmode=static
D/Zygote  (  662): Process 985 terminated by signal (11)
I/Zygote  (  662): Exit zygote because system server (985) has terminateinit: untracked pid 1041 exited
d

PC寄存器是地址的指针,函数的调用通过这个完成,可以通过PC的值来确定调用的函数名字。红色部分是出错的库:
I/DEBUG   (  661):          #03  pc 00020a02  /system/lib/libhi_mpi.so
I/DEBUG   (  661):          #04  pc 0001e4a6  /system/lib/libhi_mpi.so
I/DEBUG   (  661):          #05  pc 000439ba  /system/lib/libhi_mpi.so
 我们将这个库拿出来借助addr2line工具可以看到出错的地方:
root@wang:/ubuntu/android-hi3716# 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:
  @                Read options from
  -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
  -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
root@wang:/ubuntu/android-hi3716# arm-eabi-addr2line -f -e /mnt/hgfs/Desktop/libhi_mpi.so 00020a02 0001e4a6 000439ba
SolaResamplerFree
??:0
HI_MPI_HIAO_Close
??:0
HI_UNF_SND_Close
??:0

<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
阅读(3069) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
评论热议
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值