From: Pedro Alves <palves@redhat.com>
To: Keith Seitz <keiths@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] Report call site for inlined functions
Date: Fri, 27 Oct 2017 12:49:00 -0000 [thread overview]
Message-ID: <50be1b3b-00d1-6753-3245-ad17327176c2@redhat.com> (raw)
In-Reply-To: <d047af4b-82cd-db80-0f0c-efce4a2831a2@redhat.com>
On 10/20/2017 07:46 PM, Keith Seitz wrote:
> [My reply seems not to have made it to sourceware, so I'm resending.]
>
> On 07/18/2017 12:05 PM, Pedro Alves wrote:
>> On 07/11/2017 03:36 AM, Keith Seitz wrote:
>>>
>>> Here you can see the new call-site-func, call-site-file, call-site-fullname,
>>> and call-site-line.
>>
>> The non-inlined call site seems sufficient info to me, at least for
>> the CLI. I'm not sure whether "call-site" is sufficiently clear that
>> it's referring to that vs the immediate potential inlined-too
>> caller though. I think at least the docs need such a clarification.
>
> There seems to be consensus on the (lack of) utility of this call-site info, so in the next revision (to follow), I've chosen to remove it all. I think that pretty much resolves (by deletion!) most of your concerns/comments. I've also removed the inlined_symbol proposal since that is also no longer necessary.
I think my observations in
<https://sourceware.org/ml/gdb-patches/2017-03/msg00382.html>
still make sense, and I don't know about consensus, but OK, let's
move on. I'll take a look at the new version.
>
>>> diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
>>> index 0fdcd42..3b3193b 100644
>>> --- a/gdb/dwarf2read.c
>>> +++ b/gdb/dwarf2read.c
>>> @@ -11540,13 +11571,28 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
>>> {
>>> templ_func = allocate_template_symbol (objfile);
>>> templ_func->base.is_cplus_template_function = 1;
>>> + symbol_storage = (struct symbol *) templ_func;
>>> break;
>>> }
>>> }
>>>
>>> + /* If we have an inlined symbol, we must also allocate a different
>>> + symbol. */
>>
>> How does this work when you have an (inlined) template function?
>> Like e.g.,:
>>
>> template<typename T>
>> static T inline_func (T val)
>> {
>> return val * 2;
>> }
>>
>> int
>> not_inline_func (int val)
>> {
>> return inline_func (val * 2);
>> }
>>
>
> I realize this was asked in relation to the proposed (and now deleted) inline_symbol, but to be clear, the above example works:
>
> (gdb) b inline_func<int>
> Breakpoint 1 at 0x4004c0: file inline-t.cc, line 9.
> (gdb) i b
> Num Type Disp Enb Address What
> 1 breakpoint keep y 0x00000000004004c0 in inline_func<int>
> at inline-t.cc:9
OK, it seems like a DIE can't be both DW_TAG_inlined_subroutine
and a template (kind of makes sense), so you couldn't ever end up
calling both allocate_template_symbol and allocate_inlined_symbol
for the same symbol (which is what I was worrying about, because
the code didn't consider/guard against that).
Thanks,
Pedro Alves
prev parent reply other threads:[~2017-10-27 12:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-11 2:36 Keith Seitz
2017-07-11 2:36 ` [PATCH 2/2] Report stop locations in " Keith Seitz
2017-07-18 17:16 ` Pedro Alves
2017-07-18 17:46 ` Pedro Alves
2017-10-20 19:21 ` Keith Seitz
2017-10-27 12:37 ` Pedro Alves
2017-10-30 21:18 ` Keith Seitz
2017-12-01 19:50 ` Pedro Alves
2017-10-20 19:02 ` Keith Seitz
2017-07-11 14:25 ` [PATCH 1/2] Report call site for " Eli Zaretskii
2017-07-17 19:23 ` Jan Kratochvil
2017-07-18 19:05 ` Pedro Alves
2017-10-20 18:46 ` Keith Seitz
2017-10-27 12:49 ` Pedro Alves [this message]
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=50be1b3b-00d1-6753-3245-ad17327176c2@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=keiths@redhat.com \
/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