一扮宠。項(xiàng)目中接入breakpad
二蚯妇。拿到崩潰的dmp文件
三对人。下載breakpad源碼https://github.com/google/breakpad
滞详,在Linux環(huán)境下編譯凛俱。
編譯時(shí),我這里遇到錯(cuò)誤料饥,缺少 src/third_party/lss/linux_syscall_support.h
去github上搜索下載這個(gè)文件(原Google的git連接已經(jīng)失效)蒲犬,https://github.com/webrtcmirrors/vendor_linux-syscall-support,我用的是這個(gè)岸啡。注意很多是針對MIPS的原叮,并不適用。
四凰狞。使用編譯出的工具分析dmp
./src/processor/minidump_stackwalk 2/0702_1427.dmp > 1.txt
五篇裁。打開1.txt
Operating system: Android
0.0.0 Linux 3.18.31-perf-g4925c2f-dirty #1 SMP PREEMPT Fri Jun 8 10:21:45 CST 2018 armv8l
CPU: arm
ARMv1 ARM part(0x4100d030) features: half,thumb,fastmult,vfpv2,edsp,neon,vfpv3,tls,vfpv4,idiva,idivt
8 CPUs
GPU: UNKNOWN
Crash reason: SIGSEGV /0x00000000
Crash address: 0xc
Process uptime: not available
Thread 66 (crashed)
0 libmupdf_java32.so + 0x4b80c
r0 = 0xf34f4984 r1 = 0xca7980a6 r2 = 0x00000000 r3 = 0x6431cd2e
r4 = 0xd3b91dd4 r5 = 0xcd84b8cc r6 = 0xcd84b9c0 r7 = 0xcd84b8a8
r8 = 0xd61a5830 r9 = 0x00000000 r10 = 0xd611138c r12 = 0xf34fbb88
fp = 0xcd84b94c sp = 0xcd84b800 lr = 0xf31613cd pc = 0xca63c80c
Found by: given as instruction pointer in context
1 dalvik-LinearAlloc (deleted) + 0xcb6e
....很長
找到Crash reason
0 libmupdf_java32.so + 0x4b80c 崩潰時(shí)的寄存器地址
六。使用ndk自帶的工具分析出崩潰的方法名
E:\ndk-r14b\toolchains\arm-linux-androi
deabi-4.9\prebuilt\windows-x86_64\bin\arm-linux-androideabi-addr2line.exe -f -C -e D:\ubuntu_share\breakpad\libmupdf_jav
a32.so 0x4b80c
得到崩潰時(shí)的方法為
Java_com_xxx_pdflib_mupdf_MuPDFCore_text