Description of problem: gdb>=7.10 (>=DTS-4.0) can no longer access shared libraries via sysroot "remote:" with gdbserver<=7.9. RHEL-7 has gdbserver-7.6.1. Installing DTS-4.0+ gdbserver workarounds that. Version-Release number of selected component (if applicable): devtoolset-4-gdb-7.11-57.el7 How reproducible: Always. Steps to Reproduce: host1$ gdbserver-7.9 :1234 /root/inferior ^^^ host2$ gdb-7.10 -ex 'set sysroot remote:' -ex 'file /root/inferior-copy-from-host1' -ex 'target remote host1:1234' Actual results: warning: "remote:" is deprecated, use "target:" instead. warning: sysroot set to "target:". Reading symbols from /root/inferior-copy-from-host1...done. Remote debugging using host1:1234 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. warning: Unable to find dynamic linker breakpoint function. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code. 0x00007ffff7ddc430 in ?? () (gdb) b main Breakpoint 1 at 0x40071a: file threadit.c, line 18. (gdb) c Continuing. Reading /lib64/libpthread.so.0 from remote target... Error while mapping shared library sections: Could not open `target:/lib64/libpthread.so.0' as an executable file: Invalid argument ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Reading /lib64/libc.so.6 from remote target... Error while mapping shared library sections: Could not open `target:/lib64/libc.so.6' as an executable file: Invalid argument Reading /lib64/ld-linux-x86-64.so.2 from remote target... Error while mapping shared library sections: Could not open `target:/lib64/ld-linux-x86-64.so.2' as an executable file: Invalid argument Breakpoint 1, main () at threadit.c:18 18 var++; (gdb) info sharedlibrary From To Syms Read Shared Object Library No /lib64/libpthread.so.0 No /lib64/libc.so.6 No /lib64/ld-linux-x86-64.so.2 Expected results: host1$ gdbserver-7.9 :1234 /root/inferior host2$ gdb-7.9 -ex 'set sysroot remote:' -ex 'file /root/inferior-copy-from-host1' -ex 'target remote host1:1234' Reading symbols from /root/inferior-copy-from-host1...done. Remote debugging using host1:1234 Reading symbols from remote:/lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done. 0x00007ffff7ddc430 in _start () from remote:/lib64/ld-linux-x86-64.so.2 (gdb) b main Breakpoint 1 at 0x40071a: file threadit.c, line 18. (gdb) c Continuing. Breakpoint 1, main () at threadit.c:18 18 var++; (gdb) info sharedlibrary From To Syms Read Shared Object Library 0x00007ffff7ddbae0 0x00007ffff7df627a Yes (*) remote:/lib64/ld-linux-x86-64.so.2 0x00007ffff7bc48a0 0x00007ffff7bcf514 Yes (*) remote:/lib64/libpthread.so.0 0x00007ffff781d3e0 0x00007ffff7960c10 Yes (*) remote:/lib64/libc.so.6 (*): Shared library is missing debugging information. Additional info:
The real compatibility with RHEL <=7.2 (and <=6.8) gdbserver did not make it to DTS-4.1 (see Bug 1324606 for its DTS-5.0 clone). Keeping this Bug at least for a warning suggesting to use more recent gdbserver.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2016:1144