[m-rev.] for review: extending I/O tabling towards declarative debugging

Mark Brown dougl at cs.mu.OZ.AU
Tue Jan 22 04:20:34 AEDT 2002


Here are some more comments on this change.  I'm yet to fully review the
changes to the compiler directory.

Cheers,
Mark.

On 18-Jan-2002, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> Index: runtime/mercury_stack_layout.h
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/runtime/mercury_stack_layout.h,v
> retrieving revision 1.53
> diff -u -b -r1.53 mercury_stack_layout.h
> --- runtime/mercury_stack_layout.h	2001/12/10 06:50:11	1.53
> +++ runtime/mercury_stack_layout.h	2002/01/14 04:43:27
> @@ -32,6 +32,7 @@
>  #include "mercury_types.h"
>  #include "mercury_std.h"			/* for MR_VARIABLE_SIZED */
>  #include "mercury_tags.h"
> +#include "mercury_type_info.h"			/* for MR_PseudoTypeInfo */
>  
>  /* forward declarations */
>  typedef	struct MR_Proc_Layout_Struct	MR_Proc_Layout;
> @@ -414,6 +415,29 @@
>  */
>  
>  /*
> +** The MR_Table_Io_Decl structure.
> +**
> +** To enable declarative debugging of I/O actions, the compiler generates one
> +** of these structures for each I/O primitive. The compiler transforms the
> +** bodies of those primitives to create a block of memory and fill it in with
> +** (a) a pointer to the primitive's MR_Table_Io_Decl structure and (2) the

s/(a)/(1)/

> Index: runtime/mercury_tabling_macros.h
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/runtime/mercury_tabling_macros.h,v
> retrieving revision 1.6
> diff -u -b -r1.6 mercury_tabling_macros.h
> --- runtime/mercury_tabling_macros.h	2000/12/06 06:05:46	1.6
> +++ runtime/mercury_tabling_macros.h	2002/01/14 10:25:38
> @@ -380,6 +380,18 @@
>  	),								\
>  	((table)->MR_answerblock)[(offset)])
>  
> +#define MR_TABLE_SAVE_ANSWER(table, offset, value, type_info)		\
> +	do {								\
> +		if (MR_tabledebug)					\
> +			printf("saving to answer block: %p -> %p, "	\
> +				"slot %d = %lx\n",			\
> +				table, table->MR_answerblock,		\

The occurrences of 'table' here should be parenthesized.

> +				(int) (offset), (long) (value));	\
> +		(table)->MR_answerblock[offset] =			\
> +			MR_make_permanent((value),			\
> +					(MR_TypeInfo) (type_info));	\
> +	} while(0)
> +
>  #else
>  
>  #define MR_TABLE_CREATE_ANSWER_BLOCK(table, num_slots)	 		\
> @@ -391,11 +403,11 @@
>  #define MR_TABLE_GET_ANSWER(table, offset)				\
>  	((table)->MR_answerblock)[(offset)]
>  
> -#endif
> -
>  #define MR_TABLE_SAVE_ANSWER(table, offset, value, type_info)		\
>  	do {								\
>  		(table)->MR_answerblock[offset] =			\
>  			MR_make_permanent((value),			\
>  					(MR_TypeInfo) (type_info));	\
>  	} while(0)
> +
> +#endif

> Index: trace/mercury_trace_vars.h
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_vars.h,v
> retrieving revision 1.14
> diff -u -b -r1.14 mercury_trace_vars.h
> --- trace/mercury_trace_vars.h	2002/01/12 09:08:15	1.14
> +++ trace/mercury_trace_vars.h	2002/01/14 04:06:56
> @@ -110,11 +110,23 @@
>  /*
>  ** Print the call of the current level as a goal.
>  **
> -** The names are printed to the given file if the file pointer is non-NULL.
> +** The goal is printed to the given file if the file pointer is non-NULL.
>  ** The goal is printed by giving it to the specified browser.
>  */
>  
>  extern	const char	*MR_trace_browse_one_goal(FILE *out,
> +				MR_GoalBrowser browser,
> +				MR_Browse_Caller_Type caller,
> +				MR_Browse_Format format);
> +
> +/*
> +** Print I/O action action_number a goal.

s/a goal/as a goal/

> +**
> +** The goal is printed to the given file if the file pointer is non-NULL.
> +** The goal is printed by giving it to the specified browser.
> +*/
> +
> +extern	const char	*MR_trace_browse_action(FILE *out, int action_number,
>  				MR_GoalBrowser browser,
>  				MR_Browse_Caller_Type caller,
>  				MR_Browse_Format format);
--------------------------------------------------------------------------
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