From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C60623858D37; Wed, 5 Oct 2022 09:19:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C60623858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664961597; bh=2/h95fmfVEIRW/7X3l7Efj/uho/yHFt2dVMxJL+cojs=; h=From:To:Subject:Date:From; b=GP4PhYfMzXBl/MKaYAuPit1RZ5pJmrMZtb9TJMHUuV6b1dn9IZfSBjhm4OcYHAaGD YE20BdWcwMDTowvE5K1RMqDdMC4wvNOpnApeqJZNP+/jjuXpK9Nst7RQYwkSOo2W0i YrdguzXH+Qgbo9gSdpUwaW9SBCiRHMdoHLtTdFug= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug server/29652] New: [gdbserver] Keeping symbols between two gdbserver sessions breaks second session Date: Wed, 05 Oct 2022 09:19:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: server X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29652 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 =3D 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 fr= om 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.deb= ug from remote target... Reading /usr/lib/debug/.build-id/26/7a3e00bc5c234ec8c0c4c68ca478a2844e3338.debug fr= om 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 fr= om remote target... Reading /lib64/libc-2.31.so-2.31-150300.41.1.x86_64.debug from remote targe= t... 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 fr= om remote target... Reading /usr/lib/debug/lib64//libc-2.31.so-2.31-150300.41.1.x86_64.debug fr= om remote target... Reading target:/usr/lib/debug/lib64//libc-2.31.so-2.31-150300.41.1.x86_64.d= ebug from remote target... hello [Inferior 1 (process 28666) exited normally] stdin/stdout redirected Process /home/vries/a.out created; pid =3D 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 fr= om 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.deb= ug from remote target... Reading /usr/lib/debug/.build-id/26/7a3e00bc5c234ec8c0c4c68ca478a2844e3338.debug fr= om 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 fr= om remote target... Reading /lib64/libc-2.31.so-2.31-150300.41.1.x86_64.debug from remote targe= t... 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 fr= om remote target... Reading /usr/lib/debug/lib64//libc-2.31.so-2.31-150300.41.1.x86_64.debug fr= om remote target... Reading target:/usr/lib/debug/lib64//libc-2.31.so-2.31-150300.41.1.x86_64.d= ebug from remote target... hello [Inferior 1 (process 28720) exited normally] $=20 ... The two sessions are fairly similar. The 'warning: File transfers from remote targets can be slow. Use "set sysr= oot" 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 cl= ear 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 =3D 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 fr= om 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.deb= ug from remote target... Reading /usr/lib/debug/.build-id/26/7a3e00bc5c234ec8c0c4c68ca478a2844e3338.debug fr= om 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 fr= om remote target... Reading /lib64/libc-2.31.so-2.31-150300.41.1.x86_64.debug from remote targe= t... 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 fr= om remote target... Reading /usr/lib/debug/lib64//libc-2.31.so-2.31-150300.41.1.x86_64.debug fr= om remote target... Reading target:/usr/lib/debug/lib64//libc-2.31.so-2.31-150300.41.1.x86_64.d= ebug 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 =3D 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 fr= om 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 fr= om remote target... Reading /lib64/libc-2.31.so-2.31-150300.41.1.x86_64.debug from remote targe= t... 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 fr= om remote target... Reading /usr/lib/debug/lib64//libc-2.31.so-2.31-150300.41.1.x86_64.debug fr= om remote target... Reading target:/usr/lib/debug/lib64//libc-2.31.so-2.31-150300.41.1.x86_64.d= ebug from remote target... Reading /usr/lib/debug/.build-id/5c/abd6dddf6c61859687ee6a3c3273fe4c01c68b.debug fr= om 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.deb= ug 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 fr= om 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. --=20 You are receiving this mail because: You are on the CC list for the bug.=