This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Cleanups and Exception handlers
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Phil Muldoon <pmuldoon at redhat dot com>
- Cc: gdb at sourceware dot org
- Date: Wed, 1 May 2013 21:44:30 +0200
- Subject: Re: Cleanups and Exception handlers
- References: <5180EE37 dot 3020507 at redhat dot com> <20130501152116 dot GA7529 at host2 dot jankratochvil dot net> <518162F2 dot 1000704 at redhat dot com>
On Wed, 01 May 2013 20:46:10 +0200, Phil Muldoon wrote:
> In the first example, where did the previously registered cleanup
> outside of the TRY_CATCH go? Was it discarded (or leaked?)
Right, leaked, forgotten in memory, a bug. The new patch will assert those:
[patch 2/2] Assert leftover cleanups in TRY_CATCH
http://sourceware.org/ml/gdb-patches/2013-05/msg00008.html
> On 01/05/13 16:21, Jan Kratochvil wrote:
> > In such case cleanups are executed already inside the TRY_CATCH block at the
> > time the exception was thrown. throw_exception contains:
> > do_cleanups (all_cleanups ());
>
> Ok thanks, so in the case of cleanups entirely encapsulated in the
> TRY_CATCH block there is no need to do anything in the later exception
> handling block (the "if", after).
Right.
> > It seemed to me that there were too many TRY_CATCH blocks even in cases where
> > nothing can throw an exception.
>
> This is because most (though I have no audited all of them) calls to
> ui_out_* use *_filtered function calls (at least when the output is
> directed to the CLI). These can be interrupted from GDB and Python
> has to handle the resulting GDB generated keyboard interruption
> exception. It's a massive pain in the neck. ;)
Oops, OK.
Jan