I have been trying for days to debug into the c code of the sample hello-jni, with no success. I have installed all the requirements and followed many blog posts (repeating the process each time) to try to get this working.
I am using
I have followed this http://developer.android.com/tools/sdk/ndk/index.html to set up and build the apk. It builds and installs fine and I can debug java code if launched as an Android Application
I followed this article about the NDK plugin http://tools.android.com/recent/usingthendkplugin but when launching as an Android Native Application with a breakpoint in the c code, the app launches and runs as normal with no breakpoint being hit and no error messages!
Any help would be greatly appreciated. Thanks!
EDIT:
Here's some errors that appear in the console for half a second before being cleared
warning: while parsing target library list (at line 2): No segment defined for /system/bin/linker
warning: Could not load shared library symbols for 52 libraries, e.g. /system/bin/linker.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code.
Quit (expect signal SIGINT when the program is resumed)
Turns out the above guides I used were all I needed and everything was working.
The warning messages were just... warnings and so debugging of the native code worked all along. My problem was the native function call where I had my breakpoint was being called immediately - before the gdb could attach. I put the JNI function call into an onClick and found my breakpoint was being hit after all.
I hope the above links and this answer can help someone. Thanks...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With