This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Move GDB to C++ ?


Vladimir Prus wrote:
Nick Roberts wrote:

> Tom> * Templates are used in at least one place -- vec.h.
> > I found another gdb-specific example of this: observers. A given
> observer is essentially an instance of a template class.


From my point of view, another benefit of using C++, is presumably that
variable objects could be represented as linked lists, rather than use the
current vector API which, for reasons I've already given, I think is
unsuitable.

Without getting into that discussion again, it's clear that either std::vector, or std::list, or std::deque, are much better than anything implementable in C.

Sure, but that's a narrow view from the language point only. You have to take into full account many factors including:


a) some maintainers dislike for C++ that may reduce their contributions

b) some maintainers who simply don't care to mess with another language

c) the danger of unnecessary complex stuff creeping in if there is
insufficient control and code review.

d) the transition costs are non-negligible

e) the increased commplexity of the environment necessary to build
GDB. Speaking a moment from AdaCore's point of view as an example,
this would mean we had to build and maintain C++ compilers on dozens
of configurations. We can probably do this, but it is not zero work,
and I have no idea how other organizations would be affected.

f) the danger that points a) through e) together might lead to a
divergence in the development path.

My inclination is that the minuses outweigh the pluses.

To make this point clearer, suppose I suggested we recode the
whole of GDB in Ada. From purely a language point of view, the
technical arguments in favor of such a recoding would be very
strong, and indeed I would be happy to argue and demonstrate
that from purely a language point of view, this would be a
better choice than C++.

However, everyone (including me) would agree that in this case
a) through f) would outweigh any technical langauge advantage,
so much so that the proposal would not be considered seriously
at all.

Obviously the transition from C to C++ would be easier, but I
see too much of the argument focused on the language advantages,
and not enough on the balance of the negative and positive points.

However


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]