title: gdb can't find a symbol to break on
body: <p>I am debugging a C++ application, <code>info shared</code> tells me this library I want to break in has been read and has debugging symbols,</p>
  
  <pre><code>0x00007fffedc1f530  0x00007ffff18e4e60  Yes         /home/me/WPEWebKit/WebKitBuild/Debug/lib/libWPEWebKit.so
  </code></pre>
  
  <p>I then ran <code>nm</code> on this loaded shared library and found a symbol I would like to break on (just to make sure the name was right):</p>
  
  <pre><code>$ nm /home/me/WPEWebKit/WebKitBuild/Debug/lib/libWPEWebKit.so | c++filt | grep -iw handleSyncmessage
  0000000008a03e14 T WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage(_GstMessage*)
  </code></pre>
  
  <p>It might be worth me saying that <code>libWPEWebKit.so</code> is just over 650MB, so quite a heavyweight.</p>
  
  <p>Now in GDB, I say this,</p>
  
  <pre><code>(gdb) break WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage
  Function "WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage" not defined.
  Make breakpoint pending on future shared library load? (y or [n])
  </code></pre>
  
  <p>But we know at this point the symbol is loaded. If I rerun with the breakpoint set, it never gets fired, despite having proved the function is indeed running.</p>
  
  <p>Am I doing something wrong here?</p>
  
  <p><em>Edit: Adding info functions output</em></p>
  
  <pre><code>(gdb) info functions handleSyncMessage
  All functions matching regular expression "handleSyncMessage":
  
  .. lots of template instantiations I am ommitting because they are from unrelated things that just ref. this type ..
  
  File ../../Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
  bool (anonymous namespace)::MediaPlayerPrivateGStreamer::handleSyncMessage(GstMessage*);
  
  File ../../Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
  bool (anonymous namespace)::MediaPlayerPrivateGStreamerBase::handleSyncMessage(GstMessage*);
  
  ..
  
  Non-debugging symbols:
  0x00007fffed84bcf0  WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage(_GstMessage*)@plt
  0x00007fffed84d810  WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage(_GstMessage*)@plt
  </code></pre>
  
  <p>I now notice that I missed some output from nm above that I add for completeness</p>
  
  <pre><code>0000000008a03e14 T WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage(_GstMessage*)
  0000000008a11868 T WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage(_GstMessage*)
  0000000008a16fa8 t std::remove_reference&lt;WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage(_GstMessage*)::{lambda()#1}&amp;&gt;::type&amp;&amp; std::move&lt;WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage(_GstMessage*)::{lambda()#1}&amp;&gt;(std::remove_reference&amp;&amp;)
  0000000008a16f78 t WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage(_GstMessage*)::{lambda()#1}&amp; std::forward&lt;WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage(_GstMessage*)::{lambda()#1}&amp;&gt;(std::remove_reference&lt;WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage(_GstMessage*)::{lambda()#1}&amp;&gt;::type&amp;)
  0000000008a17959 t WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage(_GstMessage*)::{lambda()#1}&amp;&amp; std::forward&lt;WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage(_GstMessage*)::{lambda()#1}&gt;(std::remove_reference&lt;WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage(_GstMessage*)::{lambda()#1}&gt;::type&amp;)
  000000000bdac7d0 r WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage(_GstMessage*)::__FUNCTION__
  000000000bdac800 r WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage(_GstMessage*)::__PRETTY_FUNCTION__
  0000000008a11834 t WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage(_GstMessage*)::{lambda()#2}::operator()() const
  0000000008a115a4 t WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage(_GstMessage*)::{lambda()#1}::operator()() const
  0000000008a18128 t WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage(_GstMessage*)::{lambda()#1}::_GstMessage({lambda()#1}&amp;&amp;)
  0000000008a18128 t WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage(_GstMessage*)::{lambda()#1}::_GstMessage({lambda()#1}&amp;&amp;)
  0000000008a117f8 t WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage(_GstMessage*)::{lambda()#1}::~_GstMessage()
  0000000008a117f8 t WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage(_GstMessage*)::{lambda()#1}::~_GstMessage()
  000000000bdaddc8 r WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage(_GstMessage*)::{lambda()#1}::operator()() const::__FUNCTION__
  </code></pre>
  
  <p>I tried breaking on the <code>MediaPlayerPrivateGStreamerBase</code> symbol as well as the <code>MediaMediaPlayerPrivateGStreamer</code> symbol to no success.</p>
  
  <p><em>Edit 2</em></p>
  
  <p>Another attempt,</p>
  
  <pre><code>(gdb) rbreak ^WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage
  Breakpoint 1 at 0x7fffed84bcf0
  &lt;function, no debug info&gt; WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage(_GstMessage*)@plt;
  </code></pre>
  
  <p>So I guess the underlying question is why does GDB only set breaks on the procedure linkage table and not the real library function? How people even debug on Linux platforms? This seems utterly insane. Needless to say, even the breakpoint on the plt entry is not firing..</p>