Reputation: 2237
What are the options for debugging native code on Android? Is gdb the only debugger available? Is their a Visual Studio integration?
I've looked through the Android docs and done the googlesing but am not confident I found the right answer. Hopefully some SO pro's will save me the pain of trial and error.
But if my choices are gdb or printf's, I'll move to Mono for Android instead!
Solution! WinGDB is available for Android. Debugging with Visual Studio!
Upvotes: 4
Views: 6061
Reputation: 2062
I haven't tried this myself, but this blog post explains how to get NDK debugging working in Visual Studio.
Also, I've done a lot of looking into NDK debugging at work, and I haven't seen a mention of using a debugger other than gdb (but please don't take this as a fact, this is just from my experience). I have managed to successfully debug NDK through Eclipse, so at least you know it's possible! If you decide to go down that route, I can provide you with some links/documentation to get you started.
Upvotes: 5
Reputation: 4606
For further reference, I like this solution that shows how to use graphical derivatives of gdb, such as cgdb (http://cgdb.github.com/) and ddd (http://www.gnu.org/software/ddd/): http://mhandroid.wordpress.com/2011/01/23/using-cgdb-with-ndk-debug-and-cgdb-tutorial/
Upvotes: 0
Reputation: 10193
I found these macro defs but beyond that I cannot say.
#include <android/log.h>
#define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, "libnav",
__VA_ARGS__)
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG , "libnav",
__VA_ARGS__)
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO , "libnav",
__VA_ARGS__)
#define LOGW(...) __android_log_print(ANDROID_LOG_WARN , "libnav",
__VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR , "libnav",
__VA_ARGS__)
#endif // ANDROID_ALOG_H
UPDATE
Apparently you can use DDD either as a plugin to eclipse as found on Code Maemo
or run under Cygwin, you will find some useful links in Debugging Android NDK, under windows
Additionally there are some very useful plugins
The installation and configuration of the stack is detailed in How-to debug native code with Android
Upvotes: 0