Bug 19863 - 7.10 regression: gdb remote.c due to "setfs" with gdbserver < 7.7
Summary: 7.10 regression: gdb remote.c due to "setfs" with gdbserver < 7.7
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: remote (show other bugs)
Version: 7.10
: P2 normal
Target Milestone: 7.11.1
Assignee: Jan Kratochvil
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-24 16:51 IST by Jan Kratochvil
Modified: 2016-04-27 19:32 IST (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kratochvil 2016-03-24 16:51:45 IST
gdb-7.9 gdbserver-7.9 PASS:
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.

gdb-7.10 gdbserver-7.9 FAIL:
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' 
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

Re: [patch] Suggest newer gdbserver if it has no qXfer:exec-file:read
https://sourceware.org/ml/gdb-patches/2016-03/msg00487.html
Comment 1 Jan Kratochvil 2016-03-24 22:10:55 IST
[patch] Workaround gdbserver<7.7 for setfs [Re: [patch] Suggest newer gdbserver if it has no qXfer:exec-file:read]
https://sourceware.org/ml/gdb-patches/2016-03/msg00499.html
Comment 2 Jan Kratochvil 2016-04-27 19:32:59 IST
[commit+7.11] [patchv5] Workaround gdbserver<7.7 for setfs
https://sourceware.org/ml/gdb-patches/2016-04/msg00607.html

Commit:
	57809e5e5a506664eb54433ded81ab0785168a83
and 7.11:
	a6ff23076f49c6322d96a76e0098f8019139bc4e