From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 769A9387702B; Thu, 12 Mar 2020 16:37:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 769A9387702B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1584031061; bh=fgbBuhr00bLycRtZOnmOjxQtkZ1hNPcVSkyDTEUdHyE=; h=From:To:Subject:Date:From; b=fAZq8xB4B+hlqhKkSyp5b+ewda3l/osqQ5qR4n7OVX4IyqK3iGSE2wP7Lx5KVHbiG scgkfoeTSermBanmWgCDTojCcZzIHr0fV77UYy/dwBt4xWkE24NRdq9LB5TPGL53ZY 34Ne/a2mQOk6cSFe3YMeWI1z1i8+od56iGU4Agck= From: "vcollod at nvidia dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/25663] New: dwarf2_name caching bug Date: Thu, 12 Mar 2020 16:37:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: vcollod at nvidia dot com 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: 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 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: Thu, 12 Mar 2020 16:37:41 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D25663 Bug ID: 25663 Summary: dwarf2_name caching bug Product: gdb Version: HEAD Status: UNCONFIRMED Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: vcollod at nvidia dot com Target Milestone: --- Hello! While working on cuda-gdb, I noticed dwarf2_name does not behave as describ= ed. It's supposed to return the name of a dwarf DIE, as described by the follow= ing comment: /* Get name of a die, return NULL if not found. Anonymous namespaces are converted to their magic string. */ It does some processing, stores the results into a cache, then strips the C= ++ namespaces of the name. The last step should probably be done before storing the result into the cache. The following code sample should help reproduce the issue. I did not fix it myself as I am concerned some code relies on this odd behavior. cat > dwarf2_name_repro.gdb < dwarf2_name_repro.cc <