https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94845

--- Comment #8 from Tom Tromey <tromey at gcc dot gnu.org> ---
(In reply to rob...@ocallahan.org from comment #7)
> So gdb reads DW_AT_name "func<short int>", parses it, reserializes it to
> "func<short>", and uses that?

Yeah.  (Actually it's even worse than that, because at least one
compiler doesn't emit the template parameters in the name, so
in that case gdb will read the children of the DIE to try to
construct this form.)

I think the reasoning behind the canonicalization is two-fold.
First, I think we tried to get g++ changed, back in the day,
without success.

Second, gdb has to canonicalize user input anyway, so that
things like "print func<short int>(3)" or "break func<short int>"
work.  And once you have a canonicalizer it is simpler to just
use it to work around the problem.

Reply via email to