public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/25663] dwarf2_name caching bug
Date: Mon, 16 Mar 2020 21:03:42 +0000	[thread overview]
Message-ID: <bug-25663-4717-FhdF38Ylx2@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-25663-4717@http.sourceware.org/bugzilla/>

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

--- Comment #10 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=67430cd00afcc270a27e44b10f9ef4249d554e66

commit 67430cd00afcc270a27e44b10f9ef4249d554e66
Author: Tom Tromey <tromey@adacore.com>
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  <tromey@adacore.com>

            PR gdb/25663:
            * dwarf2/read.c (dwarf2_name): Strip leading namespaces after
            putting value into bcache.

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

  parent reply	other threads:[~2020-03-16 21:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-12 16:37 [Bug gdb/25663] New: " vcollod at nvidia dot com
2020-03-12 16:38 ` [Bug gdb/25663] " vcollod at nvidia dot com
2020-03-12 20:22 ` tromey at sourceware dot org
2020-03-12 20:25 ` tromey at sourceware dot org
2020-03-12 20:27 ` tromey at sourceware dot org
2020-03-12 20:28 ` vcollod at nvidia dot com
2020-03-12 20:50 ` tromey at sourceware dot org
2020-03-12 20:55 ` tromey at sourceware dot org
2020-03-12 21:01 ` vcollod at nvidia dot com
2020-03-12 21:21 ` tromey at sourceware dot org
2020-03-13 15:20 ` tromey at sourceware dot org
2020-03-16 21:03 ` cvs-commit at gcc dot gnu.org [this message]
2024-01-05 12:50 ` ssbssa at sourceware dot org
2024-01-10 18:38 ` tromey at sourceware dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-25663-4717-FhdF38Ylx2@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).