title: GDB 7.5 (OS X): Can't access source from library functions
body: <p>gdb newbie here, so I hope I haven't overlooked something glaringly obvious… (and if I did, maybe a kind soul could point it out anyway? ;)</p>
  
  <p>I'm debugging a GCC C++ application under OS X Lion. As it's quite heavy on STL, I'd really like to use a GDB version with python support (i.e. >=v7) for pretty printing of containers. My application is split up into a backend library (.dylib) that does all the heavy lifting, and a very simple frontend application. All of the sources and binaries are below a common source path, and everything has been compiled with debugging symbols (I tried both -g and -ggdb).</p>
  
  <p>Using the GDB version in XCode (which identifies as "GNU gdb 6.3.50-20050815 (Apple version gdb-1820)"), displaying the source lines of frames in a backtrace works as expected out of the box, no matter whether the respective call happens in the frontend app or the backend library:</p>
  
  <p>(gdb) f 12</p>
  
  <p>#12 0x000000010002ddc5 in FL3D::Resource::createMesh_ (this=0x7fff5fbff7c8, fl3d=@0x7fff5fbff1f8, id=) at /Development/workspace/fl3d/libfl3d/resource.cpp:234</p>
  
  <p>234             std::vector&amp; t = textureIndices_.at(i);</p>
  
  <p>(gdb)</p>
  
  <p>So far so good. GDB 7.5 and 7.4.1, on the other hand, refuse to give me any source lines from the library:</p>
  
  <p>(gdb) f 12</p>
  
  <p>#12 0x000000010002ddc5 in FL3D::Resource::createMesh_(FL3D::FL3DParser&amp;, std::string) ()
     from /Development/workspace/fl3d/libfl3d/build/libfl3d.dylib</p>
  
  <p>(gdb) </p>
  
  <p>I'm really confused by the different responses given – gdb6 prints the correct path to the source file and the correct line, while gdb7 gets the function prototype right (supposedly read from the debugging symbols of the .dylib?), but doesn't seem to know anything about the source. Interestingly, though, it DOES show the corresponding source line for calls in the frontend's main() function!</p>
  
  <p>I've already tried manually setting the path to the library's source files with "dir libfl3d", but that doesn't change anything. I also notice that gdb6 says "Reading symbols for shared libraries" a few times when I run the application and gdb7 doesn't – but the symbols don't seem to be the problem, as they seem to be resolved correctly by both versions?</p>
  
  <p>I'm at my wit's end here. Any pointers?</p>