使用ndk-stack读取崩溃日志

时间:2013-07-08 09:08:59

标签: android android-ndk stack-trace cocos2d-x

我正在使用 cocos2d-x v2.1.4 ,我有来自logcat的崩溃日志:

I/DEBUG   ( 6575): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   ( 6575): Build fingerprint: 'acer/a500_ww_gen1/picasso:4.0.3/IML74K/1333032611:user/release-keys'
I/DEBUG   ( 6575): pid: 6680, tid: 6680  >>> com.xxxxx.xxxxx <<<
I/DEBUG   ( 6575): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 5bd10d1f
I/DEBUG   ( 6575):  r0 0000006e  r1 5ceda8ec  r2 00000000  r3 5bd10d1f
I/DEBUG   ( 6575):  r4 00000000  r5 5bb4dfc1  r6 5bd13c38  r7 5ceda8ec
I/DEBUG   ( 6575):  r8 00007530  r9 00000000  10 00000000  fp 5bd13c38
I/DEBUG   ( 6575):  ip 5bd76e4c  sp 5ced9948  lr 5bb4e179  pc 5bb4dfce  cpsr 00000030
I/DEBUG   ( 6575):  d0  0000000000000000  d1  0000000000000000
I/DEBUG   ( 6575):  d2  0000000000000000  d3  000000003f000000
I/DEBUG   ( 6575):  d4  0000000000000000  d5  0000000000000000
I/DEBUG   ( 6575):  d6  0000000000000000  d7  0000000000000000
I/DEBUG   ( 6575):  d8  0000000000000000  d9  0000000000000000
I/DEBUG   ( 6575):  d10 0000000000000000  d11 0000000000000000
I/DEBUG   ( 6575):  d12 0000000000000000  d13 0000000000000000
I/DEBUG   ( 6575):  d14 0000000000000000  d15 0000000000000000
I/DEBUG   ( 6575):  scr 80000012
I/DEBUG   ( 6575): 
I/DEBUG   ( 6575):          #00  pc 0032ffce  /data/data/com.xxxxx.xxxxx/lib/libgame.so
I/DEBUG   ( 6575):          #01  pc 00330176  /data/data/com.xxxxx.xxxxx/lib/libgame.so
I/DEBUG   ( 6575):          #02  pc 00330f68  /data/data/com.xxxxx.xxxxx/lib/libgame.so (curl_mvsnprintf)
I/DEBUG   ( 6575):          #03  pc 00323e2c  /data/data/com.xxxxx.xxxxx/lib/libgame.so (Curl_failf)
I/DEBUG   ( 6575):          #04  pc 0031d39e  /data/data/com.xxxxx.xxxxx/lib/libgame.so (Curl_resolv_timeout)
I/DEBUG   ( 6575):          #05  pc 00329ea2  /data/data/com.xxxxx.xxxxx/lib/libgame.so (Curl_connect)

我可以从这个日志中看出它是由cURL方法没有正确完成或其他东西引起的,但我想知道哪个函数导致崩溃。我尝试使用ndk-stack,但我得到了这个结果:

********** Crash dump: **********
Build fingerprint: 'acer/a500_ww_gen1/picasso:4.0.3/IML74K/1333032611:user/release-keys'
pid: 6498, tid: 6498  >>> com.xxxxx.xxxxx <<<
signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 5bb71d1f
Stack frame #00  pc 0032ffce  /data/data/com.xxxxx.xxxxx/lib/libgame.so: Unable to locate routine information for address 32ffce in module /Users/xxxxx/Desktop/xxxxx/_projects/xxxxx/xxxxx/proj.android/obj/local/armeabi/libgame.so
Stack frame #01  pc 00330176  /data/data/com.xxxxx.xxxxx/lib/libgame.so: Unable to locate routine information for address 330176 in module /Users/xxxxx/Desktop/xxxxx/_projects/xxxxx/xxxxx/proj.android/obj/local/armeabi/libgame.so
Stack frame #02  pc 00330f68  /data/data/com.xxxxx.xxxxx/lib/libgame.so (curl_mvsnprintf): Unable to locate routine information for address 330f68 in module /Users/xxxxx/Desktop/xxxxx/_projects/xxxxx/xxxxx/proj.android/obj/local/armeabi/libgame.so
Stack frame #03  pc 00323e2c  /data/data/com.xxxxx.xxxxx/lib/libgame.so (Curl_failf): Unable to locate routine information for address 323e2c in module /Users/xxxxx/Desktop/xxxxx/_projects/xxxxx/xxxxx/proj.android/obj/local/armeabi/libgame.so
Stack frame #04  pc 0031d39e  /data/data/com.xxxxx.xxxxx/lib/libgame.so (Curl_resolv_timeout): Unable to locate routine information for address 31d39e in module /Users/xxxxx/Desktop/xxxxx/_projects/xxxxx/xxxxx/proj.android/obj/local/armeabi/libgame.so
Stack frame #05  pc 00329ea2  /data/data/com.xxxxx.xxxxx/lib/libgame.so (Curl_connect): Unable to locate routine information for address 329ea2 in module /Users/xxxxx/Desktop/xxxxx/_projects/xxxxx/xxxxx/proj.android/obj/local/armeabi/libgame.so

有没有办法从堆栈跟踪中获取更有意义的信息? 或者是因为我使用libcurl编译为静态库,而ndk-stack无法找到有关它的信息?

1 个答案:

答案 0 :(得分:0)

你可以使用VisualGDB,使用VisualGDB你可以在visual studio中调试你的本机代码, 你必须在visual studio中安装VisualGDB插件,然后你可以将你现有的cocos2d-x Android Eclipse项目导入visual studio。您可以查看以下链接

http://visualgdb.com/tutorials/android/

我已经在VisualGDB的帮助下将我的cocos2d android项目配置到visual studio,如果您遇到任何问题,请告诉我。