From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56403 invoked by alias); 26 Dec 2019 17:50:58 -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 56392 invoked by uid 89); 26 Dec 2019 17:50:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 26 Dec 2019 17:50:57 +0000 Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 8DC1B1E10B; Thu, 26 Dec 2019 12:50:55 -0500 (EST) Subject: Re: [PATCH] Make symbol_set_names a member function To: cbiesinger@chromium.org, gdb-patches@sourceware.org Cc: Christian Biesinger References: <20191226075201.239053-1-cbiesinger@chromium.org> From: Simon Marchi Message-ID: Date: Thu, 26 Dec 2019 17:50:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: <20191226075201.239053-1-cbiesinger@chromium.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-12/txt/msg01021.txt.bz2 On 2019-12-26 2:52 a.m., cbiesinger@chromium.org wrote: > From: Christian Biesinger > > This also renames it to make it clearer that this is not a cheap > functin (to compute_and_set_names). Also renames name to m_name "functin" > to make the implementation of the renamed function more readable. > > Most of the places that access sym->m_name directly were also changed > to call linkage_name () instead, to make it clearer which name they > are accessing. I think that all makes sense. > @@ -2110,7 +2109,8 @@ maintenance_check_psymtabs (const char *ignore, int from_tty) > if (!sym) > { > printf_filtered ("Static symbol `"); > - puts_filtered ((*psym)->ginfo.name); > + /* TODO: Should this be print_name ()? */ > + puts_filtered ((*psym)->ginfo.linkage_name ()); > printf_filtered ("' only found in "); > puts_filtered (ps->filename); > printf_filtered (" psymtab\n"); > @@ -2128,7 +2128,8 @@ maintenance_check_psymtabs (const char *ignore, int from_tty) > if (!sym) > { > printf_filtered ("Global symbol `"); > - puts_filtered ((*psym)->ginfo.name); > + /* TODO: Should this be print_name ()? */ > + puts_filtered ((*psym)->ginfo.linkage_name ()); > printf_filtered ("' only found in "); > puts_filtered (ps->filename); > printf_filtered (" psymtab\n"); For this patch, I wouldn't change the behavior (which means using linkage_name), but we could consider a separate patch to change it. I hacked the code to always enter these ifs and print both the linkage_name and the natural_name. With a C++ test program containing this function: int hello(int); I get: linkage_name: hello natural_name: hello I would have expected linkage_name to be _Z5helloi and the natural_name to be hello(int). Do you know if it's expected for the partial symbol to contain just "hello" for both? Simon