[Converted from Gnats 40] gdb thinks template functions have a return type in their name. This makes it difficult to type the name. With g++ 2.95.2: (gdb) where #0 int add_two_values<int> (v1=1, v2=10) #1 0x080483de in main () at x3.cc:17 With g++ 3pre: #0 int add_two_values<int>(int, int) (v1=1, v2=10) #1 0x08048452 in main () at x3.cc:17 Release: cvs 2001-03-09 Environment: Red Hat Linux 7 native g++ 2.95.2 g++ cvs gcc-3_0-branch dated 2001-03-09 gdb cvs dated 2001-03-09 How-To-Repeat: Repeat the steps in the typescript.
Fix: Probably contained in the libiberty demanglers.
From: mec.gnu@mindspring.com (Michael Elizabeth Chastain) To: gdb-gnats@sources.redhat.com Cc: Subject: Re: c++/40 Date: Tue, 2 Dec 2003 13:15:58 -0500 (EST) I re-tried this with native i866-pc-linux-gnu, red hat 8.0. The bug still happens with: gdb 6.0, gcc 2.95.3, dwarf-2 gdb 6.0, gcc 2.95.3, stabs+ gdb 6.0, gcc 3.3.2, dwarf-2 gdb 6.0, gcc 3.3.2, stabs+ gdb HEAD, gcc 2.95.3, dwarf-2 gdb HEAD, gcc 2.95.3, stabs+ The bug appears to be fixed with: gdb HEAD, gcc 3.3.2, dwarf-2 gdb HEAD, gcc 3.3.2, stabs+ gdb HEAD is from 2003-11-30 06:08:24 UTC with Ian L-T new demangler. Michael C
The recent dwarf2_physname patchset fixes this problem (GDB 7.1.50.20100309-cvs), which is caused, as surmised by Michael, by the use of demangling linkage names.