Move GDB to C++ ?

Andrew Cagney cagney@gnu.org
Mon Jul 14 14:54:00 GMT 2008


Michael Snyder wrote:
> 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.
>   

This is complicated.  As Robert's pointed out, some of the costs are 
up-front.  If the full transition never happens then we'll have still 
paid that price.

This is why I think, initially, should consider running an experiment in 
parallel, it will let us see what happens without those up-front 
penelties.  Then, with concrete code, we'll be able to better access 
things and determining if there is a true advantage.  It will also let 
those interested in this figure out all the issues such as coding et.al. 
without creating unnecessary entropy here in mainline GDB.



More information about the Gdb mailing list