Move GDB to C++ ?

Mark Kettenis mark.kettenis@xs4all.nl
Thu Jul 10 21:54:00 GMT 2008


> Date: Thu, 10 Jul 2008 13:01:12 -0700
> From: Stan Shebs <stanshebs@earthlink.net>
> 
> Mark Kettenis wrote:
> >> Date: Thu, 10 Jul 2008 11:46:15 -0700
> >> From: Stan Shebs <stanshebs@earthlink.net>
> >>
> >> 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.
> >>     
> >
> > I think this is an absolutely retarded idea.  C++ is a horrible
> > programming language.
> >   
> Okay... so, uh, since C++ is basically a superset of C, presumably the 
> horribleness you are thinking of relates to specific extensions. The 
> basic idea of classes? Templates? Overloading? Exception handling? We 
> would get to codify the set of C++ features that we will allow, 
> certainly I'd never want to allow in patches that used arcane features 
> of the language in twisted ways.

Classes are mostly ok, but they tend to distract people in doing
architectures, and stupid programming paradigms like setter/getter.

Templates are absolutely horrible syntactically and make it almost
impossible to debug your code.

Function overloading is unecessary syntactic sugar that confuses
compilers and humans alike.

Exception handling is an excellent idea, but I've never seen it used
properly in any non-trivial C++ code.

The subset of C++ that I like is pretty much that what is called C.  I
don't think the benefits of using a few C++ outweighs the loss of the
ability to compile GDB with a bog standard C compiler.

I also don't really want to waste much time on discussing this topic.
If people really want to waste their time on moving GDB to C++, I'll
probably find mysef another project to spend my spare time on.

Mark



More information about the Gdb mailing list