Refer to http://blog.csdn.net/span76/article/details/44225415, write an inevitable crash program
#include <stdio.h>void f () { char *c=0; *c=0;} int main (void) { printf ("Hello World"); f (); return 0;}
After compiling, copy to System/bin below
The ADB shell then logs on to the device to run, and the System Reports segmentation fault (core dumped)
ADB log print the information below
03-31 02:27:19.533 I Debug:backtrace:
03-31 02:27:19.533 I DEBUG: #00 pc 00000514 /SYSTEM/BIN/PNP5
03-31 02:27:19.533 I DEBUG: #01 pc 00017c94/system/lib/libc.so (__libc_init+84)
..
Execute the following command to navigate to the source
prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/i686-linux-android-addr2line -E out/target/ PRODUCT/PRODUCT1/SYMBOLS/SYSTEM/BIN/PNP50x00000514
The results are as follows and the positioning is accurate
/home/payne/zjb/pnp5/jni/main.c:5
Verify that Android Tombstone is working