[m-dev.] back out the univ diff in the trace directory

Thomas Conway conway at cs.mu.OZ.AU
Fri Jan 12 10:08:16 AEDT 2001


Hi

Pete's "fix" to the trace directory actually broke the asm_fast grades.
I shouldn't have changed the trace directory in the first place - after
fjh's review, we decided not to use callbacks to construct univs anyway.

I've comitted the following backout.

-- 
 Thomas Conway              Mercurian )O+  
 <conway at cs.mu.oz.au>       Every sword has two edges.

trace/mercury_trace_internal.c:
trace/mercury_trace_external.c:
trace/mercury_trace_declarative.c:
	Back out the changes to call back into mercury to construct
	univs and construct them by hand as we did before.
	These guys slipped though the review earlier.

Index: mercury_trace_declarative.c
===================================================================
RCS file: /home/staff/zs/imp/mercury/trace/mercury_trace_declarative.c,v
retrieving revision 1.38
diff -u -r1.38 mercury_trace_declarative.c
--- mercury_trace_declarative.c	2001/01/11 14:36:29	1.38
+++ mercury_trace_declarative.c	2001/01/11 23:03:13
@@ -47,7 +47,11 @@
 
 #include "mdb.declarative_debugger.h"
 #include "mdb.declarative_execution.h"
-#include "mercury.std_util.h"
+#ifdef MR_HIGHLEVEL_CODE
+  #include "mercury.std_util.h"
+#else
+  #include "std_util.h"
+#endif
 
 #include <errno.h>
 
@@ -1091,7 +1095,13 @@
 			MR_fatal_error(problem);
 		}
 
-		ML_construct_univ((MR_Word) arg_type, arg_value, &arg);
+		MR_TRACE_USE_HP(
+			MR_tag_incr_hp(arg, MR_mktag(0), 2);
+		);
+		MR_field(MR_mktag(0), arg, MR_UNIV_OFFSET_FOR_TYPEINFO) =
+				(MR_Word) arg_type;
+		MR_field(MR_mktag(0), arg, MR_UNIV_OFFSET_FOR_DATA) =
+				arg_value;
 
 		MR_TRACE_CALL_MERCURY(
 			atom = MR_DD_add_trace_atom_arg(atom,
Index: mercury_trace_external.c
===================================================================
RCS file: /home/staff/zs/imp/mercury/trace/mercury_trace_external.c,v
retrieving revision 1.51
diff -u -r1.51 mercury_trace_external.c
--- mercury_trace_external.c	2001/01/11 14:36:30	1.51
+++ mercury_trace_external.c	2001/01/11 23:03:13
@@ -31,7 +31,11 @@
 
 #include "mdb.debugger_interface.h"
 #include "mdb.collect_lib.h"
-#include "mercury.std_util.h"
+#ifdef MR_HIGHLEVEL_CODE
+  #include "mercury.std_util.h"
+#else
+  #include "std_util.h"
+#endif
 
 #include "mercury_deep_copy.h"
 
@@ -1108,8 +1112,14 @@
 			MR_fatal_error(problem);
 		}
 
-		ML_construct_univ((MR_Word) type_info, value, &univ);
+		MR_TRACE_USE_HP(
+			MR_incr_hp(univ, 2);
+		);
 
+		MR_field(MR_mktag(0), univ, MR_UNIV_OFFSET_FOR_TYPEINFO)
+			= (MR_Word) type_info;
+		MR_field(MR_mktag(0), univ, MR_UNIV_OFFSET_FOR_DATA) = value;
+
 		MR_TRACE_USE_HP(
 			var_list = MR_list_cons(univ, var_list);
 		);
@@ -1216,11 +1226,16 @@
 	var_number = MR_get_var_number(debugger_request);
 		/* debugger_request should be of the form: 
 		   current_nth_var(var_number) */
+	MR_TRACE_USE_HP(
+		MR_incr_hp(univ, 2);
+	);
 
 	problem = MR_trace_return_var_info(var_number, NULL,
 			&type_info, &value);
 	if (problem == NULL) {
-		ML_construct_univ((MR_Word) type_info, value, &univ);
+		MR_field(MR_mktag(0), univ, MR_UNIV_OFFSET_FOR_TYPEINFO)
+			= (MR_Word) type_info;
+		MR_field(MR_mktag(0), univ, MR_UNIV_OFFSET_FOR_DATA) = value;
 	} else {
 		/*
 		** Should never occur since we check in the external debugger
Index: mercury_trace_internal.c
===================================================================
RCS file: /home/staff/zs/imp/mercury/trace/mercury_trace_internal.c,v
retrieving revision 1.94
diff -u -r1.94 mercury_trace_internal.c
--- mercury_trace_internal.c	2001/01/11 14:36:30	1.94
+++ mercury_trace_internal.c	2001/01/11 23:03:13
@@ -27,7 +27,6 @@
 #include "mercury_trace_vars.h"
 #include "mercury_trace_readline.h"
 
-#include "mercury.std_util.h"
 #include "mdb.browse.h"
 #include "mdb.program_representation.h"
 
@@ -479,7 +478,10 @@
 		return "missing exception value";
 	}
 
-	ML_unravel_univ(&type_info, exception, &value);
+	type_info = MR_field(MR_mktag(0), exception,
+			MR_UNIV_OFFSET_FOR_TYPEINFO);
+	value = MR_field(MR_mktag(0), exception,
+			MR_UNIV_OFFSET_FOR_DATA);
 
 	(*browser)(type_info, value, caller, format);
 
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list