title: Unable to use standard library debugging symbols in gdb
body: <p>I am using this code as a test.</p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;sstream&gt;
  #include &lt;iostream&gt;
  
  int main () {
     std::stringstream ss;
     ss &lt;&lt; "This is a test\n";
     std::cout &lt;&lt; ss.str();
  }
  </code></pre>
  
  <p>I compile with
  <code>g++ -O0 -g test.cpp</code>. When I run the program in gdb and stop at a breakpoint on the <code>cout</code> line, trying to print <code>ss</code> or <code>ss.str()</code> fails.</p>
  
  <pre><code>(gdb) p ss
  $1 = &lt;incomplete type&gt;
  (gdb) p ss.str()
  Couldn't find method std::stringstream::str
  </code></pre>
  
  <p>gdb also gives me a ton of warnings about the debug information for libstdc++ and libc not matching their respective libraries, followed by an additional warning suggesting I install separate debuginfos.</p>
  
  <pre><code>warning: the debug information found in "/usr/lib/debug/usr/lib64/libc-2.17.so.debug" does not match "/lib64/libc.so.6" (CRC mismatch).
  warning: the debug information found in "/usr/lib/debug/usr/lib64/libstdc++.so.6.0.19.debug" does not match "/lib64/libstdc++.so.6" (CRC mismatch).
  Missing separate debuginfos, use: debuginfo-install glibc-2.17-260.el7_6.6.x86_64 libstdc++-4.8.5-36.el7_6.2.x86_64
  </code></pre>
  
  <p>However, these packages are already installed according to <code>rpm -qa</code>. I don't have permissions to attempt to reinstall these or try other suggestions from this <a href="https://stackoverflow.com/questions/10389988/missing-separate-debuginfos-use-debuginfo-install-glibc-2-12-1-47-el6-2-9-i686">similar question</a>.</p>
  
  <p>I also found <a href="https://stackoverflow.com/questions/10000335/how-to-use-debug-version-of-libc/10005800#10005800">this question</a> and checked the <code>debug-file-directory</code> that gdb is using.</p>
  
  <pre><code>(gdb) show debug-file-directory
  The directory where separate debug symbols are searched for is "/usr/lib/debug".
  </code></pre>
  
  <p>I am running RHEL7 with the included versions of g++ and gdb.</p>
  
  <p><code>g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)</code></p>
  
  <p><code>GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-114.el7</code></p>