This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [rfc/rfa(top.c)] catch_exceptions()


> 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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]