From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6876 invoked by alias); 6 Dec 2001 04:25:59 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 6855 invoked from network); 6 Dec 2001 04:25:57 -0000 Received: from unknown (HELO www.cgsoftware.com) (208.155.65.221) by sources.redhat.com with SMTP; 6 Dec 2001 04:25:57 -0000 Received: from localhost (localhost [127.0.0.1]) by www.cgsoftware.com (8.9.3/8.9.3) with ESMTP id XAA10580; Wed, 5 Dec 2001 23:25:52 -0500 Date: Wed, 05 Dec 2001 20:25:00 -0000 From: Daniel Berlin To: Daniel Jacobowitz cc: Subject: Re: DWARF-2 and constructors/destructors In-Reply-To: <20011205230120.A12341@nevyn.them.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2001-12/txt/msg00262.txt.bz2 On Wed, 5 Dec 2001, Daniel Jacobowitz wrote: > On Wed, Dec 05, 2001 at 10:52:46PM -0500, Daniel Jacobowitz wrote: > > Suppose you want to call a (non-virtual) method in C++, from something > > with Dwarf-2 info. The only way to get the mangled name from the debug > > info is DW_AT_MIPS_linkage_name. This isn't, of course, present for > > constructors/destructors, since the entry in the class definition is > > for the abstract version. > > > > Is it reasonable for the debugger to have to mangle this itself? The > > constructor arguments can be arbitrarily complex. Should there be > > references in the debug information to the base and complete > > constructors anywhere? > > And I see, in a rather memorable rant, Daniel Berlin saying that > DW_AT_MIPS_linkage_name is "a hack" (certainly), "not necessary, and > we're trying to make it go away anyway." Yes, with which Jason Merrill agreed, IIRC. In fact, he first convinced me. :) I'm just more vitriolic by a small margin. > Dan, would you mind > enlightening me on how to cope without it without having a full mangler > for every supported C++ ABI attached to the Dwarf-2 reader? Sure. What exactly do you need mangled names for? All the methods have real names anyway. We already demangle them anyway when we lookup symbols, remember. If you mean for calling constructors, it's abi specific. Find all the matching constructors, which will be a small number, demangle them, and pick the right one for your purposes. The demangler actually marks what type of constructor/deconstructor it is, the info is just not propagated to somewhere where gdb sees it (in cp-demangle.c, it's stored in the demangling_t structure, but we only hand back the string). > > As far as I'm concerned, GDB has no business ever mangling a single > string. Bingo. > Debug info should provide everything that we need. Yes, it should. Now go look at check_method_stub and gdb_mangle_name, and try to avoid hurling. > > -- > Daniel Jacobowitz Carnegie Mellon University > MontaVista Software Debian GNU/Linux Developer >