From: "Christian Biesinger via gdb-patches" <gdb-patches@sourceware.org>
To: Simon Marchi <simark@simark.ca>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Make symbol_set_names a member function
Date: Fri, 27 Dec 2019 01:09:00 -0000 [thread overview]
Message-ID: <CAPTJ0XFf=_sGgkuyqM52w3ma0ZwG+nswGy7x34_qwKepBUA-rQ@mail.gmail.com> (raw)
In-Reply-To: <c1493903-5221-c7d0-843b-e840c2f81b10@simark.ca>
On Thu, Dec 26, 2019 at 6:50 PM Simon Marchi <simark@simark.ca> wrote:
>
> 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"
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
next prev parent reply other threads:[~2019-12-27 1:09 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
2019-12-27 1:09 ` Christian Biesinger via gdb-patches [this message]
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='CAPTJ0XFf=_sGgkuyqM52w3ma0ZwG+nswGy7x34_qwKepBUA-rQ@mail.gmail.com' \
--to=gdb-patches@sourceware.org \
--cc=cbiesinger@google.com \
--cc=simark@simark.ca \
/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