I build and debug it with NDK R7,
Can you describe what exatctly and how it didnt work. What enviroment you use. For example im using WinXP, Eclipse 3.6.2, NDK r7 and its work just fine for me with latest version of cocos2dx.
I’ve just spent many hours trying to solve the problem and it seems that gdb in the ndk r7 is screwed up (http://groups.google.com/group/android-ndk/browse_thread/thread/c7e967c342aaaf21)
There is a solution in this thread http://groups.google.com/group/android-ndk/browse_thread/thread/ebd969a055af3196
which is:
“To overcome this i switched the debug info from DWARF ( default) to
stabs by adding -gstabs+ to LOCAL_CPPFLAGS, LOCAL_CFLAGS,
LOCAL_LDLIBS.”
And it really helped and I finally can debug all my files including cocos2dx source.
Hi,
I have the same issue ; thanks for the help. Can you explain what it means to “switch the debug info from DWARF ( default) to stabs by adding -gstabs+ to LOCAL_CPPFLAGS, LOCAL_CFLAGS, LOCAL_LDLIBS.” ? What are the steps to do this ? Thanks
Just add these lines to your Application.mk file:
APP_CFLAGS = -gstabs
APP_LDLIBS = -gstabs
APP_CPPFLAGS = -gstabs
With NDK r9d, -gstabs no longer works (for me). What ended up working was -g -g3 -ggdb -gdwarf-2. The last argument is needed because, as strange as it sounds, NDK bundles incompatible gcc and gdb tools. gcc 4.8 produces debug information in the dwarf-4 format, whereas gdb 7.3 only supports dward-2.