From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13084 invoked by alias); 21 Feb 2013 23:58:15 -0000 Received: (qmail 13068 invoked by uid 22791); 21 Feb 2013 23:58:13 -0000 X-SWARE-Spam-Status: No, hits=-7.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 21 Feb 2013 23:58:05 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r1LNw4af025973 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 21 Feb 2013 18:58:04 -0500 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r1LNw2nC017392 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 21 Feb 2013 18:58:03 -0500 Message-ID: <5126B48A.1080903@redhat.com> Date: Thu, 21 Feb 2013 23:58:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 MIME-Version: 1.0 To: Tom Tromey CC: Doug Evans , gdb-patches@sourceware.org Subject: Re: [RFA] fix disassemble foo::bar::~bar References: <87sj4p9xp9.fsf@fleche.redhat.com> In-Reply-To: <87sj4p9xp9.fsf@fleche.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2013-02/txt/msg00577.txt.bz2 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