Skip to Main Content
Android NDK Beginner`s Guide - Second Edition
book

Android NDK Beginner`s Guide - Second Edition

by Sylvain Ratabouil
April 2015
Beginner to intermediate content levelBeginner to intermediate
494 pages
10h 26m
English
Packt Publishing
Content preview from Android NDK Beginner`s Guide - Second Edition

Time for action – analyzing a native crash dump

Let's make our application crash to see how to read a crash dump:

  1. Simulate a fatal bug in jni/com_packtpub_store_Store.cpp:
    #include "com_packtpub_store_Store.h"
    
    JNIEXPORT jint JNICALL Java_com_packtpub_store_Store_getCount
      (JNIEnv* pEnv, jobject pObject) {
        pEnv = 0;
        return pEnv->CallIntMethod(0, 0);
    }
  2. Open the LogCat view in Eclipse, select the All Messages (no filter) option, and then run the application. A crash dump appears in the logs. This is not pretty! If you look carefully through it, you should find a backtrace section with a snapshot of the call-stack at the moment the application crashed. However, it does not give the line of code involved:
  3. From a command-line prompt, go to the project ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Pro Android C++ with the NDK

Pro Android C++ with the NDK

Onur Cinar
Learning Embedded Android N Programming

Learning Embedded Android N Programming

Ivan Morgillo, Stefano Viola

Publisher Resources

ISBN: 9781783989645Supplemental Content