[m-rev.] diff: improvements for minimal model debugging

Zoltan Somogyi zs at cs.mu.OZ.AU
Tue Mar 9 14:47:42 AEDT 2004


Make debugging of minimal model code easier.

runtime/mercury_debug.c:
	If MR_DEBUG_LABEL_GOAL_PATHS is defined, make MR_print_label print
	the goal path of the label if it is available.

runtime/mercury_conf_param.h:
	Document the new debugging macro MR_DEBUG_LABEL_GOAL_PATHS.

runtime/mercury_minimal_model.c:
	Fix a formatting error in the output: MR_print_label doesn't print a
	newline, MR_printlabel does.

	Since the C code that implements the mdb command "nondet_stack -d"
	has a sanity check requiring the proc layouts of model_non predicates
	to have -1 in the (ignored) field specifying the stackvar storing
	succip, put that value in the proc layouts of the hand-written
	procedures for suspend and resume.

Zoltan.

cvs diff: Diffing .
Index: mercury_conf_param.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_conf_param.h,v
retrieving revision 1.75
diff -u -b -r1.75 mercury_conf_param.h
--- mercury_conf_param.h	21 Jan 2004 02:52:36 -0000	1.75
+++ mercury_conf_param.h	8 Mar 2004 13:30:04 -0000
@@ -224,6 +224,11 @@
 ** 	converted back to a form in which they are usable by a developer.
 ** 	Implied by MR_TABLE_DEBUG and MR_DEBUG_RETRY.
 **
+** MR_DEBUG_LABEL_GOAL_PATHS
+** 	When printing label names, print the goal path of the label as well,
+** 	if this information is available.
+** 	Meaningful only if MR_DEBUG_LABEL_NAMES is defined.
+**
 ** MR_LOWLEVEL_ADDR_DEBUG
 ** 	Enables the printing of raw addresses in debugging output even for
 ** 	things (such as stack slots and labels) that can be identified by more
Index: mercury_debug.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_debug.c,v
retrieving revision 1.19
diff -u -b -r1.19 mercury_debug.c
--- mercury_debug.c	30 Dec 2003 09:51:31 -0000	1.19
+++ mercury_debug.c	8 Mar 2004 13:34:48 -0000
@@ -883,6 +883,12 @@
 		} else {
 			fprintf(fp, "unnamed label %p", internal->i_addr);
 		}
+#ifdef	MR_DEBUG_LABEL_GOAL_PATHS
+		if (internal->i_layout != NULL) {
+			fprintf(fp, " <%s>",
+				MR_label_goal_path(internal->i_layout));
+		}
+#endif
 	} else {
 #ifdef	MR_NEED_ENTRY_LABEL_ARRAY
 		MR_Entry	*entry;
Index: mercury_minimal_model.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_minimal_model.c,v
retrieving revision 1.3
diff -u -b -r1.3 mercury_minimal_model.c
--- mercury_minimal_model.c	3 May 2003 04:49:38 -0000	1.3
+++ mercury_minimal_model.c	8 Mar 2004 13:11:55 -0000
@@ -934,11 +934,9 @@
 
 MR_define_extern_entry(MR_SUSPEND_ENTRY);
 MR_define_extern_entry(MR_RESUME_ENTRY);
-MR_MAKE_PROC_LAYOUT(MR_SUSPEND_ENTRY,
-    MR_DETISM_NON, 0, MR_LONG_LVAL_TYPE_UNKNOWN,
+MR_MAKE_PROC_LAYOUT(MR_SUSPEND_ENTRY, MR_DETISM_NON, 0, -1,
     MR_PREDICATE, "table_builtin", "table_nondet_suspend", 2, 0);
-MR_MAKE_PROC_LAYOUT(MR_RESUME_ENTRY,
-    MR_DETISM_NON, 0, MR_LONG_LVAL_TYPE_UNKNOWN,
+MR_MAKE_PROC_LAYOUT(MR_RESUME_ENTRY, MR_DETISM_NON, 0, -1,
     MR_PREDICATE, "table_builtin", "table_nondet_resume", 1, 0);
 
 MR_BEGIN_MODULE(table_nondet_suspend_resume_module)
@@ -977,12 +975,10 @@
 
 MR_define_extern_entry(MR_table_nondet_commit);
 
-MR_MAKE_PROC_LAYOUT(MR_SUSPEND_ENTRY,
-    MR_DETISM_NON, 0, MR_LONG_LVAL_TYPE_UNKNOWN,
+MR_MAKE_PROC_LAYOUT(MR_SUSPEND_ENTRY, MR_DETISM_NON, 0, -1,
     MR_PREDICATE, "table_builtin", "table_nondet_suspend", 2, 0);
 
-MR_MAKE_PROC_LAYOUT(MR_RESUME_ENTRY,
-    MR_DETISM_NON, 0, MR_LONG_LVAL_TYPE_UNKNOWN,
+MR_MAKE_PROC_LAYOUT(MR_RESUME_ENTRY, MR_DETISM_NON, 0, -1,
     MR_PREDICATE, "table_builtin", "table_nondet_resume", 1, 0);
 MR_MAKE_INTERNAL_LAYOUT_WITH_ENTRY(
     RESUME_LABEL(ChangeLoop), MR_RESUME_ENTRY);
@@ -1241,7 +1237,7 @@
 #ifdef  MR_TABLE_DEBUG
         if (MR_tabledebug) {
             printf("resume info succip ");
-            MR_print_label(stdout, MR_succip);
+            MR_printlabel(stdout, MR_succip);
         }
 #endif  /* MR_TABLE_DEBUG */
 
cvs diff: Diffing GETOPT
cvs diff: Diffing machdeps
--------------------------------------------------------------------------
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