I followed a couple of tutorials on line, trying to setup gdb to debug native code:
- Chapter 11 of the book Android NDK Beginners Guide.
- Video: http://www.youtube.com/watch?v=hMV7Xqcn39k&list=PLD89B891EF9D26F14&feature=mh_lolz
- Forum: http://wiki.eclipse.org/Sequoyah/ndk_guide
None of them got my debugger working completely.
I now have a specific problem by following steps, which are agreed by all the above tutorials as the correct steps to debug native code:
- In Eclipse, Start my JAVA debugging session and stops at the first breakpoint in my onCreate() method.
- In terminal, under my project folder, run ndk-build-eclipse (the copy of the original ndk-gdb without the last line about auto-connecting gdb client to server), with no obvious warning or errors.
- In terminal, chmod +x MY_PROJECT/obj/local/armeabi/app_process (I'm on a mac), otherwise I'll get "Cannot run MY_PROJECT/obj/local/armeabi/app_process, for unknown reason" error. This app_process is set as GDB debugger in my C++ debug configuration.
- In Eclipse, start my C++ debug configuration.
Then I got an error dialog say:
Error creating session
Process Terminated
Process Terminated
Process Terminated