Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: Doug Evans <dje@google.com>, gdb-patches@sourceware.org
Subject: Re: [RFA] fix disassemble foo::bar::~bar
Date: Thu, 21 Feb 2013 23:58:00 -0000	[thread overview]
Message-ID: <5126B48A.1080903@redhat.com> (raw)
In-Reply-To: <87sj4p9xp9.fsf@fleche.redhat.com>

On 02/21/2013 01:14 PM, Tom Tromey wrote:
> I wonder what would happen if we just removed destructor_name_p,
> or alternatively made it work by examining the type's function fields,
> looking for a match.

You jogged my memory...

Another option is to use the c++ name parser:

diff --git a/gdb/valops.c b/gdb/valops.c
index 93c09d8..b006b49 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -3160,7 +3160,7 @@ destructor_name_p (const char *name, struct type 
*type)
  {
    if (name[0] == '~')
      {
-      const char *dname = type_name_no_tag_or_error (type);
+      const char *dname = cp_func_name (type_name_no_tag_or_error (type));
        const char *cp = strchr (dname, '<');
        unsigned int len;

The above patch fixes Doug's test cases and also is regression-free on 
native x86_64-unknown-linux (Fedora 15).

[I note that "print foo::bar::~bar" also didn't work for the same reason.]

Keith


  reply	other threads:[~2013-02-21 23:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-14  0:14 Doug Evans
2013-02-21 21:14 ` Tom Tromey
2013-02-21 23:58   ` Keith Seitz [this message]
2013-02-22 19:15     ` Tom Tromey
2013-02-22 19:43       ` Keith Seitz
2013-02-22 20:00         ` Tom Tromey

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=5126B48A.1080903@redhat.com \
    --to=keiths@redhat.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /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