From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16154 invoked by alias); 30 Jul 2008 03:59:36 -0000 Received: (qmail 16146 invoked by uid 22791); 30 Jul 2008 03:59:35 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 30 Jul 2008 03:59:12 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m6U3x96m004729 for ; Tue, 29 Jul 2008 23:59:09 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m6U3x9A9003855; Tue, 29 Jul 2008 23:59:09 -0400 Received: from opsy.redhat.com (vpn-10-39.bos.redhat.com [10.16.10.39]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m6U3x90n014077; Tue, 29 Jul 2008 23:59:09 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 8DCFB3784E3; Tue, 29 Jul 2008 21:59:08 -0600 (MDT) To: Eli Zaretskii Cc: gdb@sources.redhat.com Subject: Re: Move GDB to C++ ? References: <487658F7.1090508@earthlink.net> <200807101901.m6AJ1UMQ007185@brahms.sibelius.xs4all.nl> <488F4AA7.7060001@gnu.org> From: Tom Tromey Reply-To: tromey@redhat.com X-Attribution: Tom Date: Wed, 30 Jul 2008 05:24:00 -0000 In-Reply-To: (Eli Zaretskii's message of "Tue\, 29 Jul 2008 22\:09\:40 +0300") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2008-07/txt/msg00311.txt.bz2 >>>>> "Eli" == Eli Zaretskii writes: Eli> So will someone please tell, loud and clear: what do we want to do the Eli> day after GDB is rewritten in C++? Let's suppose that we magically Eli> fast-forward to the day after everything was refactored and GDB is Eli> 110% pure, OO, C++ -- what will we do the next day that we cannot or Eli> have difficulties doing today? Nobody is proposing that we stop all work and rewrite GDB in C++, then look to see what we could do with it. That would not make sense. Aside from the one-time effort to make gdb compile with a C++ compiler, it can be introduced gradually. C++ is not a silver bullet, it is an improvement. I think much of Ian's PDF on moving GCC to C++ applies just as well to gdb: http://www.airs.com/ian/cxx-slides.pdf Actually, the case is even stronger for gdb. For example, GCC does not use RAII or exceptions -- both idioms where C++ is strong -- but gdb does. Naturally, every construct in C++ can be written using C. This is obvious, because gdb already does it. However, in C++ it is generally less work, and the result is often better -- more regular, simpler to reason about, more type-safe, less buggy, or in some cases faster. Tom