From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12096 invoked by alias); 18 Sep 2004 00:18:06 -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 12072 invoked from network); 18 Sep 2004 00:18:05 -0000 Received: from unknown (HELO nwkea-mail-1.sun.com) (192.18.42.13) by sourceware.org with SMTP; 18 Sep 2004 00:18:05 -0000 Received: from sfbaymail2sca.sfbay.sun.com ([129.145.155.42]) by nwkea-mail-1.sun.com (8.12.10/8.12.9) with ESMTP id i8I0Hl4d008968; Fri, 17 Sep 2004 17:17:47 -0700 (PDT) Received: from kealia.sfbay.sun.com (kealia.SFBay.Sun.COM [129.144.80.16]) by sfbaymail2sca.sfbay.sun.com (8.12.10+Sun/8.12.10/ENSMAIL,v2.2) with ESMTP id i8I0HjcA000415; Fri, 17 Sep 2004 17:17:46 -0700 (PDT) Received: by kealia.sfbay.sun.com (Postfix, from userid 2049) id A8A24CDFB; Fri, 17 Sep 2004 17:17:45 -0700 (PDT) To: Jim Blandy Cc: gdb@sources.redhat.com Subject: Re: representing C++ constructors in GDB's symbol tables References: From: David Carlton Date: Sat, 18 Sep 2004 00:18:00 -0000 In-Reply-To: (Jim Blandy's message of "Fri, 17 Sep 2004 17:45:40 -0500") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Reasonable Discussion, linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-09/txt/msg00155.txt.bz2 On Fri, 17 Sep 2004 17:45:40 -0500, Jim Blandy said: > It occured to me that perhaps constructors should not be in the > VAR_DOMAIN. This sounds plausible, though I'm not entirely convinced, but for what it's worth this next claim of yours isn't really true: > You can't use them by name in expressions: you have to say "new > X(...)", never "X(...)". You can use "X(...)" to create a temporary object of type X. E.g. the following program works fine. #include class Printer { public: void print() const { std::cout << "print!\n"; } }; int main() { Printer().print(); return 0; } 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. David Carlton david.carlton@sun.com