Unity Android Bugly 报错地址查询

借助Android NDK arm-linux-androideabi-addr2line.exe 对报错的地址转换成对应代码行。

一、报错信息,例如来自Firebase 报错如下:

Fatal Exception: Tombstone: Version '2020.3.33f1 (915a7af8b0d5)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'armeabi-v7a'
Build fingerprint: 'samsung/tbltexx/tblte:6.0.1/MMB29M/N915FXXU1DPF1:user/release-keys'
Revision: '12'
ABI: 'arm'
Timestamp: 2023-08-29 18:21:14+0300
pid: 28833, tid: 29083, name: Thread-9814  >>> com.au.dance.tur <<<
uid: 10205
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Cause: null pointer dereference
    r0  85f58a00  r1  001fffe9  r2  00000001  r3  001fffdc
    r4  00000000  r5  00000000  r6  00000010  r7  00020000
    r8  00020000  r9  b6cf7ec0  r10 00020010  r11 00001d10
    ip  000000ff  sp  7c83f188  lr  979c86a9  pc  9807e81a


#00 pc 0x95f81a libunity.so (libunity.0x95f81a)
#01 pc 0x2a96a5 libunity.so (libunity.0x2a96a5)
#02 pc 0x2a5d0f libunity.so (libunity.0x2a5d0f)
#03 pc 0x2a5c25 libunity.so (libunity.0x2a5c25)
#04 pc 0x39f5a1 libunity.so (libunity.0x39f5a1)
#05 pc 0xbe0fd libunity.so (libunity.0xbe0fd)
#06 pc 0x3a66f7 libunity.so (libunity.0x3a66f7)
#07 pc 0x3a642d libunity.so (libunity.0x3a642d)
#08 pc 0x182b69 libunity.so (libunity.0x182b69)
#09 pc 0x18269d libunity.so (libunity.0x18269d)
#10 pc 0x17d6dd libunity.so (libunity.0x17d6dd)
#11 pc 0x17d753 libunity.so (libunity.0x17d753)
#12 pc 0x339229 libunity.so (libunity.0x339229)
#13 pc 0x339413 libunity.so (libunity.0x339413)
#14 pc 0x339491 libunity.so (libunity.0x339491)
#15 pc 0x3395b1 libunity.so (libunity.0x3395b1)
#16 pc 0x338df9 libunity.so (libunity.0x338df9)
#17 pc 0x3add13 libunity.so (libunity.0x3add13)
#18 pc 0x3f4ff libc.so (__pthread_start(void*) + 30) (BuildId: aeb9141a53ca6209bb94453da0a587c8)
#19 pc 0x19c97 libc.so (__start_thread + 6) (BuildId: aeb9141a53ca6209bb94453da0a587c8)

注意关键信息:Backend 'il2cpp' 、CPU 'armeabi-v7a'、与 libunity.so,那我们去找ill2cpp目录下armeabi-v7a目录下libunity.sym.so,注意这里符号表比多了一个sym命名。具体路径在unity安装目录下,参考如下:

xxx\Editor\Data\PlaybackEngines\AndroidPlayer\Variations\il2cpp\Release\Symbols\armeabi-v7a\

二、找到NDK中arm-linux-androideabi-addr2line.exe目录

  • xxx\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\bin\

三、执行命令

  • arm-linux-androideabi-addr2line.exe -f -C -e so的地址 报错内存地址
  • 如上报错示例参考
    arm-linux-androideabi-addr2line.exe -f -C -e libunity.sym.so r0 85f58a00 r1 001fffe9 r2 00000001 r3 001fffdc r4 00000000 r5 00000000 r6 00000010 r7 00020000 r8 00020000 r9 b6cf7ec0 r10 00020010 r11 00001d10 ip 000000ff sp 7c83f188 lr 979c86a9 pc 9807e81a

你可能感兴趣的:(unity,unity,android,游戏引擎)