From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19311 invoked by alias); 20 Aug 2007 18:23:02 -0000 Received: (qmail 19252 invoked by uid 22791); 20 Aug 2007 18:22:59 -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 18:22:48 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 24FA9980C1 for ; Mon, 20 Aug 2007 18:22:48 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 8CCE0980BF for ; Mon, 20 Aug 2007 18:22:47 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1INBtl-0003hm-1l for gdb@sourceware.org; Mon, 20 Aug 2007 14:22:45 -0400 Date: Mon, 20 Aug 2007 18:23:00 -0000 From: Daniel Jacobowitz To: gdb@sourceware.org Subject: Re: C++ Typedefs and symbol tables Message-ID: <20070820182245.GA14063@caradoc.them.org> Mail-Followup-To: gdb@sourceware.org References: <46C9CB12.5000004@st.com> <20070820171803.GA11056@caradoc.them.org> <46C9D0E1.5080509@st.com> <20070820174920.GA12384@caradoc.them.org> <46C9D968.40809@st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46C9D968.40809@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/msg00142.txt.bz2 On Mon, Aug 20, 2007 at 07:11:52PM +0100, Andrew STUBBS wrote: > Daniel Jacobowitz wrote: > > Symbols come from .debug_info and have type information. minsyms come > > from the ELF .symtab section, and do not. > > Ah, OK. How do I determine this, and how do I get it to use the proper symbols > if it has chosen the wrong ones? Sorry, there's no easy answer to either of these questions. > I know that the debug info contains the definition given in the source - at > least for one example I looked at, anyway. It couldn't have arrived at the > version given by 'info functions' without canonicalizing the debug info, so I > assume it must be using the (already canonical) minsyms only. Often the minsym's name is used even when dealing with the full symbol. I worked on stopping this, and I hope I will have a chance to try again soon. You can find more information by searching for DW_AT_MIPS_linkage_name. > > 2-3 typenames is not typical, in C++ programs. It added around 30% > > time in my testing. > > Oh? I'm talking about converting something like > > Int32 f(Bp,Int16) > to > int f(B*,short) > > (where Bp is an example of a typedef), and only for parameters given to > breakpoint commands and the like. > > There's only 3 types in that (four if you count the function type), and > breakpoint commands wouldn't come up _too_ often, so surely it couldn't take > that much time? > > Surely we are talking at cross-purposes? That is not at all a typical function name for a typical C++ program :-) In my experience most programs that bother to write in C++ do it with intention of taking advantage of templates, and this blows up the number of type signatures in function names dramatically. Even namespaces and classes do so. -- Daniel Jacobowitz CodeSourcery