[m-dev.] for review: Stack dumps -- the main course (round 2)

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Mar 7 02:05:27 AEDT 1998


On 06-Mar-1998, Tyson Dowd <trd at stimpy.cs.mu.oz.au> wrote:
> > Otherwise that looks OK, although I want to double-check that you
> > got all the #ifdefs right.
> 
> I'm farily confident, but I wouldn't be shocked if there are some small
> problems.

Speaking of spelling errors... I'm farily confident that I'll find at
least one small problem ;-)

> +#if defined(MR_STACK_TRACE) || defined(NATIVE_GC)
> +  #define MR_USE_STACK_LAYOUTS
> +  #define MR_INSERT_LABELS
> +#endif
> +
> +#if defined(SPEED) && !defined(DEBUG_GOTOS) 
> +  #define MR_INSERT_LABELS
> +#endif

Shouldn't that be

	#if !defined(SPEED) || defined(DEBUG_GOTOS) 
	  #define MR_INSERT_LABELS
	#endif

Also, if you have say both MR_STACK_TRACE and SPEED defined,
then you will #define MR_INSERT_LABELS twice.
That seems a bit dodgy to me, although the various compilers
we have around don't seem to mind it.

mercury_goto.h:
> +#if !defined(MR_INSERT_LABELS)
> +  #define	make_label(n, a, l)	/* nothing */
>  #else
> +  #define	make_label(n, a, l)	make_entry(n, a, l)
>  #endif

It would probably be slightly clearer to invert the condition and to swap the
order of the `then' and the `else' code.

> +#if !defined(MR_INSERT_LABELS) && !defined(PROFILE_CALLS)
> +  #define make_local(n, a, l)	/* nothing */
>  #else 
> +  #define make_local(n, a, l)	make_entry(n, a, l)
>  #endif

Ditto.

> +#if !defined(MR_INSERT_LABELS) && !defined(PROFILE_CALLS) \
> +		&& !defined(DEBUG_LABELS)
> +  #define make_entry(n, a, l)	/* nothing */
>  #else
> +  #define make_entry(n, a, l)	insert_entry(n, a, MR_STACK_LAYOUT(l))
>  #endif

Ditto.

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