From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25818 invoked by alias); 12 Jul 2008 03:30:14 -0000 Received: (qmail 25810 invoked by uid 22791); 12 Jul 2008 03:30:13 -0000 X-Spam-Check-By: sourceware.org Received: from bluesmobile.specifix.com (HELO bluesmobile.specifix.com) (216.129.118.140) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 12 Jul 2008 03:29:56 +0000 Received: from [127.0.0.1] (bluesmobile.specifix.com [216.129.118.140]) by bluesmobile.specifix.com (Postfix) with ESMTP id BA0C03BE0B; Fri, 11 Jul 2008 20:29:54 -0700 (PDT) Subject: Re: Move GDB to C++ ? From: Michael Snyder To: Stan Shebs Cc: gdb@sourceware.org In-Reply-To: <487658F7.1090508@earthlink.net> References: <487658F7.1090508@earthlink.net> Content-Type: text/plain Date: Sat, 12 Jul 2008 03:30:00 -0000 Message-Id: <1215833394.3549.261.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-7.fc7) Content-Transfer-Encoding: 7bit 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/msg00134.txt.bz2 On Thu, 2008-07-10 at 11:46 -0700, Stan Shebs wrote: > As many know, there is a project afoot to investigate the recoding of > GCC from C into C++. I believe the C++ idea was briefly touched on for > GDB at the summit, although I don't remember much discussion. Anyway, > this would be a good time to start thinking about it, and if people are > generally in favor of the idea, we can start small by tweaking the > sources to be C++-friendly, avoiding keywords and so forth; GCC has a > new warning flag -Wcxx-compat that can help. > > For my part, I think we should do it. GDB has quite a bit of object-like > structure internally, and while in the past it was taking a bit of a > chance to rely on the availability and reliability of C++ compilers, > those concerns are now generally outdated; I'm not sure any of the > potential problem hosts are even supported any longer. While I do not love C++, I can see no harm in this suggestion. Even if the full transition never happens, gdb will be no worse. On Thu, 2008-07-10 at 16:39 -0400, Andrew Cagney wrote: > The one question I would pose though, is bashing up the current GDB code > base until it compiles with C++ a reasonable approach? Each time C++ > has been suggested previously, that has been the proposed path forward, > and each time it has not moved (I've even tried it my self). Perhaps, > instead, we should approach this more on a component basis - stack, > expr, type, proc, debug-info, ..., and convert each chunk in turn. I think this is perfectly reasonable too -- and the two suggestions are perfectly compatible. I also like Stan's suggestion about branches. On Thu, 2008-07-10 at 23:26 -0700, Joel Brobecker wrote: > That would be my concern #1. I really think that it's a huge plus > to be able to build GDB with a C compiler. C++ compiler are just > not as common as C compilers, particularly on more exotic platforms. We recently made the jump from K&R to requiring an ANSI compiler. Are we really all that far from requiring GCC? Joel: > My other major concern is debugability - I want to make sure that > if we agree on the transition, GDB will be as easy to debug as before. > I am way out of my league on this, but isn't it the case that: > - there's still some progress to be made to help debugging C++ > in general (I might be VERY wrong on that one) You're not entirely wrong -- but that argument cuts both ways. If gdb is written in C++, that will force us to "eat our own dog food", as it were... and maybe debug support for C++ will improve. > - that stabs is not good enough to provide full C++ debugging support > ? In that you are correct. But it's not all-or-nothing. We should enumerate what parts of C++ are un-supportable in stabs. Andrew Cagney: > ... I suspect that, when we're > talking about that sort of time scale for an incremental approach, it > too runs the risk of limited commitment levels, and GDB finding itself > in a C vs C++ no-where land. Yep, but the first step that Stan proposes is innocuous. GDB will be no worse for being able to be compiled with -Wcxx-compat .