public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug server/29652] New: [gdbserver] Keeping symbols between two gdbserver sessions breaks second session
@ 2022-10-05  9:19 vries at gcc dot gnu.org
  2022-10-05  9:25 ` [Bug server/29652] " vries at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: vries at gcc dot gnu.org @ 2022-10-05  9:19 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29652

            Bug ID: 29652
           Summary: [gdbserver] Keeping symbols between two gdbserver
                    sessions breaks second session
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: server
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

Consider the following 2 consecutive gdbserver sessions, separated by "file":
...
$ gdb -q -batch \
  -ex "target remote | gdbserver - ~/a.out" \
  -ex continue \
  -ex "file" \
  -ex "target remote | gdbserver - ~/a.out" \
  -ex continue
stdin/stdout redirected
Process /home/vries/a.out created; pid = 28666
Remote debugging using stdio
Reading /home/vries/a.out from remote target...
warning: File transfers from remote targets can be slow. Use "set sysroot" to
access files locally instead.
Reading /home/vries/a.out from remote target...
Reading symbols from target:/home/vries/a.out...
Reading /lib64/ld-linux-x86-64.so.2 from remote target...
Reading /lib64/ld-linux-x86-64.so.2 from remote target...
Reading
/usr/lib/debug/.build-id/5c/abd6dddf6c61859687ee6a3c3273fe4c01c68b.debug from
remote target...
Reading /lib64/ld-2.31.so-2.31-150300.41.1.x86_64.debug from remote target...
Reading /lib64/.debug/ld-2.31.so-2.31-150300.41.1.x86_64.debug from remote
target...
Reading /usr/lib/debug//lib64/ld-2.31.so-2.31-150300.41.1.x86_64.debug from
remote target...
Reading /usr/lib/debug/lib64//ld-2.31.so-2.31-150300.41.1.x86_64.debug from
remote target...
Reading target:/usr/lib/debug/lib64//ld-2.31.so-2.31-150300.41.1.x86_64.debug
from remote target...
Reading
/usr/lib/debug/.build-id/26/7a3e00bc5c234ec8c0c4c68ca478a2844e3338.debug from
remote target...
0x00007ffff7dd4550 in _start () from target:/lib64/ld-linux-x86-64.so.2
Reading /lib64/libc.so.6 from remote target...
Reading
/usr/lib/debug/.build-id/c8/417d767baccfadb39b474e484d46947915cd8f.debug from
remote target...
Reading /lib64/libc-2.31.so-2.31-150300.41.1.x86_64.debug from remote target...
Reading /lib64/.debug/libc-2.31.so-2.31-150300.41.1.x86_64.debug from remote
target...
Reading /usr/lib/debug//lib64/libc-2.31.so-2.31-150300.41.1.x86_64.debug from
remote target...
Reading /usr/lib/debug/lib64//libc-2.31.so-2.31-150300.41.1.x86_64.debug from
remote target...
Reading target:/usr/lib/debug/lib64//libc-2.31.so-2.31-150300.41.1.x86_64.debug
from remote target...
hello
[Inferior 1 (process 28666) exited normally]
stdin/stdout redirected
Process /home/vries/a.out created; pid = 28720
Remote debugging using stdio
Reading /home/vries/a.out from remote target...
Reading /home/vries/a.out from remote target...
Reading symbols from target:/home/vries/a.out...
Reading /lib64/ld-linux-x86-64.so.2 from remote target...
Reading /lib64/ld-linux-x86-64.so.2 from remote target...
Reading
/usr/lib/debug/.build-id/5c/abd6dddf6c61859687ee6a3c3273fe4c01c68b.debug from
remote target...
Reading /lib64/ld-2.31.so-2.31-150300.41.1.x86_64.debug from remote target...
Reading /lib64/.debug/ld-2.31.so-2.31-150300.41.1.x86_64.debug from remote
target...
Reading /usr/lib/debug//lib64/ld-2.31.so-2.31-150300.41.1.x86_64.debug from
remote target...
Reading /usr/lib/debug/lib64//ld-2.31.so-2.31-150300.41.1.x86_64.debug from
remote target...
Reading target:/usr/lib/debug/lib64//ld-2.31.so-2.31-150300.41.1.x86_64.debug
from remote target...
Reading
/usr/lib/debug/.build-id/26/7a3e00bc5c234ec8c0c4c68ca478a2844e3338.debug from
remote target...
0x00007ffff7dd4550 in _start () from target:/lib64/ld-linux-x86-64.so.2
Reading /lib64/libc.so.6 from remote target...
Reading
/usr/lib/debug/.build-id/c8/417d767baccfadb39b474e484d46947915cd8f.debug from
remote target...
Reading /lib64/libc-2.31.so-2.31-150300.41.1.x86_64.debug from remote target...
Reading /lib64/.debug/libc-2.31.so-2.31-150300.41.1.x86_64.debug from remote
target...
Reading /usr/lib/debug//lib64/libc-2.31.so-2.31-150300.41.1.x86_64.debug from
remote target...
Reading /usr/lib/debug/lib64//libc-2.31.so-2.31-150300.41.1.x86_64.debug from
remote target...
Reading target:/usr/lib/debug/lib64//libc-2.31.so-2.31-150300.41.1.x86_64.debug
from remote target...
hello
[Inferior 1 (process 28720) exited normally]
$ 
...

The two sessions are fairly similar.

The 'warning: File transfers from remote targets can be slow. Use "set sysroot"
to access files locally instead' only occurs in the first session.

Also not sure why in both cases we're claiming to load a.out twice (more clear
in the second session, in the first session the warning is inbetween):
...
Reading /home/vries/a.out from remote target...
Reading /home/vries/a.out from remote target...
...

Anyway, if we remove the file command, we have instead:
...
$ gdb -q -batch \
  -ex "target remote | gdbserver - ~/a.out" \
  -ex continue \
  -ex "target remote | gdbserver - ~/a.out" \
  -ex continue
stdin/stdout redirected
Process /home/vries/a.out created; pid = 27584
Remote debugging using stdio
Reading /home/vries/a.out from remote target...
warning: File transfers from remote targets can be slow. Use "set sysroot" to
access files locally instead.
Reading /home/vries/a.out from remote target...
Reading symbols from target:/home/vries/a.out...
Reading /lib64/ld-linux-x86-64.so.2 from remote target...
Reading /lib64/ld-linux-x86-64.so.2 from remote target...
Reading
/usr/lib/debug/.build-id/5c/abd6dddf6c61859687ee6a3c3273fe4c01c68b.debug from
remote target...
Reading /lib64/ld-2.31.so-2.31-150300.41.1.x86_64.debug from remote target...
Reading /lib64/.debug/ld-2.31.so-2.31-150300.41.1.x86_64.debug from remote
target...
Reading /usr/lib/debug//lib64/ld-2.31.so-2.31-150300.41.1.x86_64.debug from
remote target...
Reading /usr/lib/debug/lib64//ld-2.31.so-2.31-150300.41.1.x86_64.debug from
remote target...
Reading target:/usr/lib/debug/lib64//ld-2.31.so-2.31-150300.41.1.x86_64.debug
from remote target...
Reading
/usr/lib/debug/.build-id/26/7a3e00bc5c234ec8c0c4c68ca478a2844e3338.debug from
remote target...
0x00007ffff7dd4550 in _start () from target:/lib64/ld-linux-x86-64.so.2
Reading /lib64/libc.so.6 from remote target...
Reading
/usr/lib/debug/.build-id/c8/417d767baccfadb39b474e484d46947915cd8f.debug from
remote target...
Reading /lib64/libc-2.31.so-2.31-150300.41.1.x86_64.debug from remote target...
Reading /lib64/.debug/libc-2.31.so-2.31-150300.41.1.x86_64.debug from remote
target...
Reading /usr/lib/debug//lib64/libc-2.31.so-2.31-150300.41.1.x86_64.debug from
remote target...
Reading /usr/lib/debug/lib64//libc-2.31.so-2.31-150300.41.1.x86_64.debug from
remote target...
Reading target:/usr/lib/debug/lib64//libc-2.31.so-2.31-150300.41.1.x86_64.debug
from remote target...
hello
[Inferior 1 (process 27584) exited normally]
`target:/home/vries/a.out' has disappeared; keeping its symbols.
stdin/stdout redirected
Process /home/vries/a.out created; pid = 27588
Remote debugging using stdio
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
Reading
/usr/lib/debug/.build-id/26/7a3e00bc5c234ec8c0c4c68ca478a2844e3338.debug from
remote target...
0x00007ffff7dd4550 in ?? ()
Reading /lib64/libc.so.6 from remote target...
Reading /lib64/ld-linux-x86-64.so.2 from remote target...
Reading
/usr/lib/debug/.build-id/c8/417d767baccfadb39b474e484d46947915cd8f.debug from
remote target...
Reading /lib64/libc-2.31.so-2.31-150300.41.1.x86_64.debug from remote target...
Reading /lib64/.debug/libc-2.31.so-2.31-150300.41.1.x86_64.debug from remote
target...
Reading /usr/lib/debug//lib64/libc-2.31.so-2.31-150300.41.1.x86_64.debug from
remote target...
Reading /usr/lib/debug/lib64//libc-2.31.so-2.31-150300.41.1.x86_64.debug from
remote target...
Reading target:/usr/lib/debug/lib64//libc-2.31.so-2.31-150300.41.1.x86_64.debug
from remote target...
Reading
/usr/lib/debug/.build-id/5c/abd6dddf6c61859687ee6a3c3273fe4c01c68b.debug from
remote target...
Reading /lib64/ld-2.31.so-2.31-150300.41.1.x86_64.debug from remote target...
Reading /lib64/.debug/ld-2.31.so-2.31-150300.41.1.x86_64.debug from remote
target...
Reading /usr/lib/debug//lib64/ld-2.31.so-2.31-150300.41.1.x86_64.debug from
remote target...
Reading /usr/lib/debug/lib64//ld-2.31.so-2.31-150300.41.1.x86_64.debug from
remote target...
Reading target:/usr/lib/debug/lib64//ld-2.31.so-2.31-150300.41.1.x86_64.debug
from remote target...
hello
[Inferior 1 (process 27588) exited normally]
...

