[m-dev.] Add an bool argument to filter

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Oct 30 00:10:14 AEST 1999


On 29-Oct-1999, Erwan Jahier <Erwan.Jahier at irisa.fr> wrote:
> This change implements the Fergus suggestion; i.e. add an argument to filter 
> that returns a bool saying whether we stop collecting or not.
> 
> trace/mercury_trace_external.c:
> Opium-M/source/collect.in:
> Opium-M/source/collect.op:
> 	Add an new argument to filter that says saying whether we stop 
> 	collecting or not.
> 
> Opium-M/source/collect.op:
> 	Also improve the documentation by describing the event type.
> 
> Index: 0.4/mercury_trace_external.c
> --- 0.4/mercury_trace_external.c Fri, 29 Oct 1999 09:00:28 +0200 jahier (collect/3_mercury_tr 1.3 640)
> +++ 0.4(w)/mercury_trace_external.c Fri, 29 Oct 1999 11:41:39 +0200 jahier (collect/3_mercury_tr 1.3 640)
>  	static bool    	collect_linked = FALSE;
> +	static bool    	stop_collecting = FALSE;
>  	Integer		debugger_request_type;
>  	Integer		live_var_number;
>  	Word		debugger_request;

Why is the stop_collecting variable declared `static'?

> +			if (stop_collecting) {
> +				(*send_collect_result_ptr)(
> +					(Word) MR_collecting_variable,
> +					(Word) &MR_debugger_socket_out);
> +				external_debugger_mode = MR_reading_request;
> +				#if defined(HAVE_DLFCN_H)&&defined(HAVE_DLCLOSE)
> +					dlclose((void *)handle);
> +				#endif
> +				break;

I detect some duplicate code here;
it might be a good idea to abstract that code out into
a separate function.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list