title: How to debug functions in a dynamic library loaded with LD_PRELOAD with gdb?
body: <p>I'm trying to debug some functions in a dynamic shared library libexecHook.so. This library is preloaded setting LD_PRELOAD in order to intercept and rewrite some calls to execve() and friends. For debugging purposes I have built gmake with symbols. From what I read in other questions this should work:</p>
  
  <pre><code>gdb ~/tmp/make-dfsg-3.81/make
  set exec-wrapper env LD_PRELOAD=/home/marko/execHook.C027/lib/libexecHook.so.0.0.0
  start
  break execve
  break execvp
  cont
  </code></pre>
  
  <p>I do see the breakpoints being set properly, e.g.</p>
  
  <pre><code>4       breakpoint     keep y   0x00007ffff7bd92e0 in execvp at execHook.c:128
  </code></pre>
  
  <p>but gdb never breaks at my preloaded exec..() functions. Watching the debug output during execution I see that the my library functions are being called. </p>