3

I've used ndk-gdb for shared libraries loaded in JNI context. Is it possible to use it to debug pure native executables, built with BUILD_EXECUTABLE target in Android.mk?

zer0stimulus
  • 22,306
  • 30
  • 110
  • 141

1 Answers1

4

You can use gdbserver to start or attach to a process.

// Start debugger and attach to a running process
adb forward tcp:5039 tcp:5039
adb shell /system/bin/gdbserver tcp:5039 --attach PID

If you correctly configure your Eclipse environment you can debug directly from Eclipse. Below are some links I found that helped me out.

General Debugging:
http://mhandroid.wordpress.com/2011/01/25/how-cc-debugging-works-on-android/

Setting up eclipse:
http://mhandroid.wordpress.com/2011/01/23/using-eclipse-for-android-cc-debugging/

Frohnzie
  • 3,559
  • 1
  • 21
  • 24