Search code examples
android-ndkopenssljava-native-interfaceandroid-studio-2.2

Not able to step into native code - Android


I have been trying to debug the native code on Android studio. My debugger runs fine on simple hello world jni code. But when I try to do the same with the code that is linked with shared lib libcrypto.so and libccmssl.so , I am not able to step into the native code.

Now I am not sure if the above observation is any important. But I am not sure where to explore next. While Loading the library I am getting following (attached image) SIGILL, after which, on pressing continue, the code runs, the native functions are called and values returned, but the debugger does not step into native code.

enter image description here

Any pointers what I should look at would be appreciated, Thank You


Solution

  • I have been trying to get an external c++ project work with android studio since a week now and trying to narrow down the reason --> "Why I am not able to step into the native code "

    For me the problem was presence of "-gstabs+" flag in LOCAL_CPPFLAGS I removed it --> build --> and Yay

    Following is the flags description: https://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/Debugging-Options.html

    -gstabs+ Produce debugging information in stabs format (if that is supported), using GNU extensions understood only by the GNU debugger (GDB). The use of these extensions is likely to make other debuggers crash or refuse to read the program.

    Note: the above SIGILL image that I posted in the question still persist, but it was not what was causing debugger to not step it.