From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 498 invoked by alias); 3 Jul 2007 07:03:49 -0000 Received: (qmail 484 invoked by uid 22791); 3 Jul 2007 07:03:44 -0000 X-Spam-Check-By: sourceware.org Received: from ms9.webland.ch (HELO ms9.webland.ch) (194.209.78.139) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 03 Jul 2007 07:03:41 +0000 Received: from indel.ch ([84.73.31.54]) by ms9.webland.ch (Webland.MailServer.v.8.9.6) with ASMTP id IOG12638 for ; Tue, 03 Jul 2007 09:03:38 +0200 Received: from FABI.indel.ch [192.168.1.91] by indel.ch [127.0.0.1] with SMTP (MDaemon.v2.7.SP5.R) for ; Tue, 03 Jul 2007 09:03:08 +0200 Message-Id: <5.2.0.9.1.20070703084716.01a5eec0@localhost> X-Sender: cenedese@localhost (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 [via SMTPAuth 0.9, bisswanger.com] Date: Tue, 03 Jul 2007 07:03:00 -0000 To: gdb@sourceware.org From: Fabian Cenedese Subject: Re: GDB in C++ In-Reply-To: <1183434783.4689c81fa4016@myaccount.bayarea.net> References: <200707020721.l627LAR3001590@brahms.sibelius.xs4all.nl> <46866F20.2010902@eagercon.com> <20070701205355.GC24316@caradoc.them.org> <200707020721.l627LAR3001590@brahms.sibelius.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-MDaemon-Deliver-To: gdb@sourceware.org X-Return-Path: cenedese@indel.ch 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: 2007-07/txt/msg00028.txt.bz2 At 20:53 02.07.2007 -0700, Michael Eager wrote: >Quoting Mark Kettenis : >> > From: Daniel Jacobowitz > >> > I'm in favor of switching to C++. I'm not going to argue about it if >> > others disagree, but I'll offer to do most of the work if the >> > consensus is positive. >> >> My position on this subject has not been changed. The more C++ code I >> see, the more convinced I get that the language should die. > >I, too, have worked on convoluted and poorly written C++ programs. >That's partially poor programming practices, rather than the language. >Trying to use every feature in the language is not a good plan. > >The features which recommend C++ are classes and the encapsulation >and data hiding which it offers. Along with this comes inlining >and error checking. A limited use of inheritance is useful. > >Features which I would avoid are templates, overloading, and the STL. > >I think that implementing the parts of GDB which attempt to emulate >classes in C++ would have benefits in clarity and performance. I'm not a gdb-developer, so I don't have a vote on this, I just speak as an outsider. I occasionally look into the gdb sources when I'm trying to find an error (of course mostly in my code :) I find the gdb source code very difficult to understand with function pointers, that look like C++ member functions (as described), the overuse of macros (e.g. to access structure members or to create function names), the cleanup mechanism and some other things I haven't understood yet. I know that gdb has grown over years and part of this comes from the versatility of hosts and targets it needs to work with. But still most C++ code I looked at or wrote myself is far easier to understand if templates and STL are left aside. >Trying to use every feature in the language is not a good plan. This is valid for both C++ and C. Sorry for my mumbling, going back to where I came from... bye Fabi