Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: cbiesinger@chromium.org, gdb-patches@sourceware.org
Cc: Christian Biesinger <cbiesinger@google.com>
Subject: Re: [PATCH] Make symbol_set_names a member function
Date: Thu, 26 Dec 2019 17:50:00 -0000	[thread overview]
Message-ID: <c1493903-5221-c7d0-843b-e840c2f81b10@simark.ca> (raw)
In-Reply-To: <20191226075201.239053-1-cbiesinger@chromium.org>

On 2019-12-26 2:52 a.m., cbiesinger@chromium.org wrote:
> From: Christian Biesinger <cbiesinger@google.com>
> 
> 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


  reply	other threads:[~2019-12-26 17:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-26  7:52 cbiesinger
2019-12-26 17:50 ` Simon Marchi [this message]
2019-12-27  1:09   ` Christian Biesinger via gdb-patches
2019-12-27  3:02     ` Simon Marchi
2019-12-27  4:43       ` Christian Biesinger via gdb-patches
2020-01-06 19:26         ` Christian Biesinger via gdb-patches

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=c1493903-5221-c7d0-843b-e840c2f81b10@simark.ca \
    --to=simark@simark.ca \
    --cc=cbiesinger@chromium.org \
    --cc=cbiesinger@google.com \
    --cc=gdb-patches@sourceware.org \
    /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