I’m trying to debug some native code I built using the android ndk-build script and have hit a small hurdle. I’ve compiled the native code into a shared library and I want to debug it using ndk-gdb in eclipse. The code is built using
APP_OPTIM := debug
in the Application.mk file and I’ve also added the -g flag just to be sure.
Eclipse is configured to debug the native code and I can connect to the gdbserver on the device but I am unable to set breakpoints due to the following error from gdb:
496-break-insert /home/lithium/workspace/supermariowar/jni/SMW/SDL_android_main.cpp:17
No source file named /home/lithium/workspace/supermariowar/jni/SMW/SDL_android_main.cpp.
&"No source file named /home/lithium/workspace/supermariowar/jni/SMW/SDL_android_main.cpp.\n"
496^done
(gdb)
499-exec-continue
499^running
(gdb)
There is indeed a file named SDL_android_main.cpp at the location shown but this is the error I am getting and it will not hit the breakpoint at this time.
Any ideas or suggestions would be greatly appreciated.
-clark-
The error doesn’t mean that GDB can’t see
/home/lithium/workspace/supermariowar/jni/SMW/SDL_android_main.cpp. Rather, it means that GDB can’t see debug info for that source in the executable and shared libraries currently loaded.It may be that your shared library is not loaded yet.
Or it could be that the file is known to GDB, but under some other name. Try
info sourcesorbreak SDL_android_main.cpp:17