title: Can't print errno in gdb, complains about missing shared library, but it exists
body: <p>When debugging my application, if I break in GDB and try to print errno, even from inside a function that checks errno, I get the following error from GDB:</p>
  
  <pre><code>(gdb) print errno
  Cannot find shared library `/usr/lib/debug/lib/libc-2.11.1.so' in dynamic linker's load module list
  </code></pre>
  
  <p>Things I've tried:</p>
  
  <ol>
  <li>Check if the file exists, it does and is about 7.3MB.</li>
  <li>Adding /usr/lib/debug/lib/ to the front of my LD_LIBRARY_PATH. No effect.</li>
  <li>Setting LD_PRELOAD=/usr/lib/debug/lib/libc-2.11.1.so causes my app to segfault on startup.</li>
  <li>If I run ldd on the binary it says it's using '/lib/libc.so.6', and aptitude (I'm running Ubuntu) tells me libc6-dbg <em>is</em> installed.</li>
  <li>Checked that I don't have a custom lib path set in .gdbinit, I don't.</li>
  </ol>
  
  <p>The application seems to otherwise run fine, so I can't imagine libc itself is screwed up. Any ideas?</p>