3

I have some piece of code which uses JNI. I can debug code wrote in Java directly in Eclipse (using ADT). I even have a script, which help me debug native code with gdb. However this is not very comfortable way for doing this.

Is it possible to configure Eclipse to use gdb (I guess gdbserver) for debbuging android native applications? Do you know where I could find any description of this?

noisy
  • 6,495
  • 10
  • 50
  • 92

2 Answers2

2

according to the release notes from Android 2.2 NDK - you can now debug on device native code. please refer to the NDK docs, since I didn't try this myself.

reflog
  • 7,587
  • 1
  • 42
  • 47
  • Strictly this in Android NDK r4 which was released at the same time as Android 2.2 but this is right. You can find the docs here: http://developer.android.com/intl/de/sdk/ndk/index.html – David Webb May 24 '10 at 10:44
1

It depends whether you want to debug JNI code you have written using NDK apis vs native code in AOSP applications.

For the former case, use NDK debugging tools. For the latter, you need to have right version of gdbserver and gdb. The session needs to be configured with gdb script to find symbols for AOSP libs. Please check Debugging AOSP native applications link for step by step tutorial.

videoguy
  • 1,732
  • 2
  • 24
  • 49