Note that there are some explanatory texts on larger screens.

plurals
  1. POGDB backtrace tells me symbol name but not source file
    text
    copied!<p>I have a problem where I can't seem to step into some functions using GDB.</p> <p>I'm using the "PImpl idiom", where I have an inline class in my .cpp file, containing functions that get called from the publicly visible class, like so:</p> <pre><code>// Foo.cpp class FooImpl { public: void open() { // ... } }; Foo::open() { // Impl is a FooImpl* impl-&gt;open(); } </code></pre> <p>Using the debugger, I can't seem to step into <code>FooImpl::open()</code>. </p> <ul> <li>I know for sure that the call is not inlined (I'm using <code>-fno-inline</code> and I can see the <code>call</code> instruction in the assembly);</li> <li>I can set a breakpoint inside the function and GDB can hit that breakpoint and tell me its name and what function I'm in. </li> <li>However, it will not tell me the source file (even though it's the same file as Foo::open())</li> <li>I can't step INSIDE the function; when I execute <code>step</code>, it simply steps over the call.</li> </ul> <p>This is what my stacktrace looks like when I'm on a breakpoint inside the <code>FooImpl::open()</code> call:</p> <pre><code>#0 0x080eee52 in macawi::PowerMateInputImpl::open(std::string) () #1 0x080ee766 in macawi::PowerMateInput::open (this=0x83cf204) at ../../app/hal/interfaces/powermateinput_linux.cpp:126 #2 0x08137455 in macawi::ActorInput::backgroundLoop (this=0x83cf204) at ../../app/common/actors/actorinput.cpp:51 </code></pre> <p>Can anyone tell me why GDB can't determine the source location of the top stack frame, even though it's in the same file as stack frame #1?</p> <p>(For the record, I'm using a graphical debugger that uses GDB in the background (Qt Creator), but the same things hold when I execute GDB directly).</p> <hr> <p>EDIT: The compilation command line looks like this:</p> <pre><code>g++ -c -pipe -g -O0 -fno-inline -ggdb -fPIC -Wall -W ...(defines, include dirs, object file, source file) </code></pre>
 

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