Still can't get this working using Eclipse & Cygwin, with NDK 8c and native C++ entry point (NativeActivity). I followed this tutorial ( http://mhandroid.wordpress.com/2011/01/23/using-eclipse-for-android-cc-debugging/ ) replacing 'armeabi' with armeabi-v7a' and using gdb.setup instead of gdb2.setup
I did find a bug in ndk-gdb that I had to work around, and is worth noting.
I set "APP_ABI = armeabi-v7a" in my Application.mk. ndk-build allows you to set NDK_APPLICATION_MK=(path to another Application.mk), however when ndk-gdb queries APP_ABI out of your Application.mk (line 475), it does *not* take into account NDK_APPLICATION_MK and falls back to jni/Application.mk, and when that doesn't exist falls back to $(NDK)/build/core/default-application.mk. The net result is it fails to query APP_ABI from the right Application.mk and defaults to 'armeabi' which is wrong (should be 'armeabi-v7a')
My workaround is to add jni/Application.mk and set APP_ABI=armeabi-v7a in there. That takes care of the ndk-gdb step. Based on my understanding of the NDK scripts/makefiles, I consider it a bug that ndk-gdb doesn't pass along arguments when querying with get_build_var( ). It should accept NDK_APPLICATION_MK=(whatever)
So now I've got gdbserver launching properly. I'm setting a breakpoint inside this while loop:
void android_main( android_app* state )
... but gdb crashes when connecting!
Here's the gdbserver output:
Android NDK installation path: /cygdrive/e/uppercut/sdks/android-ndk
Here's the gdb output:
Reading symbols from E:\uppercut\prototype\build\code\androidp4\radgame\obj\local\armeabi-v7a\app_process...done.
I have had debugging working before with gdb, with a Java entry point and 'armeabi'. After switching to C++ entry point (android_main) and 'armeabi-v7a', gdb crashes. I don't know if either is related...
On Monday, November 26, 2012 4:01:15 PM UTC-8, Brian Segall wrote:
Is anyone able to debug using gdb, after switching to armeabi-v7a? It worked fine before. So far I'm just wondering if it's an NDK/gdb issue, or my issue.--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/C3sd5pRTszcJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
|Free forum by Nabble||Edit this page|