Will therefore GDB utilize C++ or not?
Jan Kratochvil
jan.kratochvil@redhat.com
Mon May 21 18:36:00 GMT 2012
On Mon, 21 May 2012 18:27:48 +0200, Pedro Alves wrote:
> and then:
>
> old_chain = make_cleanup (foo_cleanup, &whatever_arg);
>
> if (whatnot)
> {
> discard_cleanups (old_chain);
> return SUCESS;
> }
> do_cleanup (old_chain);
>
> But yes, as I've said before elsewhere, give me destructors,
> everything else I can live without. :-)
>
> Basically, whoever understands RAII should understand cleanups.
> Not counting the auto-destruction issue, I'm saying that writing
> raii classes vs writing cleanup function is mostly syntax sugar.
With RAII you do not have to write many times in that function that do_cleanup
statement (for multiple cleanup markers), which makes one of the differences.
Jan
More information about the Gdb
mailing list