Reputation: 4349
I've been looking around to find an easy way to debug my JNI code, you know, to be able to freely jump into native code and back into java code.
The solutions which I found were sort of out of date or got some restrictions. Some required specific ndk version, some required specific Eclipse version. Here my target is Android 1.6 & 2.2, I'm using Eclipse 3.6 Helios, and NDK r5b. Is there a general solution for this mixed debugging? Thx.
Upvotes: 2
Views: 413
Reputation: 5292
Citate from $NDK/docs/NDK-GDB.html
:
IMPORTANT: Native debugging can only work if all these conditions are met:
1. Your application is built with the 'ndk-build' script: Building with the legacy "make APP=<name>" method is not supported by ndk-gdb. 2. Your application is debuggable: In other words, your AndroidManifest.xml has an <application> element that sets the android:debuggable attribute to "true" 3. You are running your application on Android 2.2 (or higher): ndk-gdb will not work if you try to run your application on previous versions of the system. That does not mean that your application should target the Android 2.2. API level, just that the debugging session should happen on a 2.2+ device or emulator system image.
so, you can't use device with 1.6.
How to setup environment to debug jni code: i used this recipe, it works for me.
Upvotes: 1