This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- From: Michael Matz <matz at suse dot de>
- To: Daniel Jacobowitz <drow at false dot org>
- Cc: Richard Guenther <rguenther at suse dot de>, Jason Merrill <jason at redhat dot com>, Gabriel Dos Reis <gdr at cs dot tamu dot edu>, Nathan Sidwell <nathan at codesourcery dot com>, Mark Mitchell <mark at codesourcery dot com>, Richard Guenther <richard dot guenther at gmail dot com>, gcc-patches at gcc dot gnu dot org, mrs at apple dot com, Paolo Carlini <pcarlini at suse dot de>
- Date: Wed, 13 Dec 2006 16:16:53 +0100 (CET)
- Subject: Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- References: <Pine.GSO.4.58.0612110926270.19022@sun> <Pine.LNX.4.64.0612111635030.3105@zhemvz.fhfr.qr> <457D7AB1.10706@redhat.com> <Pine.LNX.4.64.0612111647520.3105@zhemvz.fhfr.qr> <20061211155733.GA2660@nevyn.them.org> <Pine.LNX.4.64.0612111658590.29962@wotan.suse.de> <20061211174548.GA7094@nevyn.them.org> <Pine.LNX.4.64.0612121519200.29962@wotan.suse.de> <20061212150652.GA18750@nevyn.them.org> <Pine.LNX.4.64.0612121723070.29962@wotan.suse.de> <20061212180739.GA26146@nevyn.them.org>
Hi,
On Tue, 12 Dec 2006, Daniel Jacobowitz wrote:
> I agree with most of it, see below. However, there's one caveat that
> occurred to me while writing it. We don't get to change the demangled
> names of member functions. GDB - and the user - may get quite confused
> if you have "class A<x>" and method "A<x,std::basic_string<...>>::bar(int)".
*scratch head* Hmm, indeed.
> I'm sure we can make it work somehow. But the GDB surgery involved
> would be immense.
Perhaps with the connection from the 'this' argument (the type of that one
would be the nice form) can create the connection between those two. Only
works for member not static methods, though.
> > For starters I wouldn't output default args. I.e. given these decls:
>
> Sounds quite sensible to me, for the current DW_AT_name. For
> DW_TAG_template_type_parameter, there's no currently defined way to
> represent this, but one seems obvious: DW_AT_artificial.
>
> It's still desirable to represent them, so that in the debugger one
> can say "ptype T" in the scope of the class and get the type of the
> default parameter.
Yes, that would be nice.
> > That is just kafkaesque. I would accept "B<int>" or "B" (I would prefer
> > for the debugger to give me both possibilities). I wouldn't like to have
> > to store the above abomination into debug infos as I can foresee no
> > sensible use for that which justifies the space bloat (in object files
> > _and_ debugger runtime memory use).
>
> I think my example above is a sensible use.
Yes, but you also have already changed the representation of those types
(introducing the DW_TAG_template_type_parameter). I don't want to store
the abominations (I mean the big flat strings) into debug info, because
there's no sensible use for them. Your use is sensible, but it can't be
done anyway with that flat string. In a scope of a class you can't
currently do "ptype T" with T being a template parameter name, there
simply is no info for that.
> Besides, if you store it as DIEs, most of the items in your example can
> be shared - so the size of the debug info would actually be considerably
> less than the pretty-printed version.
True, if most of it really will be shared as in the internal gcc tree
representation that will be nicely reduced then.
> > Further, I would stop at typedefs.
>
> I'd love this. Please. Please. Same for the DIE format we eventually
> want; it should point to the DW_TAG_typedef.
Yep.
Ciao,
Michael.
- References:
- Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory