From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114214 invoked by alias); 6 Jun 2016 14:15:09 -0000 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 Received: (qmail 114194 invoked by uid 89); 6 Jun 2016 14:15:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-pf0-f193.google.com Received: from mail-pf0-f193.google.com (HELO mail-pf0-f193.google.com) (209.85.192.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 06 Jun 2016 14:14:53 +0000 Received: by mail-pf0-f193.google.com with SMTP id 62so18150791pfd.3 for ; Mon, 06 Jun 2016 07:14:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=vNRbhvvKJR/jYM/Kr2PvGPxbWXEwj1BtUdCGni+yY+U=; b=Er8+lqqK+PfqkYAP44zSpDisoZZD2SuU30ImFNa8NBf2p1ttqoWBrTzbbfVmuYZ/QC y+Aa1LB1eSImhzHwRYdda1bDqkAkk/4XFEQHV61AELcIXB6Tpz8lLCIDnhiYVeKM913w ceenXbvghvu5AO84Xydav8BLOwLXs3NCiJTbp3kYTfWzFxqMUO1OAE6qRjOdS4LUxwS8 slS8iYmX6G4pFdsotpRMA2ncWjttJvG/+z54w9D8N8eNaxTtBRf9K71GN9lHBiJ2LO51 7m8uCEC46rPNuGeKsqLGu0ii4WFfxfTP3jPd5rTJpZx2RGZd3fuLu2/8/EIro9YsyNk/ 4AjA== X-Gm-Message-State: ALyK8tLbULNsZkYTxIDlzxfnpZCAtnXoLnS7n0SjgCaow2DHYBg+lP0/XOJnMtUdCXbHOw== X-Received: by 10.98.65.209 with SMTP id g78mr25447386pfd.163.1465222491490; Mon, 06 Jun 2016 07:14:51 -0700 (PDT) Received: from E107787-LIN (gcc113.osuosl.org. [140.211.9.71]) by smtp.gmail.com with ESMTPSA id et3sm25783992pad.48.2016.06.06.07.14.48 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 06 Jun 2016 07:14:50 -0700 (PDT) From: Yao Qi To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [RFA 3/3] Move logic out of symbol_find_demangled_name References: <1465051760-25840-1-git-send-email-tom@tromey.com> <1465051760-25840-4-git-send-email-tom@tromey.com> Date: Mon, 06 Jun 2016 14:15:00 -0000 In-Reply-To: <1465051760-25840-4-git-send-email-tom@tromey.com> (Tom Tromey's message of "Sat, 4 Jun 2016 08:49:20 -0600") Message-ID: <86mvmywgj1.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-06/txt/msg00095.txt.bz2 Tom Tromey writes: > I'm not especially fond of the new name, "la_demangle_for_symbol". > How about "la_sniff_by_symbol"? IMO, symbol_find_demangled_name does two things, set the language of symbol, and get the demangled name. It is quite similar to frame unwinder sniffer and frame unwinding. > --- a/gdb/language.h > +++ b/gdb/language.h > @@ -292,6 +292,19 @@ struct language_defn > /* Return demangled language symbol, or NULL. */ > char *(*la_demangle) (const char *mangled, int options); >=20=20 > + /* Demangle a symbol according to this language's rules. Unlike > + la_demangle, this does not take any options. The return value > + should either be NULL if the name cannot be demangled, or an > + xmalloc'd string, to be owned by the caller. > + > + If this function returns non-NULL, then it can be assumed that > + MANGLED represents a mangled symbol for this language. If this > + function returns NULL, then normally the converse is true, but > + RECOGNIZED can be set to 1 to override this. > +=20=20=20=20=20=20=20 > + RECOGNIZED must be initialized to 0 by the caller. */ > + char *(*la_demangle_for_symbol) (const char *mangled, int *recognize= d); Why don't we return int to indicate the name can be demangled or not and put the demangled name in the second parameter if it can be? --=20 Yao (=E9=BD=90=E5=B0=A7)