Move GDB to C++ ?

André Pönitz
Wed Jul 30 12:11:00 GMT 2008

On Tuesday 29 July 2008 20:08:42 Andrew Cagney wrote:
> The question I'm asking here is are we focusing on C++ as a solution, 
> and mistakenly trying to rely on its features as a solution, when we 
> should instead be first focusing on the design, what ever the 
> implementation language?

I've seen a few code reviews on gdb-patches pointing out improper
(like missing) use, of, say, 'xfree'. Getting these right seems 
straightforward from a conceptional point of view, yet humans
err, and there's a lot of time spent in creating such code and
reviewing it. Also, it adds a certain level of "line noise" to the code
making it at least for the casual reader of the code hard to distinguish
what the actual meaning of a chunk of code is, and what belongs
to the "house keeping". 

This is one of the things C++ or  (- better also in my opinion -)
"C with classes" can solve. Destructors are friends. So, yes,
C++ can help to solve proble like the problem of limited developer

It also can help to lower the entrance barrier, as less project
specific maintanance processes need to be learned when
less "maintanance" code is needed. Less time might be spent
on reading (the then un-needed) maintanance code, too.

Note that I said "can", not "will". Whether it will depends on the kind
of code that is accepted. Clearly, C++ _can_ be abused. It does
not have to, though, and I have still to see a project in that limbo
between C and C++ that did not gain from going at least to 
"C with classes"....

Not sure this was helpful for anyone, but I simply could not resist ;-}


PS: Incidentally, I came across the discussion because I was looking
for a place to ask a few "gdb user questions".

The list descriptions at
all seem to be a bit development-centric. Would this list here be ok

More information about the Gdb mailing list