title: Android NDK solib-search-path on Windows using incorrect slashes
body: <p>I'm trying to debug an NDK project on Windows using Eclipse (Kepler), but GDB won't find the symbols for the .so file, because the direction of the slashes in the search path are incorrect. Using NDK r9 and SDK 22.2.1, when I try and run the application, GDB shows:</p>
  <blockquote>
  <p>warning: Could not load shared library symbols for 64 libraries, e.g. /system/bin/linker.</p>
  <p>Use the &quot;info sharedlibrary&quot; command to see the complete listing.</p>
  <p>Do you need &quot;set solib-search-path&quot; or &quot;set sysroot&quot;?
  warning: Unable to find dynamic linker breakpoint function.</p>
  <p>GDB will retry eventurally. Meanwhile, it is likely that GDB is unable to debug shared library initializers or resolve pending breakpoints after dlopen().</p>
  <p>No symbol table is loaded.  Use the &quot;file&quot; command.</p>
  <p>No symbol table is loaded.  Use the &quot;file&quot; command.</p>
  <p>No symbol table is loaded.  Use the &quot;file&quot; command.</p>
  </blockquote>
  <p>The &quot;No symbol table is loaded...&quot; lines appear once for each breakpoint set in my library. The problem seems to be that GDB isn't finding the unstripped .so file, as the search path contains backslashes instead of forward slashes. If I pause the program and execute the following GDB commands, this is the output I get:</p>
  <pre><code>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
  </code></pre>
  <p>If I then update the solib-search-path to use forward slashes, I get this:</p>
  <pre><code>set solib-search-path C:/Users/Username/Projects/Project/Android/obj/local/armeabi-v7a/
  warning: Could not load shared library symbols for 74 libraries, e.g. /system/bin/linker.
  Use the &quot;info sharedlibrary&quot; command to see the complete listing.
  Do you need &quot;set solib-search-path&quot; or &quot;set sysroot&quot;?
  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
  </code></pre>
  <p>After which point GDB will successfully hit breakpoints in the native code. The gdb.setup file in the libs\armeabi-v7a folder has the line:</p>
  <pre><code>set solib-search-path ./obj/local/armeabi-v7a
  </code></pre>
  <p>But I'm not sure where this path gets changed into an absolute path. I'm guessing it's at that point that GDB uses the path with backslashes instead of forward slashes, but I'm not sure where that happens. I did try modifying the Android NDK build scripts that create the gdb.setup file, and even tried putting in a different path, but the output from show solib-search-path was just the same, so I'm not even sure GDB is using that search path. Has anyone come across this problem before, or does anyone know how I can get GDB to start up with the correct search path when I run from Eclipse?</p>