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: Will therefore GDB utilize C++ or not?


On 2012-4-5 4:47, Tom Tromey wrote:
My view is that GDB is already written in a poor cousin of C++.
Nearly every feature that people hate about C++ is already in use in
GDB.  This list is not exhaustive, just informational:

* Subclasses.  See general_symbol_info.  struct value and struct type
   would be improved by them.

* Virtual functions. gdbarch, languages, and values all use these.

* Overloaded functions. Anywhere you see a _1 suffix.

* Templates. Both observers and VEC are templates.

* Exceptions. Used ubiquitously.

* RAII. Cleanups, but they are dynamic and more error-prone.

* Even global constructors -- init.c.

In most cases, GDB's implementation of these features is inferior to
that of the C++ compiler.

Agreed. Simulate C++ feature in plain C style macros and callbacks are boring and hard to maintain.


BTW: There are some discussion about C++ in GCC 4.8, maybe, your gdb administrators (committee) can also give a plane.



Asmwarrior
Code::Blocks developer


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