title: GDB does not break in dynamically-loaded .so file?
body: <p>In my Linux system I'm writing a program that dynamically loads some .so libraries when running.  It's like this: The executable program will search under a particular directory when it starts to run and then load all the .so files in that directory.  Please <strong>note</strong> that the executable and the .so are built independently, and the build of the executable does <strong>NOT</strong> link to the .so files.</p>
  
  <p>My problem is: After I run the program(thus all the .so libraries have been loaded) with GDB attached, <strong>I seem to be able to set a breakpoint on the code in the .so file</strong>(the GDB prompts me that this breakpoint is set in a shared library), <strong>but this breakpoint never actually breaks.</strong></p>
  
  <p><strong>How should I make these breakpoints really work?</strong>  During the debug session I have all the source code available at the right places, and the -g option is on.  I also removed the -O2 optimization when compiling.</p>