Android-ndk - addr2line定位线

时间:2011-10-10 14:38:03

标签: android windows cygwin android-ndk native

我正在使用addr2line来调试我的本机代码中的崩溃。 我可以使用addr2line找到它在PC计数器中崩溃的方法(00059910),但是我想找出它崩溃的方法中的哪一行。你如何使用addr2line做到这一点? (我已尝试过ndk-gdb及其在Windows上的噩梦,所以希望你能用addr2line提取它)

10-10 15:39:49.583: INFO/DEBUG(2899): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-10 15:39:49.583: INFO/DEBUG(2899): Build fingerprint: 'htc_europe/htc_saga/saga:2.3.3/GRI40/78999:user/release-keys'
10-10 15:39:49.583: INFO/DEBUG(2899): pid: 25002, tid: 25015  >>> doubango <<<
10-10 15:39:49.583: INFO/DEBUG(2899): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
10-10 15:39:49.583: INFO/DEBUG(2899):  r0 00000000  r1 4709cb54  r2 fffffcee  r3 afd4140c
10-10 15:39:49.583: INFO/DEBUG(2899):  r4 ffffff84  r5 00000000  r6 805ce04c  r7 4709ce94
10-10 15:39:49.583: INFO/DEBUG(2899):  r8 003f24a0  r9 003f17a8  10 003f17b8  fp ffff485b
10-10 15:39:49.583: INFO/DEBUG(2899):  ip 805da0d0  sp 4709cb28  lr afd212bd  pc afd212d4  cpsr 60000030
10-10 15:39:49.583: INFO/DEBUG(2899):  d0  0000000000000000  d1  0000000000000000
10-10 15:39:49.583: INFO/DEBUG(2899):  d2  0000000000000000  d3  0000000000000000
10-10 15:39:49.583: INFO/DEBUG(2899):  d4  0000000000000000  d5  0000000000000000
10-10 15:39:49.583: INFO/DEBUG(2899):  d6  0000000000000000  d7  0000000000000000
10-10 15:39:49.583: INFO/DEBUG(2899):  d8  4680000043e50000  d9  0000000042440000
10-10 15:39:49.583: INFO/DEBUG(2899):  d10 0000000000000000  d11 0000000000000000
10-10 15:39:49.583: INFO/DEBUG(2899):  d12 0000000000000000  d13 0000000000000000
10-10 15:39:49.583: INFO/DEBUG(2899):  d14 0000000000000000  d15 0000000000000000
10-10 15:39:49.583: INFO/DEBUG(2899):  d16 c075a00000000000  d17 c075a00000000000
10-10 15:39:49.583: INFO/DEBUG(2899):  d18 4035000000000000  d19 0000000000000000
10-10 15:39:49.583: INFO/DEBUG(2899):  d20 3ff0000000000000  d21 8000000000000000
10-10 15:39:49.583: INFO/DEBUG(2899):  d22 c035000000000000  d23 0000000000000000
10-10 15:39:49.583: INFO/DEBUG(2899):  d24 0707070707070707  d25 0808080808080808
10-10 15:39:49.583: INFO/DEBUG(2899):  d26 0808080808080808  d27 ffffffffffffffff
10-10 15:39:49.583: INFO/DEBUG(2899):  d28 00ff00ff00ff00ff  d29 3ff0000000000000
10-10 15:39:49.583: INFO/DEBUG(2899):  d30 0000000000000000  d31 3ff0000000000000
10-10 15:39:49.583: INFO/DEBUG(2899):  scr 60000012
10-10 15:39:49.633: INFO/DEBUG(2899):          #00  pc 000212d4  /system/lib/libc.so
10-10 15:39:49.633: INFO/DEBUG(2899):          #01  pc 000212b8  /system/lib/libc.so
10-10 15:39:49.633: INFO/DEBUG(2899):          #02  pc 00059910  /data/data/doubango/lib/libdoubango.so
10-10 15:39:49.633: INFO/DEBUG(2899):          #03  pc 00011a1c  /system/lib/libc.so
10-10 15:39:49.633: INFO/DEBUG(2899):          #04  pc 000115e0  /system/lib/libc.so
10-10 15:39:49.633: INFO/DEBUG(2899): code around pc:
10-10 15:39:49.633: INFO/DEBUG(2899): afd212b4 a901b507 f806f000 3801b908 9801e000 
10-10 15:39:49.633: INFO/DEBUG(2899): afd212c4 bf00bd0e 41ffe92d 4c524b51 447b2500 
10-10 15:39:49.633: INFO/DEBUG(2899): afd212d4 46e87802 681f591b 0c30f1a2 0f09f1bc 
10-10 15:39:49.633: INFO/DEBUG(2899): afd212e4 8091f200 d0012a30 e00f240a 2f01f810 
10-10 15:39:49.633: INFO/DEBUG(2899): afd212f4 bf142a78 24012400 bf082a58 0401f044 
10-10 15:39:49.633: INFO/DEBUG(2899): code around lr:
10-10 15:39:49.633: INFO/DEBUG(2899): afd2129c bf008ff0 0002023a ffffff14 000261fe 
10-10 15:39:49.633: INFO/DEBUG(2899): afd212ac 000261da 000261d6 a901b507 f806f000 
10-10 15:39:49.633: INFO/DEBUG(2899): afd212bc 3801b908 9801e000 bf00bd0e 41ffe92d 
10-10 15:39:49.633: INFO/DEBUG(2899): afd212cc 4c524b51 447b2500 46e87802 681f591b 
10-10 15:39:49.633: INFO/DEBUG(2899): afd212dc 0c30f1a2 0f09f1bc 8091f200 d0012a30 
10-10 15:39:49.633: INFO/DEBUG(2899): stack:
10-10 15:39:49.633: INFO/DEBUG(2899):     4709cae8  003f24a0  
10-10 15:39:49.633: INFO/DEBUG(2899):     4709caec  003f17a8  
10-10 15:39:49.633: INFO/DEBUG(2899):     4709caf0  003f17b8  
10-10 15:39:49.633: INFO/DEBUG(2899):     4709caf4  afd13ff7  /system/lib/libc.so
10-10 15:39:49.633: INFO/DEBUG(2899):     4709caf8  0040a1a8  
10-10 15:39:49.633: INFO/DEBUG(2899):     4709cafc  805d9f40  
10-10 15:39:49.643: INFO/DEBUG(2899):     4709cb00  003e5ed8  
10-10 15:39:49.643: INFO/DEBUG(2899):     4709cb04  805d8c80  
10-10 15:39:49.643: INFO/DEBUG(2899):     4709cb08  00000000  
10-10 15:39:49.643: INFO/DEBUG(2899):     4709cb0c  003f24a0  
10-10 15:39:49.643: INFO/DEBUG(2899):     4709cb10  003f17a8  
10-10 15:39:49.643: INFO/DEBUG(2899):     4709cb14  003f17b8  
10-10 15:39:49.643: INFO/DEBUG(2899):     4709cb18  ffff485b  
10-10 15:39:49.643: INFO/DEBUG(2899):     4709cb1c  80566014  /data/data/doubango/lib/libdoubango.so
10-10 15:39:49.643: INFO/DEBUG(2899):     4709cb20  df002777  
10-10 15:39:49.643: INFO/DEBUG(2899):     4709cb24  e3a070ad  
10-10 15:39:49.643: INFO/DEBUG(2899): #00 4709cb28  00000000  
10-10 15:39:49.643: INFO/DEBUG(2899):     4709cb2c  4709cb54  
10-10 15:39:49.643: INFO/DEBUG(2899):     4709cb30  fffffcee  
10-10 15:39:49.643: INFO/DEBUG(2899):     4709cb34  0000d500  
10-10 15:39:49.643: INFO/DEBUG(2899):     4709cb38  805d9f40  
10-10 15:39:49.643: INFO/DEBUG(2899):     4709cb3c  003e5ed8  
10-10 15:39:49.643: INFO/DEBUG(2899):     4709cb40  805ce04c  /data/data/doubango/lib/libdoubango.so
10-10 15:39:49.643: INFO/DEBUG(2899):     4709cb44  4709ce94  
10-10 15:39:49.643: INFO/DEBUG(2899):     4709cb48  003f24a0  
10-10 15:39:49.643: INFO/DEBUG(2899):     4709cb4c  afd212bd  /system/lib/libc.so
10-10 15:39:49.643: INFO/DEBUG(2899): #01 4709cb50  00000000  
10-10 15:39:49.643: INFO/DEBUG(2899):     4709cb54  4709cec8  
10-10 15:39:49.643: INFO/DEBUG(2899):     4709cb58  fffffcee  
10-10 15:39:49.643: INFO/DEBUG(2899):     4709cb5c  80559914  /data/data/doubango/lib/libdoubango.so

1 个答案:

答案 0 :(得分:2)

addr2line应该为您提供程序崩溃所在的源文件和行号。

按照此处的说明操作:How to use addr2line in Android