From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 37650 invoked by alias); 27 Dec 2019 01:09:49 -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 37636 invoked by uid 89); 27 Dec 2019 01:09:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.1 required=5.0 tests=AWL,BAYES_00,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham version=3.3.1 spammy=H*RU:209.85.210.67, HX-Spam-Relays-External:209.85.210.67, HX-HELO:sk:mail-ot X-HELO: mail-ot1-f67.google.com Received: from mail-ot1-f67.google.com (HELO mail-ot1-f67.google.com) (209.85.210.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 27 Dec 2019 01:09:47 +0000 Received: by mail-ot1-f67.google.com with SMTP id r27so34326418otc.8 for ; Thu, 26 Dec 2019 17:09:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JMr9W/q5rNXQa3MttLBuo6eCKoLIh7hOW1i4AyOpOuk=; b=Ywu7IPfdskCI1YG2AlxXaelV1Q+WOLM+7k4RqCohJbKC90rKOlDxMlyNpwKM/gdgsp 3VUSCBYGbQF6yffO1T97bIQ1BAWuUZ6s2W4egsmRFSgA2lch1i+jXA7Izze5cNXHw3cy xk8fa47X5RhIK2G3XfxZ8gt4M5qkzl6wNP0dsHy6KRL4+c1lYNTEoofh0jZPxFDaEULz KjKTJEPXhPKapGNZG2oQzIOybhDvZvc/zOoExP7cizfoNgVZQt65beX6w/R4VuyQW7n0 5TDel2KzFbnNAQCP3/2gofhuB8xfHTnWBv6b4Oggrrpik1vSbQTXS1Whh6BoYAQKJDmW /YbA== MIME-Version: 1.0 References: <20191226075201.239053-1-cbiesinger@chromium.org> In-Reply-To: From: "Christian Biesinger via gdb-patches" Reply-To: Christian Biesinger Date: Fri, 27 Dec 2019 01:09:00 -0000 Message-ID: Subject: Re: [PATCH] Make symbol_set_names a member function To: Simon Marchi Cc: gdb-patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-12/txt/msg01030.txt.bz2 On Thu, Dec 26, 2019 at 6:50 PM Simon Marchi wrote: > > 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" Thanks, fixed locally. > > 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 removed the TODO locally. OK to push with withose two changes? > 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? Huh.. I added a printf in compute_and_set_names and found that there's a symbol with the mangled name *and* a symbol with the plain name. I guess that's why? But I don't know what that means... Christian