3

在使用共享库时,我在 Android 中获得了以下堆栈跟踪。当我尝试使用 ndk-stack 时,它给出错误提示“无法在模块 /ibgame.so 中找到地址 80ce4188 的例程信息”我真的想找到例程崩溃的行。

堆栈跟踪

03-18 12:07:00.480: I/DEBUG(21702): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-18 12:07:00.490: I/DEBUG(21702): Build fingerprint: 'samsung/GT-S5670/GT-S5670:2.3.4/GINGERBREAD/XWKQ2:user/release-keys'
03-18 12:07:00.490: I/DEBUG(21702): pid: 22914, tid: 22957  >>> com.xxx.yyyyo <<<
03-18 12:07:00.490: I/DEBUG(21702): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 3c3c3c3c
03-18 12:07:00.490: I/DEBUG(21702):  r0 00000001  r1 46e9f96c  r2 002624e8  r3 3c3c3c3c
03-18 12:07:00.490: I/DEBUG(21702):  r4 80fa1474  r5 0026c6a8  r6 46cce7ed  r7 46030f30
03-18 12:07:00.490: I/DEBUG(21702):  r8 46e9fb70  r9 46030f28  10 46030f14  fp 45110b30
03-18 12:07:00.490: I/DEBUG(21702):  ip 80fa14e8  sp 46e9fa00  lr 80d20eb3  pc 80ce4188  cpsr 00000030
03-18 12:07:00.490: I/DEBUG(21702):  d0  000000003f800000  d1  0000000000000000
03-18 12:07:00.490: I/DEBUG(21702):  d2  416fca053f800000  d3  418c000000000000
03-18 12:07:00.490: I/DEBUG(21702):  d4  0023000000000000  d5  46fffe00c7000000
03-18 12:07:00.490: I/DEBUG(21702):  d6  3f000000c7000000  d7  46fffe003f800000
03-18 12:07:00.500: I/DEBUG(21702):  d8  0000000000000000  d9  0000000000000000
03-18 12:07:00.500: I/DEBUG(21702):  d10 0000000000000000  d11 0000000000000000
03-18 12:07:00.500: I/DEBUG(21702):  d12 0000000000000000  d13 0000000000000000
03-18 12:07:00.500: I/DEBUG(21702):  d14 0000000000000000  d15 0000000000000000
03-18 12:07:00.500: I/DEBUG(21702):  scr 60000012
03-18 12:07:00.910: I/ActivityManager(10055): Start proc android.process.media for content provider com.android.providers.downloads/.DownloadProvider: pid=23002 uid=10024 gids={1015, 2001, 3003}
03-18 12:07:01.220: D/Finsky(22861): [1] 2.run: Loaded library for account: [LhT0qWhfRR1R8V6hKkpCiWF5Pjw]
03-18 12:07:01.320: I/DEBUG(21702):          #00  pc 80ce4188  /mnt/asec/com.xxx.yyyyo-1/lib/libgame.so
03-18 12:07:01.320: I/DEBUG(21702):          #01  lr 80d20eb3  /mnt/asec/com.xxx.yyyyo-1/lib/libgame.so
03-18 12:07:01.320: I/DEBUG(21702): code around pc:
03-18 12:07:01.320: I/DEBUG(21702): 80ce4168 f864f7ff 1c221c2b ab29e056 f7ff1c18 
03-18 12:07:01.320: I/DEBUG(21702): 80ce4178 2c00f85d e015d05b 23a09a05 58d3005b 
03-18 12:07:01.320: I/DEBUG(21702): 80ce4188 3351681b 681a33ff 23a09905 58c9005b 
03-18 12:07:01.320: I/DEBUG(21702): 80ce4198 98059b33 009b3350 330418c3 1c08681b 
03-18 12:07:01.320: I/DEBUG(21702): 80ce41a8 47901c19 23ae9a05 58d3005b 33529a05 
03-18 12:07:01.320: I/DEBUG(21702): code around lr:
03-18 12:07:01.320: I/DEBUG(21702): 80d20e90 f7cf1c18 1c03fb7b 320c681a 99016812 
03-18 12:07:01.320: I/DEBUG(21702): 80d20ea0 47901c18 f048e022 1c03fee3 f7cf1c18 
03-18 12:07:01.320: I/DEBUG(21702): 80d20eb0 1c03fb6d 9b039303 d00b2b00 681b9b03 
03-18 12:07:01.320: I/DEBUG(21702): 80d20ec0 681b3308 1c109a03 1c034798 d1012b02 
03-18 12:07:01.320: I/DEBUG(21702): 80d20ed0 e0002301 2b002300 9b03d008 330c681b 
03-18 12:07:01.320: I/DEBUG(21702): stack:
03-18 12:07:01.320: I/DEBUG(21702):     46e9f9c0  47bac008  
03-18 12:07:01.320: I/DEBUG(21702):     46e9f9c4  01000000  
03-18 12:07:01.320: I/DEBUG(21702):     46e9f9c8  80fa1474  
    03-18 12:07:01.320: I/DEBUG(21702):     46e9f9cc  80fa1474  
03-18 12:07:01.320: I/DEBUG(21702):     46e9f9d0  0026c6a8  

我的Application.mk文件是

APP_STL := gnustl_static
APP_CPPFLAGS := -frtti -fexceptions -DCOCOS2D_DEBUG=1
APP_OPTIM := debug

Android.mk文件

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := game_shared

LOCAL_MODULE_FILENAME := libgame


LOCAL_SRC_FILES := main.cpp ../../Classes/AppDelegate.cpp \
    ../../Classes/HelloWorldScene.cpp \

LOCAL_CFLAGS := -g
LOCAL_CFLAGS += -ggdb
LOCAL_CFLAGS += -01

LOCAL_LDLIBS +=  -llog -ldl

LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes     \
$(LOCAL_PATH)/../../libs/Box2d \

LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static cocos_extension_static box2d_static

include $(BUILD_SHARED_LIBRARY)

$(call import-module,CocosDenshion/android) \
$(call import-module,cocos2dx) \
$(call import-module,extensions) \
$(call import-module,Box2D)

NDK-STACK命令

D:\>ndk-stack -sym D:\Dev\cocos2d-2.0-x-2.0.4\XXXX\proj.android\obj\local\armeabi -dump "D:\Dev\Others\logs notes\18-3-1-crash.txt"
********** Crash dump: **********
Build fingerprint: 'samsung/GT-S5670/GT-S5670:2.3.4/GINGERBREAD/XWKQ2:user/release-keys'
pid: 22914, tid: 22957  >>> com.xxx.yyyyo<<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 3c3c3c3c
Stack frame #00  pc 80ce4188  /mnt/asec/com.xxx.yyyyo-1/lib/libgame.so: Unable to locate routine information for address 80ce4188 in module D:\Dev\cocos2d-2.0-x-2.0.4\XXXX\proj.android\obj\local\armeabi/libgame.so
4

1 回答 1

0

在您的 Android.mk 中使用以下内容

LOCAL_CFLAGS:= -g

您可以使用以下命令检查 .so 的符号:

nm libgame.so

于 2013-03-18T08:58:13.163 回答