Move GDB to C++ ?

Andrew Cagney
Tue Jul 29 17:29:00 GMT 2008

Mark Kettenis wrote:
>> Date: Thu, 10 Jul 2008 11:46:15 -0700
>> From: Stan Shebs <>
>> 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.

I appreciate your pain here - as some would put it "C++ is the answer, 
now what was the question? :-)" - and having considered this further, 
wonder if both this thread and a proposed implementation as part of the 
archer project are being too quick to put the C++ cart before the 
architectural horse :-)

Instead of changing GDB to C++ and hoping the change will magically 
transform GDB's code base into a clean ideal design; should we instead 
be focused on trying to address what I suspect is the underlying 
motivation here - a desire to clean up and re-structure GDB's code base 
so that it more clearly corresponds to a more modern Object Oriented design?

If we consider this as an important goal, and find a way to more 
smoothly facilitate this development (multi-arch, at 9 years, in my not 
so humble opinion, was too slow)  we'll be able to improve GDB's 
internal architecture without using C++.  Then, in time, with a clearer 
O-O design, we can re-consider choices such as language.


More information about the Gdb mailing list