While I can debug my application with the Eclipse JDT debugger for Java code and GDB for C code, I would prefer to use a single tool for all my debugging. I found several projects that enable "mixed-mode" debugging in Eclipse and include support for single stepping between Java and native code.
- Intel's Integrated Debugger for Java/JNI Environments
- Mariot Chauvin's Summer of Code Project: Support Seamless Debugging between JDT & CDT
Unfortunately, one claims开发者_Go百科 to be pre-release quality and the other is currently unmaintained. Are there any plug-ins that bring mixed mode debugging functionality to Eclipse in a reliable way or should I continue to use two separate debuggers?
For those looking to debug NDK/JNI code in the Eclipse Juno release, it is essentially built into the software after installing the Android plugins and CDT plugins. You may have issues though since there is a problem that was introduced with the C/C++ Development tools (CDT 8.1) that as of 7/24/12 has not been fixed. For details on the issue see the following link. If you just want to debug, keep reading.
http://code.google.com/p/android/issues/detail?id=33788
If it is working correctly, you simply set your breakpoints in the C and Debug As -> Android Native Application. Unfortunately, you can not debug the java and C at the same time. If the problem is in the Java and you want to debug you do so by clicking Debug As -> Android Application.
If it is not working correctly, and you want to figure out how to get it correctly, the following packages worked for me.
Android DDMS 20.0.1.v201207132230-403220
Android Development Tools 20.0.1.v201207132230-403220
Android Hierarchy Viewer 20.0.1.v201207132230-403220
Android Native Development Tools 20.0.1.v201207132230-403220
Android Traceview 20.0.1.v201207132230-403220
Autotools support for CDT (Incubation) 3.0.1.201202152032
C/C++ Development Tools 8.0.2.201202111925
C/C++ Development Tools SDK 8.0.2.201202111925
C/C++ Library API Documentation Hover Help (Incubation)
Eclipse SDK 4.2.0.I20120608-1400
Tracer for OpenGL ES 20.0.1.v201207132230-403220
The android packages came from setting Work With: option on the Eclipse Help->Install New Software... dialog to
dl-ssl.google.com/android/eclipse/
The older 8.02... CDT packages came from setting the Work With: option to the Indigo release packages.
download.eclipse.org/releases/indigo
If installed, you will need to remove the Android tools, and the new version of the CDT prior to installing the old version of the CDT. Once the 8.02... version of CDT is installed, you can install the Android tools and commence debugging.
Ensure you use the Build command "ndk-build NDK_DEBUG=1"
Autotools may not be required but since it is installed I have it listed.
Note that stepping through the code can be quirky sometimes.
I don't think there is anything available today which will fix it, but I know that Doug Schaefer has this pretty high on his list of things he wants to get done. Keep an eye on his blog for updates on that.
ARM itself seems to have a toolkit: http://ds.arm.com/ds-5-community-edition/
Requires Eclipse 4.4 ("Luna").
With the new Android ADT bundle (as of 05/12/2013), there is no longer a need for the older 8.02 software package. If you find yourself editing text files to get the debugging working, you are following old directions that no longer apply. Use the android ADT and Debug As-> Android Native Application. You may still need to set NDK_DEBUG=1 if its not already done in the setup.
Eclipse Sequoyah 1.0 has android ndk features..Eclipse 3.6 release train and 3.5 release early June.
精彩评论