From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31430 invoked by alias); 18 Sep 2004 02:29:17 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 31407 invoked from network); 18 Sep 2004 02:29:15 -0000 Received: from unknown (HELO maynard.mail.mindspring.net) (207.69.200.243) by sourceware.org with SMTP; 18 Sep 2004 02:29:15 -0000 Received: from user-119a90a.biz.mindspring.com ([66.149.36.10] helo=berman.michael-chastain.com) by maynard.mail.mindspring.net with esmtp (Exim 3.33 #1) id 1C8UyP-00015o-00; Fri, 17 Sep 2004 22:29:13 -0400 Received: from mindspring.com (localhost [127.0.0.1]) by berman.michael-chastain.com (Postfix) with SMTP id 86F544B102; Fri, 17 Sep 2004 22:29:32 -0400 (EDT) Date: Sat, 18 Sep 2004 02:29:00 -0000 From: Michael Chastain To: jimb@redhat.com, david.carlton@sun.com Subject: Re: representing C++ constructors in GDB's symbol tables Cc: gdb@sources.redhat.com Message-ID: <414B9D8B.nailB2O11AVBZ@mindspring.com> References: In-Reply-To: User-Agent: nail 10.8 6/28/04 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2004-09/txt/msg00156.txt.bz2 David Carlton wrote: > You can use "X(...)" to create a temporary object of type X. Sure. And of course: X my_x = X(); Also remember destructors. A C++ program can explicitly call a destructor. Sigh. > Having said that, a constructor really is a different beast from an > ordinary function call. And I don't think that having GDB support > > (gdb) print Printer().print() > > should be high on your list of priorities. Yeah. I would be comfortable if gdb said "forget about it, I don't call a ctor directly" (and the same for dtor). Then in 2006 someone else can come along and fix that limitation, watching out for the big trap that the ABI for constructors and destructors can be *different* than for normal functions, with hidden magic parameters. Michael