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

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Mar 6 19:43:37 AEDT 1998


On 06-Mar-1998, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> compiler/Mmakefile:
> library/Mmakefile:
> profiler/Mmakefile:
> runtime/Mmakefile:
> 	Insert EXTRA_MGNUCFLAGS before CFLAGS or EXTRA_CFLAGS
> 	becasue mgnuc stops processing its options when it
> 	encounters a non-mgnuc option.

> runtime/mercury_stack_layout.h:
> 	All the old stack layout definitions from mercury_accurate_gc.h.
> 	Add code for MR_DETERMINSIM_IS_DET_CODE_MODEL.

another misspelling (should be DETERMINISM) ;-)

> +/*
> +** You need to run initialization code for grades without static
> +** code addresses, for profiling, and any time you need to insert
> +** labels into the label table.
> +*/
> +#if defined(MR_STATIC_CODE_ADDRESSES) || defined(PROFILE_CALLS) \
> +	|| defined(DEBUG_LABELS) || defined(MR_INSERT_LABELS)
> +  #define MR_NEED_INITIALIZATION_CODE
> +#endif

Shouldn't that be

	#if !defined(MR_STATIC_CODE_ADDRESSES) || ...
	    ^
	    ^

?

> +/* paste 10 macros together */
> +#define MR_PASTE11(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11) \
> +				MR_PASTE11_2(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11)
> +#define MR_PASTE11_2(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11) \
> +				p1##p2##p3##p4##p5##p6##p7##p8##p9##p10##p11

s/10 macros/11 macros/

> -# please keep the three long lines below in sync
> -case $verbose in true)
> -	echo $CC $ALL_C_INCL_DIRS $ANSI_OPTS $CHECK_OPTS \
> -		$GRADE_OPTS $GC_OPTS \
> +
> +ALL_CC_OPTS="$ANSI_OPTS $CHECK_OPTS $GRADE_OPTS $GC_OPTS	\
>  		$PROF_TIME_OPTS $PROF_CALLS_OPTS $PROF_MEMORY_OPTS \
>  		$INLINE_ALLOC_OPTS $TRAIL_OPTS $SPLIT_OPTS \
> -		$PICREG_OPTS $ARCH_OPTS $ARG_OPTS \
> -		"$@" $OVERRIDE_OPTS ;;
> +		$STACK_TRACE_OPTS $PICREG_OPTS $ARCH_OPTS $ARG_OPTS"
> +
> +case $verbose in true)
> +	echo $CC -I$C_INCL_DIR -I$GC_INCL_DIR \
> +		$ALL_CC_OPTS "$@" $OVERRIDE_OPTS ;;
>  esac
>  case $# in
> -	0) exec $CC $ALL_C_INCL_DIRS $ANSI_OPTS $CHECK_OPTS \
> -		$GRADE_OPTS $GC_OPTS \
> -		$PROF_TIME_OPTS $PROF_CALLS_OPTS $PROF_MEMORY_OPTS \
> -		$INLINE_ALLOC_OPTS $TRAIL_OPTS $SPLIT_OPTS \
> -		$PICREG_OPTS $ARCH_OPTS $ARG_OPTS \
> -		$OVERRIDE_OPTS ;;
> -	*) exec $CC $ALL_C_INCL_DIRS $ANSI_OPTS $CHECK_OPTS \
> -		$GRADE_OPTS $GC_OPTS \
> -		$PROF_TIME_OPTS $PROF_CALLS_OPTS $PROF_MEMORY_OPTS \
> -		$INLINE_ALLOC_OPTS $TRAIL_OPTS $SPLIT_OPTS \
> -		$PICREG_OPTS $ARCH_OPTS $ARG_OPTS \
> -		"$@" $OVERRIDE_OPTS ;;
> +	0) exec $CC -I$C_INCL_DIR -I$GC_INCL_DIR \
> +		$ALL_CC_OPTS $OVERRIDE_OPTS ;;
> +	*) exec $CC -I$C_INCL_DIR -I$GC_INCL_DIR \
> +		$ALL_CC_OPTS "$@" $OVERRIDE_OPTS ;;

It looks like you haven't merged in Zoltan's change (to add
$ALL_C_INCL_DIRS) correctly here.

> /*
> ** mercury_stack_trace.c - implements stack traces.
> **
> ** Main author: Tyson Dowd <trd at cs.mu.oz.au>.
> */

Putting your full email address in here leads to a double-maintenance
problem.  Better to just use `trd', and keep the full address in just
one place (compiler/notes/authors.html).

Otherwise that looks OK, although I want to double-check that you
got all the #ifdefs right.

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