I am to create a shared library for Android OS. Although I have done some Android apps in Eclipse I decided to start my native development with Visual Studio and vs-Android
The steps I take to be able to debug using ndk-gdb
To build
Set the -g
compiler flag in jnk/Android.mk to build the gdb-server
LOCAL_CFLAGS := -g
Build the native lib for debugging NDK_DEBUG=1
ndk-build NDK_DEBUG=1
Set the application debuggable in the manifest.
android:debuggable=true
Open cygwin and cd to the project path. Set the path to adb.
export PATH=$PATH:/path_to_android_sdk/platform-tools
And then start gdb
ndk-gdb --verbose --adb=adb.exe
You will have to type continue
when you have connected to the gdb-server
There is a step-by-step tutorial on debugging vs-android projects with Visual Studio here: http://visualgdb.com/tutorials/android/vs-android/