From: Daniel Jacobowitz <drow@false.org>
To: Michael Eager <eager@eagercon.com>
Cc: Keith Seitz <keiths@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [RFA] dwarf2_physname
Date: Tue, 01 Sep 2009 23:37:00 -0000 [thread overview]
Message-ID: <20090901233733.GA32355@caradoc.them.org> (raw)
In-Reply-To: <4A9DABA4.3010402@eagercon.com>
On Tue, Sep 01, 2009 at 04:17:56PM -0700, Michael Eager wrote:
> I think that this is a problem with how the template instantiation is
> described.
For your example DWARF:
> I think that there should be something like
> DW_TAG_template_value_parameter
> DW_AT_name : Foo
> DW_AT_type : <int *>
> as a child of of f<Foo>.
I believe DW_AT_name would be S here and not Foo - the name by which
the argument is known inside the instantiation. It's representing Foo
that's a problem; it has to go in the DW_AT_const_value attribute.
Here's a trickier example:
template<const char *S> int f()
{
return S[0];
}
template <int I> struct S {};
template<int I, const char *STR> int g(S<I + 1 + sizeof(STR)>*)
{
return 0;
}
char Foo[3];
char Bar[3];
int main()
{
return f<Foo>() + f<Bar>() + g<5, Foo>(0);
}
0000000000000000 W _Z1gILi5EXadL_Z3FooEEEiP1SIXplplT_Li1EszT0_EE
0000000000000000 W int g<5, &Foo>(S<((5)+(1))+(sizeof (&Foo))>*)
A patch that can't handle this may still be an improvement - but I'd
like to know how we're approaching this problem, and whether (A) the
lack of compilers generating adequate data, and (B) to the best of my
knowledge, the lack of DWARF constructs for such expressions, is
going to interfere with debugging of heavily templated programs.
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2009-09-01 23:37 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-31 22:51 Keith Seitz
2009-08-31 23:10 ` Michael Eager
2009-08-31 23:23 ` Keith Seitz
2009-08-31 23:35 ` Michael Eager
2009-09-01 22:11 ` Daniel Jacobowitz
2009-09-01 22:27 ` Daniel Jacobowitz
2009-09-01 23:18 ` Michael Eager
2009-09-01 23:37 ` Daniel Jacobowitz [this message]
2009-09-02 1:12 ` Michael Eager
2009-09-01 23:26 ` Keith Seitz
2009-09-01 23:42 ` Daniel Jacobowitz
2009-09-14 18:39 ` Keith Seitz
2009-09-14 22:48 ` Daniel Jacobowitz
2009-09-14 23:56 ` Keith Seitz
2009-09-15 13:32 ` Daniel Jacobowitz
2009-09-15 15:53 ` Keith Seitz
2009-09-15 16:12 ` Daniel Jacobowitz
2009-09-16 20:27 ` Keith Seitz
2009-09-18 22:34 ` Tom Tromey
[not found] ` <m37hwjy2tl.fsf@fleche.redhat.com>
2009-09-01 0:06 ` Michael Eager
2009-09-01 21:27 ` Tom Tromey
2009-09-01 22:10 ` Keith Seitz
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=20090901233733.GA32355@caradoc.them.org \
--to=drow@false.org \
--cc=eager@eagercon.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