Cocos2d-x NDK 调试, trace很无辜的样子


崩溃后的dump如下, 调用的堆直接是从Cocos2d-x的mainLoop开始的.
像这种bug怎么追踪.

   
  ********** Crash dump: **********
  
Build fingerprint: 'Samsung/SGH-T959/SGH-T959/SGH-T959:2.2/FROYO/UVKB5:user/release-keys'
pid: 11909, tid: 11952, name: Thread-1355 >>> org.cocos2dx.application <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad
Stack frame #00 pc 00018086 /system/lib/libc.so
Stack frame #01 pc 0000dc04 /system/lib/libc.so (abort+4)
Stack frame #02 pc 0001ee27 /system/lib/libc.so (__assert2+30)
Stack frame #03 pc 00122099 /datadata/org.cocos2dx.application/lib/libhelloworld.so (cocos2d::CCSprite::draw()+44): Routine draw in jni/../../../cocos2dx/sprite_nodes/CCSprite.cpp:654
Stack frame #04 pc 000e8bf7 /datadata/org.cocos2dx.application/lib/libhelloworld.so (cocos2d::CCNode::visit()+218): Routine visit in jni/../../../cocos2dx/base_nodes/CCNode.cpp:815
Stack frame #05 pc 000e8c43 /datadata/org.cocos2dx.application/lib/libhelloworld.so (cocos2d::CCNode::visit()+294): Routine visit in jni/../../../cocos2dx/base_nodes/CCNode.cpp:826
Stack frame #06 pc 000e8c43 /datadata/org.cocos2dx.application/lib/libhelloworld.so (cocos2d::CCNode::visit()+294): Routine visit in jni/../../../cocos2dx/base_nodes/CCNode.cpp:826
Stack frame #07 pc 000e8c43 /datadata/org.cocos2dx.application/lib/libhelloworld.so (cocos2d::CCNode::visit()+294): Routine visit in jni/../../../cocos2dx/base_nodes/CCNode.cpp:826
Stack frame #08 pc 000efcb3 /datadata/org.cocos2dx.application/lib/libhelloworld.so (cocos2d::CCDirector::drawScene()+142): Routine drawScene in jni/../../../cocos2dx/CCDirector.cpp:206
Stack frame #09 pc 000f0f57 /datadata/org.cocos2dx.application/lib/libhelloworld.so (cocos2d::CCDisplayLinkDirector::mainLoop()+50): Routine mainLoop in jni/../../../cocos2dx/CCDirector.cpp:935
Stack frame #10 pc 0011da89 /datadata/org.cocos2dx.application/lib/libhelloworld.so (Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeRender+20): Routine Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeRender in jni/../../../cocos2dx/platform/android/jni/MessageJni.cpp:51
Stack frame #11 pc 0001e0b0 /system/lib/libdvm.so (dvmPlatformInvoke+112)
Stack frame #12 pc 0004d0cf /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+390)
Stack frame #13 pc 000274e0 /system/lib/libdvm.so
Stack frame #14 pc 0002bdc4 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+180)
Stack frame #15 pc 0005f831 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+272)
Stack frame #16 pc 0005f85b /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
Stack frame #17 pc 000543e7 /system/lib/libdvm.so
Stack frame #18 pc 00012c24 /system/lib/libc.so (__thread_entry+48)
Stack frame #19 pc 0001238c /system/lib/libc.so (pthread_create+180)

cocos2d-x C++

初音·立花奏 10 years, 10 months ago

Android的调试比较麻烦,三个方案:
1: gdb远程调试,google之
2:adt20,支持native调试
3:arm的DS-5

Courier answered 10 years, 10 months ago

Your Answer