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


Daniel Jacobowitz wrote:

> ARM RVCT on the other hand only produces the short names but lists
> template parameters:
> 
>  <1><5e>: Abbrev Number: 5 (DW_TAG_class_type)
>      DW_AT_sibling     : <a6>
>      DW_AT_name        : X
>      DW_AT_byte_size   : 4
>  <2><64>: Abbrev Number: 130 (DW_TAG_template_type_param)
>      DW_AT_type        : DW_FORM_ref1 <9e>
>  <2><9e>: Abbrev Number: 4 (DW_TAG_base_type)
>      DW_AT_byte_size   : 4
>      DW_AT_encoding    : 5      (signed)
>      DW_AT_name        : int

Personally, I think this is the best debug information -- and certainly
cheapest to produce.  It makes more work for the debugger (formatting
the template parameters), but seems like a more sensible representation
to me.

Well-written 3rd-party debuggers will, at worst, ignore the template
information and print the basic name of the type.  That's a regression
for their users -- but, hey, people should use GDB. :-)  I think having
3rd-party debuggers displaying mangled names would be Just Wrong, but, I
don't think the template name without parameters is wrong -- it's just
incomplete.

> I guess we could switch from the first form to the second form, if
> someone added GDB support for DW_TAG_template_type_param and
> DW_TAG_template_value_param.  GDB could handle both cases, because
> a valid DW_AT_name in C++ would never have '<' in it if there
> were explicit params.  What do you think?

Yes, that's correct.

> Anyway, if that's more than you want to bite off right now, I think
> we need to hold on to what we have now.

Indeed.  People might also want to wait until GDB with support for the
more compact format has been out for a while before we switch the
compiler, though, personally, I'd be OK with switching the compiler as
soon as CVS GDB had support for the compact format.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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