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: Daniel Jacobowitz <drow at false dot org>
- To: Richard Guenther <richard dot guenther at gmail dot com>
- Cc: Michael Matz <matz at suse dot de>, 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>, gcc-patches at gcc dot gnu dot org, mrs at apple dot com, Paolo Carlini <pcarlini at suse dot de>
- Date: Mon, 11 Dec 2006 15:58:23 -0500
- Subject: Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- References: <457D726E.7060905@redhat.com> <Pine.LNX.4.64.0612111628100.3105@zhemvz.fhfr.qr> <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> <84fc9c000612111229n5aae6c43g19309d5419f7a7ea@mail.gmail.com>
On Mon, Dec 11, 2006 at 09:29:05PM +0100, Richard Guenther wrote:
> You are aware that, in it's current form for the testcase in PR29433 the
> largest such string is 2MB in size? Also the specification
> "whose value is a string representing the name as it appears in the
> source program" is not exactly clear to me. Would gdb prefer
> "std::string" or "string" or "std::basic_string" or even
> "basic_string<char,std::char_traits<char>,std::allocator<char> >"
> (which is what we currently have).
>
> I believe that gdb could be more friendly in printing templated types
> if they are presented in a better to machine-analyze manner, like in
> mangled form rather than "arbitraryly" choosing one of the above.
If you want, you could take this opportunity to output template
information correctly :-) But it might not help... The DWARF
specification is somewhat ambiguous about what ought to go in the name.
GCC doesn't output explicit information for template type parameters.
ICC does, but uses the same long names that GCC does anyway (probably
for compatibility).
<1><a6>: Abbrev Number: 3 (DW_TAG_class_type)
DW_AT_decl_line : 1
DW_AT_decl_column : 26
DW_AT_decl_file : 1
DW_AT_accessibility: 1 (public)
DW_AT_byte_size : 4
DW_AT_name : X<int>
<2><c1>: Abbrev Number: 5 (DW_TAG_template_type_param)
DW_AT_decl_line : 1
DW_AT_decl_column : 17
DW_AT_decl_file : 1
DW_AT_name : T
DW_AT_type : <cc>
<1><cc>: Abbrev Number: 6 (DW_TAG_base_type)
DW_AT_byte_size : 4
DW_AT_encoding : 5 (signed)
DW_AT_name : int
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
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?
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.
As for "string", that's a typedef; it should show up in the debug info
separately.
> where DW_AT_name is a very simplified form of DW_AT_MIPS_linkage_name.
Correct. I have been working on pruning GDB's dependence on
DW_AT_MIPS_linkage_name; in the future, it would be nice to drop it
from our output. But I haven't had time to go back to that project
this year. I may in 2007, though, since it just came up again for
another project.
> The question is where gdb uses the DW_AT_name in DW_TAG_structure_type
> specifiers - I couldn't find an entry in the gdb testsuite that looks
> at it.
I may have missed this, but if you haven't, maybe try just outputing a
bare identifier, running gdb.cp/*.exp before and after, and diffing
gdb.log? I would even expect failures.
--
Daniel Jacobowitz
CodeSourcery
- 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