title: gdb only finds some debug symbols
body: <p>So I am experiencing this really weird behavior of gdb on Linux (KDE Neon 5.20.2):</p>
  <p>I start gdb and load my executable using the <code>file</code> command:</p>
  <pre><code>(gdb) file mumble 
  Reading symbols from mumble...
  </code></pre>
  <p>As you can see it did find debug symbols. Then I start my program (using <code>start</code>) which causes gdb to pause at the entry to the main function. At this point I can also print out the back trace using <code>bt</code> and it works as expected.</p>
  <p>If I now continue my program and interrupt it at any point during startup, I can still display the backtrace without issues. However if I do something in my application that happens in another thread than the startup (which all happens in thread 1) and interrupt my program there, gdb will no longer be able to display the stacktrace properly. Instead it gives</p>
  <pre><code>(gdb) bt
  #0  0x00007ffff5bedaff in ?? ()
  #1  0x0000555556a863f0 in ?? ()
  #2  0x0000555556a863f0 in ?? ()
  #3  0x0000000000000004 in ?? ()
  #4  0x0000000100000001 in ?? ()
  #5  0x00007fffec005000 in ?? ()
  #6  0x00007ffff58a81ae in ?? ()
  #7  0x0000000000000000 in ?? ()
  </code></pre>
  <p>which shows that it can't find the respective debug symbols.</p>
  <p>I compiled my application with cmake (gcc) using <code>-DCMAKE_BUILD_TYPE=Debug</code>. I also ensured that a bunch of debug symbols are present in the binary using <code>objdump --debug mumble</code> (Which also printed a few lines of <code>objdump: Error: LEB value too large</code>, but I'm not sure if this is related to the problem I am seeing).</p>
  <p>While playing around with gdb, I also encountered the error</p>
  <pre><code>Cannot find user-level thread for LWP &lt;SomeNumber&gt;: generic error
  </code></pre>
  <p>a few times, which lets me suspect that maybe there is indeed some issue invloving threads here...</p>
  <p>Finally I tried starting gdb and before loading my binary using <code>set verbose on</code> which yields</p>
  <pre><code>(gdb) set verbose on
  (gdb) file mumble 
  Reading symbols from mumble...
  Reading in symbols for /home/user/Documents/Git/mumble/src/mumble/main.cpp...done.
  </code></pre>
  <p>This does also look suspicious to me as only <code>main.cpp</code> is explicitly listed here (even though the project has much, much more source files). I should also note that all successful backtraces that I am able to produce (as described above) all originate from <code>main.cpp</code>.</p>
  <p>I am honestly a bit clueless as to what might be the root issue here. Does someone have an idea what could be going on? Or how I could investigate further?</p>
  <hr />
  <p>Note: I also tried using clang as a compiler but the result was the same.</p>
  <p>Used program versions:<br />
  cmake: 3.18.4<br />
  gcc: 9.3.0<br />
  clang: 10.0.0<br />
  make: 4.2.1</p>