Will therefore GDB utilize C++ or not?
asmwarrior
asmwarrior@gmail.com
Thu Apr 5 00:22:00 GMT 2012
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
More information about the Gdb
mailing list