Re: Cleanups and Exception handlers

Jan Kratochvil <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.