[m-rev.] diff: fix debugger non-GC grade failures

Simon Taylor stayl at cs.mu.OZ.AU
Fri Jun 28 22:18:01 AEST 2002


Estimated hours taken: 0.5
Branches: main

runtime/mercury_trace_base.c:
trace/mercury_trace_vars.c:
browser/io_action.m:
	Fix test failures in non-GC grades on taifun due to
	missing MR_save_transient_hp/MR_restore_transient_hp calls.

trace/mercury_trace_base.h:
	Add a comment that MR_trace_get_action uses the heap pointer.


Index: browser//io_action.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/io_action.m,v
retrieving revision 1.1
diff -u -u -r1.1 io_action.m
--- browser//io_action.m	2002/05/15 11:24:10	1.1
+++ browser//io_action.m	2002/06/28 09:24:34
@@ -92,7 +92,9 @@
 	const char	*problem;
 	const char	*proc_name;
 
+	MR_save_transient_hp();
 	problem = MR_trace_get_action(SeqNum, &proc_name, &IsFunc, &Args);
+	MR_restore_transient_hp();
 	if (problem != NULL) {
 		MR_fatal_error(""pickup_io_action: MR_trace_get_action"");
 	}
Index: runtime/mercury_trace_base.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_trace_base.c,v
retrieving revision 1.42
diff -u -u -r1.42 mercury_trace_base.c
--- runtime/mercury_trace_base.c	2002/05/15 11:24:16	1.42
+++ runtime/mercury_trace_base.c	2002/06/28 09:20:08
@@ -383,12 +383,16 @@
 			table_io_decl->MR_table_io_decl_type_params,
 			answer_block, filtered_arity);
 
+	MR_restore_transient_hp();
 	arg_list = MR_list_empty();
+	MR_save_transient_hp();
 	for (hv = filtered_arity; hv >= 1; hv--) {
 		type_info = MR_create_type_info(type_params,
 			table_io_decl->MR_table_io_decl_ptis[hv - 1]);
+		MR_restore_transient_hp();
 		MR_new_univ_on_hp(arg, type_info, answer_block[hv]);
 		arg_list = MR_list_cons(arg, arg_list);
+		MR_save_transient_hp();
 	}
 
 	MR_free(type_params);
Index: runtime/mercury_trace_base.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_trace_base.h,v
retrieving revision 1.23
diff -u -u -r1.23 mercury_trace_base.h
--- runtime/mercury_trace_base.h	2002/05/15 11:24:16	1.23
+++ runtime/mercury_trace_base.h	2002/06/28 12:08:27
@@ -192,6 +192,8 @@
 ** true iff procedure is a function in *is_func_ptr, and a Mercury
 ** representation of the argument list (minus the IO state arguments)
 ** in *arg_list_ptr.
+** This function uses the heap pointer, so calls to it must be wrapped
+** with MR_save_transient_hp() and MR_restore_transient_hp().
 */
 
 extern	const char
Index: trace/mercury_trace_vars.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_vars.c,v
retrieving revision 1.45
diff -u -u -r1.45 mercury_trace_vars.c
--- trace/mercury_trace_vars.c	2002/06/08 17:43:43	1.45
+++ trace/mercury_trace_vars.c	2002/06/28 09:12:34
@@ -790,6 +790,8 @@
         MR_generate_proc_name_from_layout(proc_layout, &proc_name, &arity,
                 &is_func);
 
+    MR_TRACE_USE_HP(
+
         vars = MR_point.MR_point_vars;
         arg_list = MR_list_empty();
         for (slot = MR_point.MR_point_var_count - 1; slot >= 0; slot--) {
@@ -844,6 +846,7 @@
                 }
             }
         }
+    );
 
         (*browser)(proc_name, arg_list, is_func, caller, format);
         return NULL;
--------------------------------------------------------------------------
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