[m-rev.] diff: bug fix for exception.m

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Oct 10 17:11:19 AEST 2002


On 10-Oct-2002, Mark Brown <dougl at cs.mu.OZ.AU> wrote:
> library/exception.m:
> 	Ensure that MR_trace_from_full is set correctly before calling a
> 	Mercury exception handler.  Failing to set this global can lead to
> 	bogus events being sporadically generated from shallow traced code.
...
> +++ library/exception.m	9 Oct 2002 17:02:11 -0000
> @@ -2003,6 +2003,13 @@
>  	MR_r4 = exception;	/* This is our one input argument */
>  
>  	/*
> +	** The handler is effectively being called from try/2 or one of
> +	** its variants.  Since this caller is in the standard library,
> +	** it won't be deep traced.
> +	*/
> +	MR_trace_from_full = MR_FALSE;

I think your fix for this is wrong in the case when the Mercury library
was compiled with deep tracing enabled.  This is the case for `.decldebug'
grades, or if the library is compiled with `EXTRA_MCFLAGS=--trace deep'
in Mmake.params.

Probably the right solution is to save the value of MR_trace_from_full
at the call to builtin_catch and restore it in builtin_throw.
It can be saved in a new field of MR_Exception_Handler_Frame_struct
(from runtime/mercury_stacks.h).

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list