This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]