title: no symbols (just question marks) in stack trace in remote gdb
body: <p>I have a relatively simple application (that links in another simple library) that refuses to let me remotely debug it with gdb.  I've checked that gdb and gdbserver versions match.  It's actually even the same OS (ubuntu) on both machines.  It seems to be happily loading symbols from the executable.  So I'm at a bit of a loss for what could be wrong.  Any suggestions appreciated.  Here is the transcript from gdb:</p>
  
  <pre><code>dev:/fast/git/archive/foo$ gdb /fast/git/foo 
  GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
  Copyright (C) 2016 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  and "show warranty" for details.
  This GDB was configured as "x86_64-linux-gnu".
  Type "show configuration" for configuration details.
  For bug reporting instructions, please see:
  &lt;http://www.gnu.org/software/gdb/bugs/&gt;.
  Find the GDB manual and other documentation resources online at:
  &lt;http://www.gnu.org/software/gdb/documentation/&gt;.
  For help, type "help".
  Type "apropos word" to search for commands related to "word"...
  Reading symbols from /fast/git/foo...done.
  (gdb) target remote test1:5000
  Remote debugging using test1:5000
  Reading /lib64/ld-linux-x86-64.so.2 from remote target...
  warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
  Reading /lib64/ld-linux-x86-64.so.2 from remote target...
  Reading symbols from target:/lib64/ld-linux-x86-64.so.2...Reading /lib64/ld-2.23.so from remote target...
  Reading /lib64/.debug/ld-2.23.so from remote target...
  (no debugging symbols found)...done.
  0x00007ffff7dd7cc0 in ?? () from target:/lib64/ld-linux-x86-64.so.2
  (gdb) bt
  #0  0x00007ffff7dd7cc0 in ?? () from target:/lib64/ld-linux-x86-64.so.2
  #1  0x0000000000000003 in ?? ()
  #2  0x00007fffffffce02 in ?? ()
  #3  0x00007fffffffce2f in ?? ()
  #4  0x00007fffffffce32 in ?? ()
  #5  0x0000000000000000 in ?? ()
  </code></pre>
  
  <p>Ah, so interesting. I'm still not sure why, but it only prints that (bogus stack trace) on connect. If I then "continue," it will happily print the right symbols if I trigger a break.</p>
  
  <p>Odd...maybe this is partly user error, but I expected it to start running and break on the start on main when I connected.</p>