From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32232 invoked by alias); 20 Aug 2007 17:18:20 -0000 Received: (qmail 31985 invoked by uid 22791); 20 Aug 2007 17:18:17 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 20 Aug 2007 17:18:07 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id D371B980C0; Mon, 20 Aug 2007 17:18:06 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id AB6CD980BF; Mon, 20 Aug 2007 17:18:06 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1INAt9-0002uM-Lq; Mon, 20 Aug 2007 13:18:03 -0400 Date: Mon, 20 Aug 2007 17:18:00 -0000 From: Daniel Jacobowitz To: Andrew STUBBS Cc: GDB List Subject: Re: C++ Typedefs and symbol tables Message-ID: <20070820171803.GA11056@caradoc.them.org> Mail-Followup-To: Andrew STUBBS , GDB List References: <46C9CB12.5000004@st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46C9CB12.5000004@st.com> User-Agent: Mutt/1.5.15 (2007-04-09) 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/msg00138.txt.bz2 On Mon, Aug 20, 2007 at 06:10:42PM +0100, Andrew STUBBS wrote: > 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). Check whether you are ending up with a search based on the function's symbol or minsym. The mangled name always uses the canonical type name (for obvious ABI reasons). > 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? Yes, but it's a lot of work. We can not currently canonicalize anything during lookup because we do not canonicalize during symbol reading; and just turning that on slows things down considerably. The cp-names.y parser was intended for exactly this. -- Daniel Jacobowitz CodeSourcery