From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C824B3858290; Wed, 5 Oct 2022 09:51:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C824B3858290 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664963487; bh=p0YQtULW4kAC39i1wlO8Hh5dDdmAex8wEW18cXRq40Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=q/rhWJZ8F3iskMa6PuU+MxgpWCJw3ZEmWJMOShOv8JOeMR1hMFRwZL+pYCSAfEVik FL7f5t8L9DFME1no5AIp10+uJG6H0Pza5Rl3Aoiw+7ZL3x5Nel0hCHF8UK6MCeHSJ9 7hCDNysN5miFyh6fAZbS+eUn0vpneuRpZmhlhCxQ= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug server/29652] [gdbserver] Keeping symbols between two gdbserver sessions breaks second session Date: Wed, 05 Oct 2022 09:51:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: Message-ID: In-Reply-To: References: 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 --- Comment #2 from Tom de Vries --- This fixes it: ... diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index a6a9ec5c86b..ce3278f5e89 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -571,9 +571,11 @@ find_program_interpreter (void) int sect_size =3D bfd_section_size (interp_sect); gdb::byte_vector buf (sect_size); - bfd_get_section_contents (current_program_space->exec_bfd (), - interp_sect, buf.data (), 0, sect_size); - return buf; + bool res + =3D bfd_get_section_contents (current_program_space->exec_bfd (), + interp_sect, buf.data (), 0, sect_siz= e); + if (res) + return buf; } } ... It makes the function fall back to: ... /* If we didn't find it, use the target auxiliary vector. */ return read_program_header (PT_INTERP, NULL, NULL); ... which works for this case. But perhaps the root cause of the problem is that bfd_get_section_contents returns false in the first place, and we need "gdb_assert (res)" instead, a= nd fix the assert? --=20 You are receiving this mail because: You are on the CC list for the bug.=