[m-dev.] updated diff for tracing

Fergus Henderson fjh at cs.mu.oz.au
Sat Oct 4 16:17:34 AEST 1997


Zoltan Somogyi, you wrote:
> 
> void	MR_trace(MR_trace_port port, MR_trace_code_model model,
> 	int seqno, int depth, const char *modulename, const char *predname,
> 	int arity,
> 	int modenum)
> {
> 	int	i;
> 
> 	fprintf(stderr, "%4d %2d ", seqno, depth);
> 
> 	for (i = 0; i < depth; i++)
> 		putc(' ', stderr);
> 
> 	switch (port)
> 	{
> case MR_PORT_CALL:	fprintf(stderr, "CALL ");
> 			break;
> 
> case MR_PORT_EXIT:	fprintf(stderr, "EXIT ");
> 			break;
> 
> case MR_PORT_FAIL:	fprintf(stderr, "FAIL ");
> 			break;
> 	}
> 
> 	switch (model)
> 	{
> case MR_MODEL_DET:	fprintf(stderr, "DET  ");
> 			break;
> 
> case MR_MODEL_SEMI:	fprintf(stderr, "SEMI ");
> 			break;
> 
> case MR_MODEL_NON:	fprintf(stderr, "NON  ");
> 			break;
> 	}
> 
> 	fprintf(stderr, "%s:%s/%d-%d\n", modulename, predname, arity, modenum);
> }

You didn't fix the code layout issues I mentioned last time.

> #define	MR_trace_incr_seq()	++MR_trace_call_seqno
> #define	MR_trace_incr_depth()	++MR_trace_call_depth
> #define	MR_trace_reset_depth(d)	MR_trace_call_depth = d

Please put the macro bodies in parentheses.

Otherwise that looks fine.

-- 
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.



More information about the developers mailing list