Now we have:
...
`target:/home/vries/a.out' has disappeared; keeping its symbols.
...
and then we run into trouble:
...
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
Reading
/usr/lib/debug/.build-id/26/7a3e00bc5c234ec8c0c4c68ca478a2844e3338.debug from
remote target...
0x00007ffff7dd4550 in ?? ()
...
in other words, gdb doesn't realize that we're stopped at _start.

I'd expect the first and second session to look roughly the same again.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-10-20  8:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-05  9:19 [Bug server/29652] New: [gdbserver] Keeping symbols between two gdbserver sessions breaks second session vries at gcc dot gnu.org
2022-10-05  9:25 ` [Bug server/29652] " vries at gcc dot gnu.org
2022-10-05  9:51 ` vries at gcc dot gnu.org
2022-10-05 10:04 ` vries at gcc dot gnu.org
2022-10-05 10:40 ` vries at gcc dot gnu.org
2022-10-05 10:43 ` vries at gcc dot gnu.org
2022-10-05 12:54 ` vries at gcc dot gnu.org
2022-10-05 12:54 ` vries at gcc dot gnu.org
2022-10-05 12:58 ` vries at gcc dot gnu.org
2022-10-05 15:43 ` vries at gcc dot gnu.org
2022-10-12 15:42 ` vries at gcc dot gnu.org
2022-10-20  8:42 ` vries at gcc dot gnu.org
2022-10-20  8:44 ` vries at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).