This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [rfc/rfa(top.c)] catch_exceptions()
- To: Kevin Buettner <kevinb at cygnus dot com>
- Subject: Re: [rfc/rfa(top.c)] catch_exceptions()
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Wed, 15 Aug 2001 14:24:51 -0400
- Cc: gdb-patches at sources dot redhat dot com
- References: <3B783BC9.8030603@cygnus.com> <1010815165226.ZM31992@ocotillo.lan>
> On Aug 13, 4:42pm, Andrew Cagney wrote:
>
>
>> The attatched patch impements a successor to catch_errors() -
>> catch_exceptions().
>
> [...]
>
>> Comments. Any preference for the other. Ok for top.c?
>
>
> I reviewed your patch and it looks fine to me. I wonder though if
> it might not be better to implement catch_errors() in terms of
> catch_exceptions() in order to make sure that the new code gets
> thoroughly tested from the outset.
Thanks for the comments. I thought about having catch_errors() just use
catch_exceptions() (and not have the catcher() function). Problem is, I
don't see a correct way of doing this. catch_exceptions() places very
strict requirements on FUNC(), catch_errors() doesn't have any (any
return value is technically legal). Consequently the assertion:
gdb_assert (val >= 0);
can't be applied to catch_errors().
Anyway, the code is going to be tested ``almost'' from the outset :-)
My next patch is to change the gdb_*() libgdb functions to use this.
Andrew