From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6959 invoked by alias); 20 Aug 2007 17:11:09 -0000 Received: (qmail 6805 invoked by uid 22791); 20 Aug 2007 17:11:08 -0000 X-Spam-Check-By: sourceware.org Received: from s200aob14.obsmtp.com (HELO s200aob14.obsmtp.com) (207.126.144.118) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 20 Aug 2007 17:10:57 +0000 Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob014.postini.com ([207.126.147.11]) with SMTP; Mon, 20 Aug 2007 17:10:44 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 DE62ADB24 for ; Mon, 20 Aug 2007 17:10:43 +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 B05114C49B for ; Mon, 20 Aug 2007 17:10:43 +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 CJE17921 (AUTH stubbsa); Mon, 20 Aug 2007 18:10:42 +0100 (BST) Message-ID: <46C9CB12.5000004@st.com> Date: Mon, 20 Aug 2007 17:11:00 -0000 From: Andrew STUBBS User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: GDB List Subject: C++ Typedefs and symbol tables 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/msg00137.txt.bz2 Hi, I have encountered a problem setting breakpoints on overloaded C++ functions: when I specify the function signature, I have to use the canonical type name, not the typedef name used in the source I am looking at. (I am aware it prompts where no signature is given, but that possibility is not available to scripts, for example). I'm using GDB 6.5 here. Apologies if this is a well known problem I've somehow failed to find on Google, or has been fixed since then. E.g. class C; typedef C t; void f (t); (gdb) break f(C) -> OK (gdb) break f(t) -> bad "info functions" lists the function using the name "C". This is consistent with nm, so I assume it is getting this from the symbol table. I suppose it makes sense that the signature in the symbol table uses the canonical name. The dwarf debug information, on the other hand, shows the function with the typedef name used in the source code. It also contains the proper mapping from typedef name to actual class name. Would it not be possible to use the debug information, where available, to canonicalize the type names before attempting to match the function signatures, at least for the purposes of setting breakpoints? Thanks Andrew