Time for action – analysing a crash dump

  1. Let's introduce a fatal bug in the code. Open jni/DroidBlaster.cpp and modify method onActivate() as follows:
    ...
        void DroidBlaster::onActivate() {
            ...
            mTimeService = NULL;
            return packt::STATUS_KO;
        }
    ...
  2. Open the LogCat view (from Window | Show View | Other...) in Eclipse and then run the application. Not pretty for a candid Android developer! A crash dump appeared in the logs:
    ... *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** Build fingerprint: 'htc_wwe/htc_bravo/bravo:2.3.3/... pid: 1723, tid: 1743 >>> com.packtpub.droidblaster <<< signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0000000c r0 a9df2e71 r1 40815c8d r2 7cb9c28d r3 00000000 ... ip a3400000 sp 45102830 lr 00000016 pc 80410a2c ...

Get Android NDK Beginner's Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.