I am trying to debug an NDK project on Windows using Eclipse (Kepler), but GDB will not find characters for the .so file, because the slash direction in the search path is wrong. Using NDK r9 and SDK 22.2.1, when I try to run the application, GDB shows:
warning: failed to load shared symbol libraries for 64 libraries, e.g. / Systems / bin / linker.
Use the info sharedlibrary command to view the complete list.
Do you need to install solib-search-path or set sysroot? warning: it is not possible to find a dynamic breakpoint function.
GDB will be repeated repeatedly. Meanwhile, it is likely that GDB cannot debug shared library initializers or allow pending breakpoints after dlopen ().
Character table is not loading. Use the file command.
Character table is not loading. Use the file command.
Character table is not loading. Use the file command.
The lines "No symbol table loading ..." are displayed once for each breakpoint set in my library. The problem is that GDB cannot find the file with the .so extension, because the search path contains a backslash instead of a skew. If I pause the program and execute the following GDB commands, this is the result that I get:
show solib-search-path The search path for loading non-absolute shared library symbol files is C:\\Users\\Username\\Projects\\Project\\Android/obj/local/armeabi-v7a/. info shared From To Syms Read Shared Object Library 0x4003fff0 0x4006db40 Yes C:/Users/Username/Projects/Project/Android/obj/local/armeabi-v7a/libc.so 0x5bda8598 0x5bf5aa50 No C:/Users/Username/Projects/Project/Android/obj/local/armeabi-v7a/libProject.so
If I then update the solib-search path to use slashes, I get the following:
set solib-search-path C:/Users/Username/Projects/Project/Android/obj/local/armeabi-v7a/ warning: Could not load shared library symbols for 74 libraries, eg /system/bin/linker. Use the "info sharedlibrary" command to see the complete listing. Do you need "set solib-search-path" or "set sysroot"? warning: Unable to find dynamic linker breakpoint function. GDB will retry eventurally. Meanwhile, it is likely that GDB is unable to debug shared library initializers or resolve pending breakpoints after dlopen(). info shared From To Syms Read Shared Object Library 0x4003fff0 0x4006db40 Yes C:/Users/Username/Projects/Project/Android/obj/local/armeabi-v7a/libc.so 0x5bda8598 0x5bf5aa50 Yes C:/Users/Username/Projects/Project/Android/obj/local/armeabi-v7a/libProject.so
After that, GDB will successfully hit breakpoints in native code. The gdb.setup file in the libs \ armeabi-v7a folder has the line:
set solib-search-path ./obj/local/armeabi-v7a
But I'm not sure where this path turns into an absolute path. I assume that at this point, GDB uses a backslash path instead of slashes, but I'm not sure where this happens. I tried changing the Android NDK build scripts that created the gdb.setup file, and even tried to put a different path, but the output from show solib-search-path was the same, so I'm not even sure if GDB is using this search path. Has anyone encountered this problem before or does anyone know how I can get GDB to start with the correct search path when I start from Eclipse?