From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15180 invoked by alias); 21 Aug 2007 11:32:09 -0000 Received: (qmail 15113 invoked by uid 22791); 21 Aug 2007 11:32:08 -0000 X-Spam-Check-By: sourceware.org Received: from s200aob12.obsmtp.com (HELO s200aob12.obsmtp.com) (207.126.144.116) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 21 Aug 2007 11:32:01 +0000 Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob012.postini.com ([207.126.147.11]) with SMTP; Tue, 21 Aug 2007 11:31:56 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 2BEB5DA6A for ; Tue, 21 Aug 2007 11:31:56 +0000 (GMT) Received: from mail1.bri.st.com (mail1.bri.st.com [164.129.8.218]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 75E2C4BFEC for ; Tue, 21 Aug 2007 11:31:55 +0000 (GMT) Received: from [164.129.15.13] (bri1043.bri.st.com [164.129.15.13]) by mail1.bri.st.com (MOS 3.7.5a-GA) with ESMTP id CJE22993 (AUTH stubbsa); Tue, 21 Aug 2007 12:31:54 +0100 (BST) Message-ID: <46CACD29.9060705@st.com> Date: Tue, 21 Aug 2007 11:32:00 -0000 From: Andrew STUBBS User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: GDB List Subject: info functions bug? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-08/txt/msg00148.txt.bz2 Hi, There seems to be a problem with 'info functions'. It prints the return type of template functions twice. Here's some example code: template TT& max(TT& a, TT& b) { return (a>b ? a : b); } int main() { int a = 1, b = 2; float c = 1.1, d = 2.2; max(a,b); max(c,d); return 0; } This is correctly interpreted by nm and c++filt as follows: $ nm -C a.out | grep max 88001878 W float& max(float&, float&) 88001830 W int& max(int&, int&) But GDB gives a slightly different name: (gdb) info functions max All functions matching regular expression "max": File t.cpp: float &float& max(float&, float&); int &int& max(int&, int&); This name is not accepted when setting a breakpoint, but remove the extra return type and all is well: (gdb) b float &float& max(float&, float&) Function "float &float& max(float&, float&)" not defined. (gdb) b float& max(float&, float&) Breakpoint 2 at 0x8800188a: file t.cpp, line 4. (Irritatingly, 'break max' doesn't work - it doesn't even prompt.) Presumably this is not the intended output for this type of function? Andrew