From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14996 invoked by alias); 30 Jul 2008 18:18:49 -0000 Received: (qmail 14825 invoked by uid 22791); 30 Jul 2008 18:18:48 -0000 X-Spam-Check-By: sourceware.org Received: from mtaout4.012.net.il (HELO mtaout4.012.net.il) (84.95.2.10) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 30 Jul 2008 18:18:22 +0000 Received: from HOME-C4E4A596F7 ([84.229.228.238]) by i_mtaout4.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0K4U00JBB066ZW72@i_mtaout4.012.net.il> for gdb@sources.redhat.com; Wed, 30 Jul 2008 21:18:07 +0300 (IDT) Date: Wed, 30 Jul 2008 18:30:00 -0000 From: Eli Zaretskii Subject: Re: Move GDB to C++ ? In-reply-to: X-012-Sender: halo1@inter.net.il To: tromey@redhat.com Cc: gdb@sources.redhat.com Reply-to: Eli Zaretskii Message-id: References: <487658F7.1090508@earthlink.net> <200807101901.m6AJ1UMQ007185@brahms.sibelius.xs4all.nl> <488F4AA7.7060001@gnu.org> 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: 2008-07/txt/msg00330.txt.bz2 > Cc: gdb@sources.redhat.com > From: Tom Tromey > Date: Tue, 29 Jul 2008 21:59:08 -0600 > > >>>>> "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. Did I say that someone did propose this? If you think I did, I probably failed to express myself clearly. > 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. Yes, but still no answer to the question I proposed. > 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 Those slides have only one _real_ GCC-specific argument in favor of C++: on slide 11. All the rest is general comparison between C and C++ based on toy examples. What I would like to see, as a minimum, is a dozen such arguments, for some of the more important parts of GDB code, that show how switching to C++ will make those parts easier to understand, extend, and maintain. For now, I've heard only one such argument: about struct value, and it wasn't anywhere as detailed as a convincing argument should be. If someone would come to me with such arguments on my daytime job, she would be out of my office in less than 2 minutes. > 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. As I said, such general arguments don't convince me where I get my paycheck, and that's a place where I can actually force people to code according to some standards.