NDK CRUSH DUMP

~/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-objdump -S ./obj/local/armeabi/libdroidblaster.so >~/disassember.dump

addr2line 可根据地址(PC)找到方法名

$ANDROID_NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-addr2line -f –C -e ./obj/local/armeabi/libdroidblaster.so 00010a2c

最好的方法:adb logcat | ndk-stack -sym ./obj/local/armeabi

例如:

********** Crash dump: **********
Build fingerprint: 'Huawei/U9508/hwu9508:4.0.4/HuaweiU9508/CHNC00B028:user/ota-rel-keys,release-keys'
pid: 22333, tid: 22346  >>> com.packtpub.droidblaster <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000008
Stack frame #00  pc 00014954  /data/data/com.packtpub.droidblaster/lib/libdroidblaster.so (_ZN5packt11TimeService6updateEv): Routine update in jni/TimeService.cpp:21
Stack frame #01  pc 0000a9b8  /data/data/com.packtpub.droidblaster/lib/libdroidblaster.so (_ZN3dbs12DroidBlaster6onStepEv): Routine onStep in jni/DroidBlaster.cpp:50
Stack frame #02  pc 0000aed8  /data/data/com.packtpub.droidblaster/lib/libdroidblaster.so (_ZN5packt9EventLoop3runEPNS_15ActivityHandlerEPNS_12InputHandlerE): Routine run in jni/EventLoop.cpp:45
Stack frame #03  pc 000133e8  /data/data/com.packtpub.droidblaster/lib/libdroidblaster.so (android_main): Routine android_main in jni/Main.cpp:15
Stack frame #04  pc 00015540  /data/data/com.packtpub.droidblaster/lib/libdroidblaster.so: Routine android_app_entry in /home/anjun/android/ndk/sources/android/native_app_glue/android_native_app_glue.c:234
Stack frame #05  pc 00012d7c  /system/lib/libc.so (__thread_entry): Unable to open symbol file ./obj/local/armeabi/libc.so. Error (9): Bad file descriptor
Stack frame #06  pc 000128d0  /system/lib/libc.so (pthread_create): Unable to open symbol file ./obj/local/armeabi/libc.so. Error (9): Bad file descriptor

++++++++++++++++++++++++++++++

rX: This is an integer register.
‰‰ dX: This is a floating point register.
‰‰ fp (or r11): The Frame Pointer holds a fixed location on the stack during
a routine call (in conjunction with the Stack Pointer).
‰‰
ip (or r12): The intra procedure call scratch register may be used with
some subroutine calls, for example, when the linker needs a veneer (a small
piece of code) to aim at a different memory area when branching (a branch
instruction to jump somewhere else in the memory requires an offset
argument relative to current location, allowing a branching range of a few
MB only, not the full memory).
sp (or r13): This is the stack pointer, which saves location of the top of
the stack.
lr (or r14): The link register generally saves program counter's value
temporarily to restore it later. A typical example of its use is a function
call which jumps somewhere in the code and then go back to its previous
location. Of course, several chained subroutine calls requires the link
register to be stacked.
‰‰
pc (or r15): This represents the program counter which holds the address
of next instruction to execute. Program counter is just incremented when
executing a sequential code to fetch next instruction but is altered by
branching instructions (if/else, a C/C++ function calls, and so on).
cpsr: The Current Program Status Register contains a few flags about the
current processor working mode and some additional bit flags for condition
codes (such as N for an operation which resulted in a negative value, Z for a 0
or equality result, and so on), interrupts, and instruction set (Thumb or ARM).

Crash dump also contains a few memory words around PC (that is, the block of
instructions around) and LR (for previous location).

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值