Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your first point of confusion: <code>Bar::Baz(Qux*, Quux*)</code> does <em>not</em> imply that debug symbols are present (and in fact implies that they are <em>not</em> present).</p> <p>The debugger merely demangles the function name. If the debug symbols were in fact present, you'd see <code>Bar::Baz(Qux* qux = 0x12..., Quux* quux = 0x234...)</code></p> <p>As for the real problem, I suspect that the symbol is defined in some <em>other</em> library, which</p> <ul> <li>appears on the link line for the binary before <code>libfoo.so</code> does, and</li> <li>was built without debug symbols</li> </ul> <p>(The runtime loader will bind the reference to <code>Bar::Baz()</code> to the first definition it sees.)</p> <p>If you print <code>ip</code> in frame #7, then do <code>info symbol &lt;value-just-printed&gt;</code>, I suspect you'll have an "Aha!" moment.</p> <p><strong>EDIT:</strong> Your update made your question self-inconsistent. AFAICT, </p> <ol> <li><code>gdb</code> can see debug symbols when you execute<br> <code>libtool --mode=execute gdb .libs/libfoo.so</code></li> <li>but not when you execute <code>libtool --mode=execute gdb binary</code></li> <li>you've verified that the symbol definition is coming from the <em>exact</em> same <code>.libs/libfoo.o</code></li> <li>and <code>readelf -w</code> doesn't see debug symbols in <code>.libs/libfoo.o</code></li> </ol> <p>At least one of the above statements is likely false.</p> <p>If they are all really true, you probably have a weird <code>GDB</code> <em>and</em> <code>readelf</code> bug (a bug in one is possible, a simultaneous bug in both is somewhat unlikely).</p> <p>Also note that adding <code>-g</code> to <code>LDFLAGS</code> is generally the <em>wrong</em> thing to do. Did you mean to add it to <code>CXXFLAGS</code> instead?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload