Rt
C + + debugging in the Android NDK,
GDB debugging is tricky, in ADT Eclipse:
1. Configure the NDK to project plus native support
2. Add Ndk_debug=1 in the compilation
3. Then retrofit the next MK file:
#APP_DEBUG'll be set to ANDROID-NDK if Ndk_debug=1 is Set.ifdef app_debug ifeq ($ (app_debug), true) Cflags+=-o0- G local_cflags+=-d_debug app_optim: = DEBUG Else cflags+=-o2-g local_cflags+=-dndebug App_optim: = Release endifendif
You can debug any breakpoint,
This is the ideal situation, usually there will be a variety of situations, before the experience is more than a few breakpoints on the good,
I've never been too careful.
Today I met a hole, the breakpoint can not be hung up anyway,
After careful study, we found that:
1. The catalogue must not contain spaces, otherwise "no symbol table is loaded." Use the "file" command ", confused, where errors are not known;
2. In the Java code system.loadlibrary plus breakpoints, can be very good to avoid the breakpoint cannot hang on the case (in theory this will not work, java/gdb Two debugger can only start one);
3. A better solution is to use Libandroid_native_app_glue, pure C + + implementation (NDK has an example to refer to);
Time spent very long, tread on the mark, hope to feast on posterity.
C + + Debug Stomp mark in Android NDK