可以在这个位置看到设置NDK层代码调试的方法:
简单的总结如下:
1.在windows->preference->android设置SDK路径,这个是废话,不设置这个怎么开发Android程序

2.在windows->prefernece->android->ndk指定NDK的路径:

3. Android Tools -> Add native support
4.写好JNI层的代码
5.在project -> properties -> C/C++ Build:
添加NDK_DEBUG=1

6.在C层的代码中设置断点。
7.在项目上面右键,选择Debug As -> Android Native Application
8.一定要注意其中的一段说明:
Note: There is a delay of a few seconds between when the activity is launched and when native debugging starts. If your code is already executed by that point, then you won’t see the breakpoint being hit. So either put a breakpoint in code that is called repetitively, or make sure that you call JNI code after you see that ndk-gdb has connected.
9.所以,可以考虑将进入NDK层的代码设置为UI界面的控件触发,这样就可以控制时间,等到gdbsever启动好了再调试NDK层代码。
10.进入以后的效果如下:
