From: Yao Qi <qiyaoltc@gmail.com>
To: archer@sourceware.org
Subject: Re: C++ draft
Date: Tue, 28 Jun 2011 08:21:00 -0000 [thread overview]
Message-ID: <BANLkTimpvfyY4hWO_WGxtpXqf8sLiQX6YwfX4fhyJ5Lz8nb3Qw@mail.gmail.com> (raw)
In-Reply-To: <m3tybb7zjz.fsf@fleche.redhat.com>
On Tue, Jun 28, 2011 at 5:08 AM, Tom Tromey <tromey@redhat.com> wrote:
> I've been working on another proposal to move gdb to C++. I'd
> appreciate help with it. Here is what I have so far.
>
> Do you find it reasonably convincing? If not, why not? What can be
> improved? Are there other good initial targets for conversion? Are
> there lurking problems of which I am unaware?
>
I don't have special preference over C or C++.
> My proposal is:
>
> 1. Modify GDB so it can be compiled with -Wc++-compat.
> This would be the first patch series. There is already an archer
> branch for this.
>
> 2. Then, change GDB to compile with a C++ compiler (-Wc++-compat is
> not complete). This would be the second patch series.
>
> 3. Require C++.
>
> 4. Change selected modules to use C++ rather than C.
> I don't think a wholesale change makes sense, but some areas would
> benefit.
>
> My first target would be to change the exception handling system to
> use C++ exception. This would enable us to begin using RAII in
> some areas, which would help robustness.
>
> My concrete plan here is:
>
> * Use the GCC cleanup-checking plugin I already wrote to detect
> cleanup-aware functions.
>
> * Modify these functions, using a script, to add an RAII-using
> object to manage the local cleanups. This is important so that
> we run cleanups at the correct time during stack unwinding.
>
> * Change throw_exception to use 'throw' and all TRY_EXCEPT
> instances to try...catch.
>
> * Finally, convert functions to static RAII usage when appropriate;
> this will be an ongoing transition.
>
> I think our second target will be sorting out Python reference
> counting, so we can avoid the many problems we have had there.
>
Tom,
In your concrete plan, IIUC, your plan is about converting GDB to C++
*partially*, instead of re-write GDB *completely*. Is that correct?
For example, I don't anything in your plan about converting *-tdep.c
stuff into C++. Is it in your plan or we plan to leave them as they
are now?
Do we plan to move gdbserver to C++? I think no, because some
baremental boards have too few memory to hold a C++ application. So
we are in a state that both C and C++ co-exist in GDB for some time.
I don't think C and C++ co-existance is a problem, or, your plan is
about "make good use of C++ to replace some bad and error-prone stuffs
in GDB, and keep the rest of GDB as it is". Is it right?
Just want to know clearly what GDB will be after your plan is performed.
--
Yao Qi <qiyaoltc AT gmail DOT com>
http://sites.google.com/site/duewayqi/
next prev parent reply other threads:[~2011-06-28 8:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-27 21:08 Tom Tromey
2011-06-27 21:23 ` [Archer] " Joel Brobecker
2011-06-29 19:55 ` Tom Tromey
2011-06-29 21:47 ` [Archer] " Joel Brobecker
2011-06-28 4:33 ` Matt Rice
2011-06-28 8:21 ` Yao Qi [this message]
2011-06-28 12:21 ` Gary Benson
2011-06-28 17:08 ` Matt Rice
2011-06-28 17:36 ` Jan Kratochvil
2011-06-29 20:08 ` Tom Tromey
2011-06-29 20:06 ` Tom Tromey
2011-06-30 6:06 ` Yao Qi
2011-09-26 21:01 ` Jim Blandy
2011-06-29 18:52 ` Stan Shebs
2011-06-29 19:03 ` [Archer] " Joel Brobecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BANLkTimpvfyY4hWO_WGxtpXqf8sLiQX6YwfX4fhyJ5Lz8nb3Qw@mail.gmail.com \
--to=qiyaoltc@gmail.com \
--cc=archer@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).