Move GDB to C++ ?

Ian Lance Taylor ian@airs.com
Thu Jul 31 20:03:00 GMT 2008


Eli Zaretskii <eliz@gnu.org> writes:

>> I think much of Ian's PDF on moving GCC to C++ applies just as well to
>> gdb:
>> 
>>     http://www.airs.com/ian/cxx-slides.pdf
>
> Those slides have only one _real_ GCC-specific argument in favor of
> C++: on slide 11.  All the rest is general comparison between C and
> C++ based on toy examples.

I think that is an unfair criticism.  Every C example on those slides
came directly from the gcc source code, simplified to fit on the
slide.  In fact, I think the simplification actually makes the C code
look better than it really is, but I needed slides to show examples
while I spoke, so my space was limited.


I tend to think that gdb would be improved by moving to C++: I think
it would make it easier to maintain the code.  Many of the objections
seem to take two general forms:

1) "It could get worse."  That's right: it could get worse.  But gdb
could get worse without changing languages.  The way you keep it from
getting worse is by writing good code and by selecting good
maintainers.  Choice of language is a relatively minor factor in
reducing code quality.

2) "It's too much work."  Yes, it's a lot of work.  If you aren't
interested, don't do the work.  If other people are willing to do the
work, think carefully about whether you want to reject their efforts,
and why.  If other people are not willing to do the work, then for
sure it won't happen.


I'm on the gdb steering committee, but my personal opinion is that
choice of language is a technical decision best made by the active
maintainers, not a steering committee decision.  I am not, of course,
an active maintainer.

Ian



More information about the Gdb mailing list