From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 23511381DCE3; Mon, 16 Mar 2020 21:03:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 23511381DCE3 From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/25663] dwarf2_name caching bug Date: Mon, 16 Mar 2020 21:03:42 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Mar 2020 21:03:42 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D25663 --- Comment #10 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Tom Tromey : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D67430cd00afc= c270a27e44b10f9ef4249d554e66 commit 67430cd00afcc270a27e44b10f9ef4249d554e66 Author: Tom Tromey Date: Mon Mar 16 15:00:52 2020 -0600 Fix dwarf2_name caching bug PR gdb/25663 points out that dwarf2_name will cache a value in the bcache and then return a substring. However, this substring return is only done on the branch that caches the value -- so if the function is called twice with the same arguments, it will return different values. This patch fixes this problem. This area is strange. We cache the entire demangled string, but only return the suffix. I looked at caching just the suffix, but it turns out that anonymous_struct_prefix assumes that the entire string is stored. Also weird is that this code is demangling the linkage name and then storing the demangled form back into the linkage name attribute -- that seems bad, because what if some code wants to find the actual linkage name? Fixing these issues was non-trivial, though; and in the meantime this patch seems like an improvement. Regression tested on x86-64 Fedora 30. gdb/ChangeLog 2020-03-16 Tom Tromey PR gdb/25663: * dwarf2/read.c (dwarf2_name): Strip leading namespaces after putting value into bcache. --=20 You are receiving this mail because: You are on the CC list for the bug.=