[m-rev.] diff: fix out-of-range warnings from gcc

Zoltan Somogyi zs at cs.mu.OZ.AU
Fri Nov 19 16:48:48 AEDT 2004


Fix some bugs in my previous diff that optimized away stack slots storing
dummy values that manifested themselves as warnings from the C compiler
about integers too big to fit into 8 or 16 bits being implicitly truncated.
They did not lead to the failure of any test case, since it doesn't matter
whether the debugger gets the values it ignores (I/O states or stores)
from valid stack slots or not.

When generating RTTI for gc and the debugger, the compiler had three places
that generated references to stack slots: the return sites of calls, resume
points, and trace events. The previous diff updated only the first of these.
This diff updates the other two, and ensures there are no more.

Since the debugger needs to know whether a procedure has a pair of I/O state
arguments (e.g. when performing a retry), we add a field to proc layouts
to hold this information.

runtime/mercury_grade.h:
	Increment the debug grade runtime compatibility version number
	to reflect the change in layout structures.

runtime/mercury_stack_layout.h:
	Add an extra field to proc layouts to specify flags. At the moment,
	the only flag says whether the procedure has a pair of I/O state
	arguments.

	Add an extra field to proc layouts to specify the trace level of a
	procedure. This used to be the same as the module's trace level,
	but one of my bug fixes a couple of months ago broke that link.
	We don't yet use this field, but it makes sense to do it at the same
	time as the increment of the compatibility version number.

compiler/continuation_info.m:
	Attach to every description of a live value a description of where
	in the compiler that description was created.

	Rename the type involved to avoid an ambiguity.

	Ignore dummy types when generating resume layouts.

	Add some sanity checks.

	Add new fields to the continuation_info data structure to allow
	stack_layout.m to fill in the new fields in proc layout structures.

compiler/trace.m:
	Do not generate references to dummy values at trace events,
	except at call ports. At those ports, all live variables should
	be in registers.

compiler/stack_layout.m:
	Make the check for whether a value fits into an unsigned 8 bit value
	a direct rather than an indirect one. The indirect one assumed that
	stack slot numbers are all positive, which is now a bad assumption.

	Check for negative stack slot numbers in all RTTI stack slot
	descriptions.

	Fill in the two new slots in proc layout structures.

compiler/layout.m:
	Reserve space for the two new slots in proc layout structures.

compiler/layout_out.m:
	Output the two new slots in proc layout structures.

compiler/code_gen.m:
	Preserve the information needed by stack_layout.m for the two new
	fields.

compiler/llds_out.m:
	Add some code that ensures that we never output an integer constant
	that doesn't fit into the range of its type. Since this code is
	executed many millions of times, it is designed to be enabled only
	when the checking is manually enabled. It is normally off, but I got
	a clean bootcheck in the debug grade (which is the best stress test)
	with it enabled.

compiler/trace_params.m:
	Update a comment.

compiler/code_info.m:
	Export a function for use by trace.m.

compiler/hlds_pred.m:
	Export a predicate for use by stack_layout.m.

compiler/Mercury.options:
	Enable inlining for llds_out.m, to get rid of the sanity checking
	overhead if it is not enabled.

tests/debugger/completion.exp*:
tests/debugger/interpreter.exp*:
tests/debugger/multi_parameter.exp*:
tests/debugger/queens.exp*:
tests/debugger/print_goal.exp*:
tests/debugger/tabled_read.exp*:
tests/debugger/tabled_read_decl.exp*:
tests/debugger/declarative/io_stream_test.exp*:
tests/debugger/declarative/tabled_read_decl.exp*:
	Update these expected output files to not expect dummy values that
	aren't kept anymore.

Zoltan.

cvs diff: Diffing .
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/Mercury.options
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/Mercury.options,v
retrieving revision 1.9
diff -u -b -r1.9 Mercury.options
--- compiler/Mercury.options	7 Oct 2004 07:16:46 -0000	1.9
+++ compiler/Mercury.options	27 Oct 2004 05:30:28 -0000
@@ -16,6 +16,11 @@
 CFLAGS-aditi_backend.rl_code=-O0
 MCFLAGS-aditi_backend.rl_code=--opt-space --trace minimum
 
+# llds_out.m contains some sanity checking code that is usually turned off.
+# However, the cost of checking whether they turned off exceeds the cost of
+# performing them unless inlining is enabled.
+MCFLAGS-ll_backend.llds_out=--inlining
+
 # process_util.m uses `kill' and `struct sigaction' from <signal.h>,
 # which are not available with `--ansi'.
 MGNUCFLAGS-libs.process_util = --no-ansi
Index: compiler/code_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/code_gen.m,v
retrieving revision 1.130
diff -u -b -r1.130 code_gen.m
--- compiler/code_gen.m	19 Jul 2004 03:37:45 -0000	1.130
+++ compiler/code_gen.m	28 Oct 2004 14:02:01 -0000
@@ -332,6 +332,7 @@
 		proc_info_get_initial_instmap(ProcInfo, ModuleInfo, InstMap0),
 		proc_info_headvars(ProcInfo, HeadVars),
 		proc_info_varset(ProcInfo, VarSet),
+		proc_info_argmodes(ProcInfo, ArgModes),
 		proc_info_vartypes(ProcInfo, VarTypes),
 		globals__get_trace_suppress(Globals, TraceSuppress),
 		(
@@ -342,7 +343,6 @@
 		;
 			MaybeGoal = no
 		),
-		IsBeingTraced = bool__not(EffTraceIsNone),
 		NeedsAllNames = eff_trace_needs_all_var_names(PredInfo,
 			ProcInfo, TraceLevel, TraceSuppress),
 		proc_info_get_maybe_deep_profile_info(ProcInfo,
@@ -356,12 +356,14 @@
 			MaybeHLDSDeepInfo = no,
 			MaybeDeepProfInfo = no
 		),
+		EffTraceLevel = eff_trace_level(PredInfo, ProcInfo,
+			TraceLevel),
 		ProcLayout = proc_layout_info(RttiProcLabel, EntryLabel,
 			Detism, TotalSlots, MaybeSuccipSlot, EvalMethod,
-			MaybeTraceCallLabel, MaxTraceReg, HeadVars, MaybeGoal,
-			InstMap0, TraceSlotInfo, ForceProcId, VarSet, VarTypes,
-			InternalMap, MaybeTableInfo, IsBeingTraced,
-			NeedsAllNames, MaybeDeepProfInfo),
+			EffTraceLevel, MaybeTraceCallLabel, MaxTraceReg,
+			HeadVars, ArgModes, MaybeGoal, InstMap0, TraceSlotInfo,
+			ForceProcId, VarSet, VarTypes, InternalMap,
+			MaybeTableInfo, NeedsAllNames, MaybeDeepProfInfo),
 		global_data_add_new_proc_layout(proc(PredId, ProcId),
 			ProcLayout, !GlobalData)
 	;
Index: compiler/code_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/code_info.m,v
retrieving revision 1.293
diff -u -b -r1.293 code_info.m
--- compiler/code_info.m	2 Sep 2004 04:31:34 -0000	1.293
+++ compiler/code_info.m	29 Sep 2004 06:22:28 -0000
@@ -114,6 +114,8 @@
 	% Get the variables for the current procedure.
 :- pred code_info__get_varset(code_info::in, prog_varset::out) is det.
 
+:- func code_info__get_var_types(code_info) = vartypes.
+
 :- pred code_info__get_maybe_trace_info(code_info::in, maybe(trace_info)::out)
 	is det.
 
@@ -745,8 +747,6 @@
 	module_info_pred_info(ModuleInfo, PredId, PredInfo),
 	code_info__get_globals(CI, Globals),
 	body_should_use_typeinfo_liveness(PredInfo, Globals, TypeInfoLiveness).
-
-:- func code_info__get_var_types(code_info) = map(prog_var, type).
 
 code_info__get_var_types(CI) = VarTypes :-
 	code_info__get_proc_info(CI, ProcInfo),
Index: compiler/continuation_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/continuation_info.m,v
retrieving revision 1.54
diff -u -b -r1.54 continuation_info.m
--- compiler/continuation_info.m	14 Jun 2004 04:15:59 -0000	1.54
+++ compiler/continuation_info.m	28 Oct 2004 14:02:25 -0000
@@ -89,6 +89,9 @@
 					% debugger.
 			eval_method	:: eval_method,
 					% Of the procedure.
+			eff_trace_level	:: trace_level,
+					% The effective trace level of the
+					% procedure.
 			call_label	:: maybe(label),
 					% If the trace level is not none,
 					% this contains the label associated
@@ -104,6 +107,8 @@
 					% The head variables, in order,
 					% including the ones introduced by the
 					% compiler.
+			arg_modes	:: list(mode),
+					% The modes of the head variables.
 			maybe_proc_body	:: maybe(hlds_goal),
 					% The body of the procedure, if
 					% required.
@@ -125,9 +130,6 @@
 					% Info for each internal label,
 					% needed for basic_stack_layouts.
 			maybe_table_info :: maybe(proc_table_info),
-			is_being_traced :: bool,
-					% True if the effective trace level
-					% of the procedure is not none.
 			need_all_names	:: bool,
 					% True iff we need the names of all the
 					% variables.
@@ -242,16 +244,19 @@
 	%
 :- type layout_label_info
 	--->	layout_label_info(
-			set(var_info),
+			set(layout_var_info),
 				% live vars and their locations/names
 			map(tvar, set(layout_locn))
 				% locations of polymorphic type vars
 		).
 
-:- type var_info
-	--->	var_info(
+:- type layout_var_info
+	--->	layout_var_info(
 			layout_locn,	% the location of the variable
-			live_value_type % info about the variable
+			live_value_type, 	% info about the variable
+			string			% where in the compiler
+						% this layout_var_info was
+						% created
 		).
 
 :- type closure_layout_info
@@ -348,7 +353,7 @@
 :- import_module libs__options.
 :- import_module ll_backend__code_util.
 
-:- import_module string, require, term, varset.
+:- import_module int, string, require, term, varset.
 
 %-----------------------------------------------------------------------------%
 
@@ -481,12 +486,13 @@
 	map__set(Internals0, ReturnLabelNum, Internal, Internals).
 
 :- pred continuation_info__convert_return_data(list(liveinfo)::in,
-	set(var_info)::out, map(tvar, set(layout_locn))::out) is det.
+	set(layout_var_info)::out, map(tvar, set(layout_locn))::out) is det.
 
 continuation_info__convert_return_data(LiveInfos, VarInfoSet, TypeInfoMap) :-
 	GetVarInfo = (pred(LiveLval::in, VarInfo::out) is det :-
 		LiveLval = live_lvalue(Lval, LiveValueType, _),
-		VarInfo = var_info(Lval, LiveValueType)
+		VarInfo = layout_var_info(Lval, LiveValueType,
+			"convert_return_data")
 	),
 	list__map(GetVarInfo, LiveInfos, VarInfoList),
 	GetTypeInfo = (pred(LiveLval::in, LiveTypeInfoMap::out) is det :-
@@ -621,8 +627,10 @@
 		ProcInfo, ModuleInfo, Layout) :-
 	map__to_assoc_list(ResumeMap, ResumeList),
 	set__init(TVars0),
+	proc_info_vartypes(ProcInfo, VarTypes),
 	continuation_info__generate_resume_layout_for_vars(ResumeList,
-		InstMap, ProcInfo, ModuleInfo, VarInfos, TVars0, TVars),
+		InstMap, VarTypes, ProcInfo, ModuleInfo, [], VarInfos,
+		TVars0, TVars),
 	set__list_to_set(VarInfos, VarInfoSet),
 	set__to_sorted_list(TVars, TVarList),
 	continuation_info__find_typeinfos_for_tvars(TVarList, ResumeMap,
@@ -633,24 +641,32 @@
 	Layout = layout_label_info(AllInfoSet, TVarInfoMap).
 
 :- pred continuation_info__generate_resume_layout_for_vars(
-	assoc_list(prog_var, set(lval))::in, instmap::in, proc_info::in,
-	module_info::in, list(var_info)::out, set(tvar)::in,
-	set(tvar)::out) is det.
+	assoc_list(prog_var, set(lval))::in, instmap::in, vartypes::in,
+	proc_info::in, module_info::in,
+	list(layout_var_info)::in, list(layout_var_info)::out,
+	set(tvar)::in, set(tvar)::out) is det.
 
-continuation_info__generate_resume_layout_for_vars([], _, _, _, [],
-		TVars, TVars).
+continuation_info__generate_resume_layout_for_vars([], _, _, _, _,
+		!VarInfos, !TVars).
 continuation_info__generate_resume_layout_for_vars([Var - LvalSet | VarLvals],
-		InstMap, ProcInfo, ModuleInfo, [VarInfo | VarInfos],
-		TVars0, TVars) :-
+		InstMap, VarTypes, ProcInfo, ModuleInfo, !VarInfos, !TVars) :-
+	(
+		map__lookup(VarTypes, Var, Type),
+		is_dummy_argument_type(Type)
+	->
+		true
+	;
 	continuation_info__generate_resume_layout_for_var(Var, LvalSet,
 		InstMap, ProcInfo, ModuleInfo, VarInfo, TypeVars),
-	set__insert_list(TVars0, TypeVars, TVars1),
+		set__insert_list(!.TVars, TypeVars, !:TVars),
+		!:VarInfos = [VarInfo | !.VarInfos]
+	),
 	continuation_info__generate_resume_layout_for_vars(VarLvals,
-		InstMap, ProcInfo, ModuleInfo, VarInfos, TVars1, TVars).
+		InstMap, VarTypes, ProcInfo, ModuleInfo, !VarInfos, !TVars).
 
 :- pred continuation_info__generate_resume_layout_for_var(prog_var::in,
 	set(lval)::in, instmap::in, proc_info::in, module_info::in,
-	var_info::out, list(tvar)::out) is det.
+	layout_var_info::out, list(tvar)::out) is det.
 
 continuation_info__generate_resume_layout_for_var(Var, LvalSet, InstMap,
 		ProcInfo, ModuleInfo, VarInfo, TypeVars) :-
@@ -660,18 +676,28 @@
 	;
 		error("var has more than one lval in stack resume map")
 	),
+	( Lval = stackvar(N) ->
+		require(N > 0, "generate_resume_layout_for_var: bad stackvar")
+	; Lval = stackvar(N) ->
+		require(N > 0, "generate_resume_layout_for_var: bad framevar")
+	;
+		true
+	),
 	continuation_info__generate_layout_for_var(Var, InstMap, ProcInfo,
 		ModuleInfo, LiveValueType, TypeVars),
-	VarInfo = var_info(direct(Lval), LiveValueType).
+	VarInfo = layout_var_info(direct(Lval), LiveValueType,
+		"generate_result_layout_for_var").
 
 :- pred continuation_info__generate_temp_var_infos(
-	assoc_list(lval, slot_contents)::in, list(var_info)::out) is det.
+	assoc_list(lval, slot_contents)::in, list(layout_var_info)::out)
+	is det.
 
 continuation_info__generate_temp_var_infos([], []).
 continuation_info__generate_temp_var_infos([Temp | Temps], [Live | Lives]) :-
 	Temp = Slot - Contents,
 	continuation_info__live_value_type(Contents, LiveLvalueType),
-	Live = var_info(direct(Slot), LiveLvalueType),
+	Live = layout_var_info(direct(Slot), LiveLvalueType,
+		"generate_temp_var_infos"),
 	continuation_info__generate_temp_var_infos(Temps, Lives).
 
 %---------------------------------------------------------------------------%
Index: compiler/hlds_pred.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_pred.m,v
retrieving revision 1.151
diff -u -b -r1.151 hlds_pred.m
--- compiler/hlds_pred.m	2 Sep 2004 04:31:36 -0000	1.151
+++ compiler/hlds_pred.m	28 Oct 2004 13:57:46 -0000
@@ -1974,6 +1974,10 @@
 :- pred proc_info_has_io_state_pair(module_info::in, proc_info::in,
 	int::out, int::out) is semidet.
 
+:- pred proc_info_has_io_state_pair_from_details(module_info::in,
+	list(prog_var)::in, list(mode)::in, vartypes::in,
+	int::out, int::out) is semidet.
+
 	% Given a procedure table and the id of a procedure in that table,
 	% return a procedure id to be attached to a clone of that procedure.
 	% (The task of creating the clone proc_info and inserting into the
@@ -2543,9 +2547,14 @@
 proc_info_has_io_state_pair(ModuleInfo, ProcInfo, InArgNum, OutArgNum) :-
 	proc_info_headvars(ProcInfo, HeadVars),
 	proc_info_argmodes(ProcInfo, ArgModes),
+	proc_info_vartypes(ProcInfo, VarTypes),
+	proc_info_has_io_state_pair_from_details(ModuleInfo, HeadVars,
+		ArgModes, VarTypes, InArgNum, OutArgNum).
+
+proc_info_has_io_state_pair_from_details(ModuleInfo, HeadVars, ArgModes,
+		VarTypes, InArgNum, OutArgNum) :-
 	assoc_list__from_corresponding_lists(HeadVars, ArgModes,
 		HeadVarsModes),
-	proc_info_vartypes(ProcInfo, VarTypes),
 	proc_info_has_io_state_pair_2(HeadVarsModes, ModuleInfo, VarTypes,
 		1, no, no, MaybeIn, MaybeOut),
 	( MaybeIn = yes(In), MaybeOut = yes(Out) ->
Index: compiler/layout.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/layout.m,v
retrieving revision 1.15
diff -u -b -r1.15 layout.m
--- compiler/layout.m	16 Aug 2004 03:51:01 -0000	1.15
+++ compiler/layout.m	28 Oct 2004 13:41:15 -0000
@@ -167,7 +167,9 @@
 			maybe_trail_slot	:: maybe(int),
 			maybe_maxfr_slot	:: maybe(int),
 			eval_method		:: eval_method,
-			maybe_call_table_slot	:: maybe(int)
+			maybe_call_table_slot	:: maybe(int),
+			eff_trace_level		:: trace_level,
+			exec_trace_flags	:: int
 		).
 
 :- type file_layout_data
Index: compiler/layout_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/layout_out.m,v
retrieving revision 1.37
diff -u -b -r1.37 layout_out.m
--- compiler/layout_out.m	16 Aug 2004 03:51:01 -0000	1.37
+++ compiler/layout_out.m	28 Oct 2004 13:42:26 -0000
@@ -812,7 +812,7 @@
 		MaybeTableInfo, _HeadVarNums, _VarNames, _MaxVarNum,
 		_MaxRegNum, _MaybeFromFullSlot, _MaybeIoSeqSlot,
 		_MaybeTrailSlot, _MaybeMaxfrSlot, _EvalMethod,
-		_MaybeCallTableSlot),
+		_MaybeCallTableSlot, _EffTraceLevel, _Flags),
 	ProcLabel = make_proc_label_from_rtti(RttiProcLabel),
 	ModuleName = get_defining_module_name(ProcLabel) ,
 	output_layout_decl(CallLabelLayout, !DeclSet, !IO),
@@ -838,7 +838,8 @@
 	ExecTrace = proc_layout_exec_trace(CallLabelLayout, MaybeProcBody,
 		MaybeTableInfo, HeadVarNums, _VarNames, MaxVarNum,
 		MaxRegNum, MaybeFromFullSlot, MaybeIoSeqSlot, MaybeTrailSlot,
-		MaybeMaxfrSlot, EvalMethod, MaybeCallTableSlot),
+		MaybeMaxfrSlot, EvalMethod, MaybeCallTableSlot, EffTraceLevel,
+		Flags),
 	io__write_string("\n", !IO),
 	output_layout_name_storage_type_name(
 		proc_layout_exec_trace(RttiProcLabel), yes, !IO),
@@ -900,6 +901,10 @@
 	io__write_string(eval_method_to_c_string(EvalMethod), !IO),
 	io__write_string(",\n", !IO),
 	write_maybe_slot_num(MaybeCallTableSlot, !IO),
+	io__write_string(",\n", !IO),
+	io__write_string(trace_level_rep(EffTraceLevel), !IO),
+	io__write_string(",\n", !IO),
+	io__write_int(Flags, !IO),
 	io__write_string("\n};\n", !IO).
 
 :- pred write_maybe_slot_num(maybe(int)::in, io::di, io::uo) is det.
Index: compiler/llds_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/llds_out.m,v
retrieving revision 1.239
diff -u -b -r1.239 llds_out.m
--- compiler/llds_out.m	2 Sep 2004 04:31:38 -0000	1.239
+++ compiler/llds_out.m	27 Oct 2004 22:43:03 -0000
@@ -2966,7 +2966,7 @@
 		direct_field_int_constant(Type) = yes,
 		Rval = const(int_const(N))
 	->
-		io__write_int(N, !IO)
+		output_int_const(N, Type, !IO)
 	;
 		output_rval_as_type(Rval, Type, !IO)
 	),
@@ -2989,8 +2989,16 @@
 			direct_field_int_constant(Type) = yes,
 			list__map(project_int_constant, Rvals, Ints)
 		->
+			Check = check_int_const_sizes,
+			(
+				Check = no,
 			output_cons_arg_group_ints(Ints, !IO)
 		;
+				Check = yes,
+				output_cons_arg_group_ints_check(Ints, Type,
+					!IO)
+			)
+		;
 			output_cons_arg_group_elements(Type, Rvals, !IO)
 		),
 		io__write_string("}", !IO)
@@ -3000,7 +3008,7 @@
 			direct_field_int_constant(Type) = yes,
 			project_int_constant(Rval, Int)
 		->
-			io__write_int(Int, !IO)
+			output_int_const(Int, Type, !IO)
 		;
 			output_rval_as_type(Rval, Type, !IO)
 		)
@@ -3037,10 +3045,76 @@
 		io__write_string("\n", !IO)
 	).
 
+:- pred output_cons_arg_group_ints_check(list(int)::in, llds_type::in,
+	io::di, io::uo) is det.
+
+output_cons_arg_group_ints_check([], _, !IO).
+output_cons_arg_group_ints_check([Int | Ints], Type, !IO) :-
+	output_int_const(Int, Type, !IO),
+	( Ints \= [] ->
+		io__write_string(",\n", !IO),
+		output_cons_arg_group_ints_check(Ints, Type, !IO)
+	;
+		io__write_string("\n", !IO)
+	).
+
 :- pred project_int_constant(rval::in, int::out) is semidet.
 
 project_int_constant(const(int_const(N)), N).
 
+:- func check_int_const_sizes = bool.
+:- pragma inline(check_int_const_sizes/0).
+
+% If you this to `yes', we will test all integer constants places into static
+% data structures to see if they fit into the space allocated for them.
+
+check_int_const_sizes = no.
+
+:- pred output_int_const(int::in, llds_type::in, io::di, io::uo) is det.
+:- pragma inline(output_int_const/4).
+
+output_int_const(N, Type, !IO) :-
+	Check = check_int_const_sizes,
+	(
+		Check = yes,
+		( ok_int_const(N, Type) ->
+			io__write_int(N, !IO)
+		;
+			error("output_int_const: constant does not fit in type")
+		)
+	;
+		Check = no,
+		io__write_int(N, !IO)
+	).
+
+:- pred ok_int_const(int::in, llds_type::in) is semidet.
+:- pragma inline(ok_int_const/2).
+
+ok_int_const(N, int_least8) :-
+	-128 =< N, N < 128.
+ok_int_const(N, uint_least8) :-
+	0 =< N, N < 256.
+ok_int_const(N, int_least16) :-
+	-32768 =< N, N < 32768.
+ok_int_const(N, uint_least16) :-
+	0 =< N, N < 65536.
+ok_int_const(_N, int_least32).
+ok_int_const(_N, uint_least32).
+ok_int_const(_N, bool) :-
+	error("ok_int_const: not integer constant").
+ok_int_const(_N, integer).
+ok_int_const(_N, unsigned).
+ok_int_const(_, float) :-
+	error("ok_int_const: not integer constant").
+ok_int_const(_, word) :-
+	error("ok_int_const: not integer constant").
+ok_int_const(_, string) :-
+	error("ok_int_const: not integer constant").
+ok_int_const(_, data_ptr) :-
+	error("ok_int_const: not integer constant").
+ok_int_const(_, code_ptr) :-
+	error("ok_int_const: not integer constant").
+
 %-----------------------------------------------------------------------------%
 
 % output_lval_decls(Lval, ...) outputs the declarations of any
@@ -3981,7 +4055,7 @@
 				% a considerably longer lifetime. In debugging
 				% grades, the file size difference can be
 				% very substantial (in the range of megabytes).
-				io__write_int(N, !IO)
+				output_int_const(N, DesiredType, !IO)
 			;
 				% cast value to desired type
 				output_llds_type_cast(DesiredType, !IO),
Index: compiler/stack_layout.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/stack_layout.m,v
retrieving revision 1.95
diff -u -b -r1.95 stack_layout.m
--- compiler/stack_layout.m	20 Oct 2004 09:45:00 -0000	1.95
+++ compiler/stack_layout.m	28 Oct 2004 14:09:21 -0000
@@ -58,6 +58,7 @@
 :- implementation.
 
 :- import_module backend_libs__rtti.
+:- import_module check_hlds__type_util.
 :- import_module hlds__code_model.
 :- import_module hlds__goal_util.
 :- import_module hlds__hlds_data.
@@ -296,10 +297,10 @@
 
 stack_layout__construct_layouts(ProcLayoutInfo, !Info) :-
 	ProcLayoutInfo = proc_layout_info(RttiProcLabel, EntryLabel, _Detism,
-		_StackSlots, _SuccipLoc, _EvalMethod, _MaybeCallLabel,
-		_MaxTraceReg, HeadVars, MaybeGoal, _InstMap, _TraceSlotInfo,
-		ForceProcIdLayout, VarSet, _VarTypes, InternalMap,
-		MaybeTableIoDecl, _IsBeingTraced, _NeedsAllNames,
+		_StackSlots, _SuccipLoc, _EvalMethod, _EffTraceLevel,
+		_MaybeCallLabel, _MaxTraceReg, HeadVars, _ArgModes, MaybeGoal,
+		_InstMap, _TraceSlotInfo, ForceProcIdLayout, VarSet, _VarTypes,
+		InternalMap, MaybeTableIoDecl, _NeedsAllNames,
 		_MaybeDeepProfInfo),
 	map__to_assoc_list(InternalMap, Internals),
 	compute_var_number_map(HeadVars, VarSet, Internals, MaybeGoal,
@@ -500,11 +501,10 @@
 
 stack_layout__construct_proc_layout(ProcLayoutInfo, Kind, VarNumMap, !Info) :-
 	ProcLayoutInfo = proc_layout_info(RttiProcLabel, EntryLabel, Detism,
-		StackSlots, SuccipLoc, EvalMethod, MaybeCallLabel, MaxTraceReg,
-		HeadVars, MaybeGoal, InstMap, TraceSlotInfo,
-		_ForceProcIdLayout, VarSet, VarTypes, _InternalMap,
-		MaybeTableInfo, IsBeingTraced, NeedsAllNames,
-		MaybeProcStatic),
+		StackSlots, SuccipLoc, EvalMethod, EffTraceLevel,
+		MaybeCallLabel, MaxTraceReg, HeadVars, ArgModes, MaybeGoal,
+		InstMap, TraceSlotInfo, _ForceProcIdLayout, VarSet, VarTypes,
+		_InternalMap, MaybeTableInfo, NeedsAllNames, MaybeProcStatic),
 	stack_layout__construct_proc_traversal(EntryLabel, Detism, StackSlots,
 		SuccipLoc, Traversal, !Info),
 	(
@@ -515,14 +515,15 @@
 		stack_layout__get_trace_stack_layout(!.Info, TraceStackLayout),
 		(
 			TraceStackLayout = yes,
-			IsBeingTraced = yes,
+			given_trace_level_is_none(EffTraceLevel) = no,
 			valid_proc_layout(ProcLayoutInfo)
 		->
 			stack_layout__construct_trace_layout(RttiProcLabel,
-				EvalMethod, MaybeCallLabel, MaxTraceReg,
-				HeadVars, MaybeGoal, InstMap, TraceSlotInfo,
-				VarSet, VarTypes, MaybeTableInfo,
-				NeedsAllNames, VarNumMap, ExecTrace, !Info),
+				EvalMethod, EffTraceLevel, MaybeCallLabel,
+				MaxTraceReg, HeadVars, ArgModes, MaybeGoal,
+				InstMap, TraceSlotInfo, VarSet, VarTypes,
+				MaybeTableInfo, NeedsAllNames, VarNumMap,
+				ExecTrace, !Info),
 			MaybeExecTrace = yes(ExecTrace)
 		;
 			MaybeExecTrace = no
@@ -547,25 +548,26 @@
 	).
 
 :- pred stack_layout__construct_trace_layout(rtti_proc_label::in,
-	eval_method::in, maybe(label)::in, int::in, list(prog_var)::in,
-	maybe(hlds_goal)::in, instmap::in, trace_slot_info::in, prog_varset::in,
-	vartypes::in, maybe(proc_table_info)::in, bool::in,
-	var_num_map::in, proc_layout_exec_trace::out,
+	eval_method::in, trace_level::in, maybe(label)::in, int::in,
+	list(prog_var)::in, list(mode)::in, maybe(hlds_goal)::in,
+	instmap::in, trace_slot_info::in, prog_varset::in, vartypes::in,
+	maybe(proc_table_info)::in, bool::in, var_num_map::in,
+	proc_layout_exec_trace::out,
 	stack_layout_info::in, stack_layout_info::out) is det.
 
-stack_layout__construct_trace_layout(RttiProcLabel, EvalMethod, MaybeCallLabel,
-		MaxTraceReg, HeadVars, MaybeGoal, InstMap, TraceSlotInfo,
-		_VarSet, VarTypes, MaybeTableInfo, NeedsAllNames, VarNumMap,
-		ExecTrace, !Info) :-
+stack_layout__construct_trace_layout(RttiProcLabel, EvalMethod, EffTraceLevel,
+		MaybeCallLabel, MaxTraceReg, HeadVars, ArgModes,
+		MaybeGoal, InstMap, TraceSlotInfo, _VarSet, VarTypes,
+		MaybeTableInfo, NeedsAllNames, VarNumMap, ExecTrace, !Info) :-
 	stack_layout__construct_var_name_vector(VarNumMap,
 		NeedsAllNames, MaxVarNum, VarNameVector, !Info),
 	list__map(convert_var_to_int(VarNumMap), HeadVars, HeadVarNumVector),
+	ModuleInfo = !.Info ^ module_info,
 	(
 		MaybeGoal = no,
 		MaybeProcRepRval = no
 	;
 		MaybeGoal = yes(Goal),
-		ModuleInfo = !.Info ^ module_info,
 		prog_rep__represent_proc(HeadVars, Goal, InstMap, VarTypes,
 			ModuleInfo, ProcRep),
 		type_to_univ(ProcRep, ProcRepUniv),
@@ -607,11 +609,26 @@
 			MaybeTableName = yes(table_gen_info(RttiProcLabel))
 		)
 	),
+	encode_exec_trace_flags(ModuleInfo, HeadVars, ArgModes, VarTypes,
+		0, Flags),
 	ExecTrace = proc_layout_exec_trace(CallLabelLayout, MaybeProcRepRval,
 		MaybeTableName, HeadVarNumVector, VarNameVector,
 		MaxVarNum, MaxTraceReg, MaybeFromFullSlot, MaybeIoSeqSlot,
 		MaybeTrailSlots, MaybeMaxfrSlot, EvalMethod,
-		MaybeCallTableSlot).
+		MaybeCallTableSlot, EffTraceLevel, Flags).
+
+:- pred encode_exec_trace_flags(module_info::in, list(prog_var)::in,
+	list(mode)::in, vartypes::in, int::in, int::out) is det.
+
+encode_exec_trace_flags(ModuleInfo, HeadVars, ArgModes, VarTypes, !Flags) :-
+	(
+		proc_info_has_io_state_pair_from_details(ModuleInfo, HeadVars, ArgModes,
+			VarTypes, _, _)
+	->
+		!:Flags = !.Flags + 1
+	;
+		true
+	).
 
 :- pred stack_layout__construct_var_name_vector(var_num_map::in,
 	bool::in, int::out, list(int)::out,
@@ -732,7 +749,7 @@
 	LabelLayout = layout_label_info(VarInfoSet, _),
 	VarInfos = set__to_sorted_list(VarInfoSet),
 	FindVar = (pred(VarInfo::in, Var - Name::out) is semidet :-
-		VarInfo = var_info(_, LiveValueType),
+		VarInfo = layout_var_info(_, LiveValueType, _),
 		LiveValueType = var(Var, Name, _, _)
 	),
 	list__filter_map(FindVar, VarInfos, VarsNames),
@@ -880,7 +897,8 @@
 		MaybeVarInfo = no,
 		LabelVars = label_has_no_var_info
 	;
-			% XXX ignore differences in insts inside var_infos
+			% XXX ignore differences in insts inside
+			% layout_var_infos
 		set__union(TraceLiveVarSet, ResumeLiveVarSet, LiveVarSet0),
 		set__union(LiveVarSet0, ReturnLiveVarSet, LiveVarSet),
 		map__union(set__intersect, TraceTypeVarMap, ResumeTypeVarMap,
@@ -923,7 +941,7 @@
 
 %---------------------------------------------------------------------------%
 
-:- pred stack_layout__construct_livelval_rvals(set(var_info)::in,
+:- pred stack_layout__construct_livelval_rvals(set(layout_var_info)::in,
 	var_num_map::in, map(tvar, set(layout_locn))::in, int::out,
 	rval::out, rval::out, rval::out,
 	stack_layout_info::in, stack_layout_info::out) is det.
@@ -965,20 +983,20 @@
 
 %---------------------------------------------------------------------------%
 
-	% Given a list of var_infos and the type variables that occur in them,
-	% select only the var_infos that may be required by up-level printing
-	% in the trace-based debugger. At the moment the typeinfo list we
-	% return may be bigger than necessary, but this does not compromise
-	% correctness; we do this to avoid having to scan the types of all
-	% the selected var_infos.
+	% Given a list of layout_var_infos and the type variables that occur
+	% in them, select only the layout_var_infos that may be required
+	% by up-level printing in the trace-based debugger. At the moment
+	% the typeinfo list we return may be bigger than necessary, but this
+	% does not compromise correctness; we do this to avoid having to
+	% scan the types of all the selected layout_var_infos.
 
 :- pred stack_layout__select_trace_return(
-	list(var_info)::in, map(tvar, set(layout_locn))::in,
-	list(var_info)::out, map(tvar, set(layout_locn))::out) is det.
+	list(layout_var_info)::in, map(tvar, set(layout_locn))::in,
+	list(layout_var_info)::out, map(tvar, set(layout_locn))::out) is det.
 
 stack_layout__select_trace_return(Infos, TVars, TraceReturnInfos, TVars) :-
 	IsNamedReturnVar = (pred(LocnInfo::in) is semidet :-
-		LocnInfo = var_info(Locn, LvalType),
+		LocnInfo = layout_var_info(Locn, LvalType, _),
 		LvalType = var(_, Name, _, _),
 		Name \= "",
 		( Locn = direct(Lval) ; Locn = indirect(Lval, _)),
@@ -986,7 +1004,7 @@
 	),
 	list__filter(IsNamedReturnVar, Infos, TraceReturnInfos).
 
-	% Given a list of var_infos, put the ones that tracing can be
+	% Given a list of layout_var_infos, put the ones that tracing can be
 	% interested in (whether at an internal port or for uplevel printing)
 	% in a block at the start, and both this block and the remaining
 	% block. The division into two blocks can make the job of the
@@ -995,19 +1013,19 @@
 	% blocks makes it more likely that different labels' layout structures
 	% will have common parts (e.g. name vectors).
 
-:- pred stack_layout__sort_livevals(list(var_info)::in, list(var_info)::out)
-	is det.
+:- pred stack_layout__sort_livevals(list(layout_var_info)::in,
+	list(layout_var_info)::out) is det.
 
 stack_layout__sort_livevals(OrigInfos, FinalInfos) :-
 	IsNamedVar = (pred(LvalInfo::in) is semidet :-
-		LvalInfo = var_info(_Lval, LvalType),
+		LvalInfo = layout_var_info(_Lval, LvalType, _),
 		LvalType = var(_, Name, _, _),
 		Name \= ""
 	),
 	list__filter(IsNamedVar, OrigInfos, NamedVarInfos0, OtherInfos0),
 	CompareVarInfos = (pred(Var1::in, Var2::in, Result::out) is det :-
-		Var1 = var_info(Lval1, LiveType1),
-		Var2 = var_info(Lval2, LiveType2),
+		Var1 = layout_var_info(Lval1, LiveType1, _),
+		Var2 = layout_var_info(Lval2, LiveType2, _),
 		stack_layout__get_name_from_live_value_type(LiveType1, Name1),
 		stack_layout__get_name_from_live_value_type(LiveType2, Name2),
 		compare(NameResult, Name1, Name2),
@@ -1088,7 +1106,7 @@
 	% Construct a vector of (locn, live_value_type) pairs,
 	% and a corresponding vector of variable names.
 
-:- pred stack_layout__construct_liveval_arrays(list(var_info)::in,
+:- pred stack_layout__construct_liveval_arrays(list(layout_var_info)::in,
 	var_num_map::in, int::out, rval::out, rval::out,
 	stack_layout_info::in, stack_layout_info::out) is det.
 
@@ -1154,7 +1172,7 @@
 
 associate_type(LldsType, Rval, Rval - LldsType).
 
-:- pred stack_layout__construct_liveval_array_infos(list(var_info)::in,
+:- pred stack_layout__construct_liveval_array_infos(list(layout_var_info)::in,
 	var_num_map::in, int::in, int::in,
 	list(liveval_array_info)::out, list(liveval_array_info)::out,
 	stack_layout_info::in, stack_layout_info::out) is det.
@@ -1162,12 +1180,22 @@
 stack_layout__construct_liveval_array_infos([], _, _, _, [], [], !Info).
 stack_layout__construct_liveval_array_infos([VarInfo | VarInfos], VarNumMap,
 		BytesSoFar, BytesLimit, IntVars, ByteVars, !Info) :-
-	VarInfo = var_info(Locn, LiveValueType),
+	VarInfo = layout_var_info(Locn, LiveValueType, _),
 	stack_layout__represent_live_value_type(LiveValueType, TypeRval,
 		TypeRvalType, !Info),
 	stack_layout__construct_liveval_num_rval(VarNumMap, VarInfo,
 		VarNumRval, !Info),
 	(
+		LiveValueType = var(_, _, Type, _),
+		is_dummy_argument_type(Type),
+		% We want to preserve I/O states in registers
+		\+ (
+			Locn = direct(reg(_, _))
+		)
+	->
+		error("construct_liveval_array_infos: " ++
+			"unexpected reference to dummy value")
+	;
 		BytesSoFar < BytesLimit,
 		stack_layout__represent_locn_as_byte(Locn, LocnByteRval)
 	->
@@ -1188,11 +1216,11 @@
 	).
 
 :- pred stack_layout__construct_liveval_num_rval(var_num_map::in,
-	var_info::in, rval::out,
+	layout_var_info::in, rval::out,
 	stack_layout_info::in, stack_layout_info::out) is det.
 
-stack_layout__construct_liveval_num_rval(VarNumMap, var_info(_, LiveValueType),
-		VarNumRval, !Info) :-
+stack_layout__construct_liveval_num_rval(VarNumMap,
+		layout_var_info(_, LiveValueType, _), VarNumRval, !Info) :-
 	( LiveValueType = var(Var, _, _, _) ->
 		stack_layout__convert_var_to_int(VarNumMap, Var, VarNum),
 		VarNumRval = const(int_const(VarNum))
@@ -1437,12 +1465,12 @@
 	stack_layout__make_tagged_word(lval_r_reg, Num, Word).
 stack_layout__represent_lval(reg(f, Num), Word) :-
 	stack_layout__make_tagged_word(lval_f_reg, Num, Word).
-
 stack_layout__represent_lval(stackvar(Num), Word) :-
+	require(Num > 0, "stack_layout__represent_lval: bad stackvar"),
 	stack_layout__make_tagged_word(lval_stackvar, Num, Word).
 stack_layout__represent_lval(framevar(Num), Word) :-
+	require(Num > 0, "stack_layout__represent_lval: bad framevar"),
 	stack_layout__make_tagged_word(lval_framevar, Num, Word).
-
 stack_layout__represent_lval(succip, Word) :-
 	stack_layout__make_tagged_word(lval_succip, 0, Word).
 stack_layout__represent_lval(maxfr, Word) :-
@@ -1538,6 +1566,8 @@
 stack_layout__represent_locn_as_byte(LayoutLocn, Rval) :-
 	LayoutLocn = direct(Lval),
 	stack_layout__represent_lval_as_byte(Lval, Byte),
+	0 =< Byte,
+	Byte < 256,
 	Rval = const(int_const(Byte)).
 
 	% Construct a representation of an lval in a byte, if possible.
@@ -1545,13 +1575,14 @@
 :- pred stack_layout__represent_lval_as_byte(lval::in, int::out) is semidet.
 
 stack_layout__represent_lval_as_byte(reg(r, Num), Byte) :-
+	require(Num > 0, "stack_layout__represent_lval_as_byte: bad reg"),
 	stack_layout__make_tagged_byte(0, Num, Byte).
-
 stack_layout__represent_lval_as_byte(stackvar(Num), Byte) :-
+	require(Num > 0, "stack_layout__represent_lval_as_byte: bad stackvar"),
 	stack_layout__make_tagged_byte(1, Num, Byte).
 stack_layout__represent_lval_as_byte(framevar(Num), Byte) :-
+	require(Num > 0, "stack_layout__represent_lval_as_byte: bad framevar"),
 	stack_layout__make_tagged_byte(2, Num, Byte).
-
 stack_layout__represent_lval_as_byte(succip, Byte) :-
 	stack_layout__locn_type_code(lval_succip, Val),
 	stack_layout__make_tagged_byte(3, Val, Byte).
@@ -1568,12 +1599,9 @@
 	stack_layout__locn_type_code(lval_sp, Val),
 	stack_layout__make_tagged_byte(3, Val, Byte).
 
-:- pred stack_layout__make_tagged_byte(int::in, int::in, int::out) is semidet.
+:- pred stack_layout__make_tagged_byte(int::in, int::in, int::out) is det.
 
 stack_layout__make_tagged_byte(Tag, Value, TaggedValue) :-
-	Limit = 1 << (stack_layout__byte_bits -
-		stack_layout__short_lval_tag_bits),
-	Value < Limit,
 	TaggedValue is unchecked_left_shift(Value,
 		stack_layout__short_lval_tag_bits) + Tag.
 
Index: compiler/trace.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/trace.m,v
retrieving revision 1.68
diff -u -b -r1.68 trace.m
--- compiler/trace.m	2 Sep 2004 04:31:39 -0000	1.68
+++ compiler/trace.m	11 Nov 2004 06:51:23 -0000
@@ -797,10 +797,11 @@
 			error("bad nondet pragma port")
 		)
 	),
+	VarTypes = code_info__get_var_types(!.CI),
 	code_info__get_varset(!.CI, VarSet),
 	code_info__get_instmap(!.CI, InstMap),
-	trace__produce_vars(LiveVars, VarSet, InstMap, set__init, TvarSet,
-		VarInfoList, ProduceCode, !CI),
+	trace__produce_vars(LiveVars, VarSet, VarTypes, InstMap, Port,
+		set__init, TvarSet, [], VarInfoList, ProduceCode, !CI),
 	code_info__max_reg_in_use(!.CI, MaxReg),
 	code_info__get_max_reg_in_use_at_trace(!.CI, MaxTraceReg0),
 	( MaxTraceReg0 < MaxReg ->
@@ -867,9 +868,9 @@
 		]),
 	Code = tree(ProduceCode, TraceCode).
 
-:- func find_lval_in_var_info(var_info) = lval.
+:- func find_lval_in_var_info(layout_var_info) = lval.
 
-find_lval_in_var_info(var_info(LayoutLocn, _)) =
+find_lval_in_var_info(layout_var_info(LayoutLocn, _, _)) =
 	find_lval_in_layout_locn(LayoutLocn).
 
 :- func find_lval_in_layout_locn(layout_locn) = lval.
@@ -905,20 +906,27 @@
 		Code = empty
 	).
 
-:- pred trace__produce_vars(list(prog_var)::in, prog_varset::in, instmap::in,
-	set(tvar)::in, set(tvar)::out, list(var_info)::out, code_tree::out,
-	code_info::in, code_info::out) is det.
-
-trace__produce_vars([], _, _, Tvars, Tvars, [], empty, !CI).
-trace__produce_vars([Var | Vars], VarSet, InstMap, Tvars0, Tvars,
-		[VarInfo | VarInfos], tree(VarCode, VarsCode), !CI) :-
-	trace__produce_var(Var, VarSet, InstMap, Tvars0, Tvars1,
+:- pred trace__produce_vars(list(prog_var)::in, prog_varset::in, vartypes::in,
+	instmap::in, trace_port::in, set(tvar)::in, set(tvar)::out,
+	list(layout_var_info)::in, list(layout_var_info)::out,
+	code_tree::out, code_info::in, code_info::out) is det.
+
+trace__produce_vars([], _, _, _, _, !TVars, !VarInfos, empty, !CI).
+trace__produce_vars([Var | Vars], VarSet, VarTypes, InstMap, Port,
+		!TVars, !VarInfos, tree(VarCode, VarsCode), !CI) :-
+	map__lookup(VarTypes, Var, Type),
+	( is_dummy_argument_type(Type) ->
+		VarCode = empty
+	;
+		trace__produce_var(Var, VarSet, InstMap, !TVars,
 		VarInfo, VarCode, !CI),
-	trace__produce_vars(Vars, VarSet, InstMap, Tvars1, Tvars,
-		VarInfos, VarsCode, !CI).
+		!:VarInfos = [VarInfo | !.VarInfos]
+	),
+	trace__produce_vars(Vars, VarSet, VarTypes, InstMap, Port, !TVars,
+		!VarInfos, VarsCode, !CI).
 
 :- pred trace__produce_var(prog_var::in, prog_varset::in, instmap::in,
-	set(tvar)::in, set(tvar)::out, var_info::out, code_tree::out,
+	set(tvar)::in, set(tvar)::out, layout_var_info::out, code_tree::out,
 	code_info::in, code_info::out) is det.
 
 trace__produce_var(Var, VarSet, InstMap, !Tvars, VarInfo, VarCode, !CI) :-
@@ -937,7 +945,7 @@
 		LldsInst = partial(Inst)
 	),
 	LiveType = var(Var, Name, Type, LldsInst),
-	VarInfo = var_info(direct(Lval), LiveType),
+	VarInfo = layout_var_info(direct(Lval), LiveType, "trace"),
 	type_util__real_vars(Type, TypeVars),
 	set__insert_list(!.Tvars, TypeVars, !:Tvars).
 
Index: compiler/trace_params.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/trace_params.m,v
retrieving revision 1.17
diff -u -b -r1.17 trace_params.m
--- compiler/trace_params.m	23 May 2004 22:16:44 -0000	1.17
+++ compiler/trace_params.m	28 Oct 2004 08:14:00 -0000
@@ -115,7 +115,8 @@
 	% use for compiler-generated unify, index and compare predicates.
 :- func trace_level_for_unify_compare(trace_level) = trace_level.
 
-	% This is used to represent the trace level in the module layout.
+	% This is used to represent the trace level in the module layout
+	% and in proc layouts.
 :- func trace_level_rep(trace_level) = string.
 
 :- func encode_suppressed_events(trace_suppress_items) = int.
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
cvs diff: Diffing extras/graphics/mercury_glut
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/gears
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing java
cvs diff: Diffing java/runtime
cvs diff: Diffing library
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
Index: runtime/mercury_grade.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_grade.h,v
retrieving revision 1.56
diff -u -b -r1.56 mercury_grade.h
--- runtime/mercury_grade.h	16 Aug 2004 03:51:09 -0000	1.56
+++ runtime/mercury_grade.h	28 Oct 2004 08:07:53 -0000
@@ -60,7 +60,7 @@
 */
 
 #define MR_GRADE_PART_0	v13_
-#define MR_GRADE_EXEC_TRACE_VERSION_NO	2
+#define MR_GRADE_EXEC_TRACE_VERSION_NO	3
 #define MR_GRADE_DEEP_PROF_VERSION_NO	1
 
 #ifdef MR_HIGHLEVEL_CODE
Index: runtime/mercury_stack_layout.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_stack_layout.h,v
retrieving revision 1.86
diff -u -b -r1.86 mercury_stack_layout.h
--- runtime/mercury_stack_layout.h	20 Oct 2004 09:45:10 -0000	1.86
+++ runtime/mercury_stack_layout.h	28 Oct 2004 08:15:14 -0000
@@ -757,6 +757,17 @@
 ** We cannot put enums into structures as bit fields. To avoid wasting space,
 ** we put MR_EvalMethodInts into structures instead of MR_EvalMethods
 ** themselves.
+**
+** If the procedure is compiled with some form of tabling, the maybe_call_table
+** field contains the number of the stack slot through which we can reach the
+** call table entry for this call. In forms of tabling which associate a C
+** structure (MR_Subgoal, MR_MemoNonRecord) with a call table entry, the slot
+** will point to that structure; in other forms of tabling, it will point
+** to the call's MR_TableNode.
+**
+** The flags field encodes boolean properties of the procedure. For now,
+** the only property is whether the procedure has a pair of I/O state
+** arguments.
 */
 
 typedef	enum {
@@ -773,6 +784,15 @@
 
 typedef	MR_int_least8_t		MR_EvalMethodInt;
 
+typedef	enum {
+	MR_TRACELEVEL_NONE,
+	MR_TRACELEVEL_SHALLOW,
+	MR_TRACELEVEL_DEEP,
+	MR_TRACELEVEL_DECL_REP
+} MR_TraceLevel;
+
+typedef	MR_int_least8_t		MR_TraceLevelInt;
+
 typedef	struct MR_Exec_Trace_Struct {
 	const MR_Label_Layout	*MR_exec_call_label;
 	const MR_Module_Layout	*MR_exec_module_layout;
@@ -790,6 +810,8 @@
 	MR_int_least8_t		MR_exec_maybe_maxfr;
 	MR_EvalMethodInt	MR_exec_eval_method_CAST_ME;
 	MR_int_least8_t		MR_exec_maybe_call_table;
+	MR_TraceLevelInt	MR_exec_trace_level_CAST_ME;
+	MR_uint_least8_t	MR_exec_flags;
 	const MR_Label_Layout	**MR_exec_label_layout;
 } MR_Exec_Trace;
 
@@ -802,6 +824,8 @@
 		max_mr_num = MR_max(max_r_num, MR_FIRST_UNREAL_R_SLOT); \
 	} while (0)
 
+#define	MR_PROC_LAYOUT_FLAG_HAS_IO_STATE_PAIR	0x1
+
 /*-------------------------------------------------------------------------*/
 /*
 ** Definitions for MR_Proc_Layout
@@ -912,6 +936,14 @@
 #define	MR_sle_eval_method(proc_layout_ptr)				\
 			((MR_EvalMethod) (proc_layout_ptr)->		\
 				MR_sle_exec_trace->MR_exec_eval_method_CAST_ME)
+
+#define	MR_sle_trace_level(proc_layout_ptr)				\
+	((MR_TraceLevel) (proc_layout_ptr)->				\
+		MR_sle_exec_trace->MR_exec_trace_level_CAST_ME)
+
+#define	MR_proc_has_io_state_pair(proc_layout_ptr)			\
+	((proc_layout_ptr)->MR_sle_exec_trace->MR_exec_flags		\
+		& MR_PROC_LAYOUT_FLAG_HAS_IO_STATE_PAIR)
 
 	/* Adjust the arity of functions for printing. */
 #define MR_sle_user_adjusted_arity(entry)				\
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
Index: tests/debugger/completion.exp
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/debugger/completion.exp,v
retrieving revision 1.21
diff -u -b -r1.21 completion.exp
--- tests/debugger/completion.exp	22 Sep 2004 03:45:33 -0000	1.21
+++ tests/debugger/completion.exp	19 Nov 2004 00:09:27 -0000
@@ -35,10 +35,10 @@
      Prints the names of all the known variables in the current
      environment, together with an ordinal number for each variable.
 mdb> 
-*          --pretty   -f         -v         exception  
---flat     --verbose  -p         DCG_0      goal       
-p --flat DCG_0 
-       DCG_0 (arg 1)          	state('<<c_pointer>>')
+*          --pretty   -f         -v         goal       
+--flat     --verbose  -p         exception  
+p --flat D
+mdb: there is no such variable.
 mdb> 
 stack       stack_regs  
 stack --detailed 
Index: tests/debugger/interpreter.exp2
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/debugger/interpreter.exp2,v
retrieving revision 1.18
diff -u -b -r1.18 interpreter.exp2
--- tests/debugger/interpreter.exp2	16 Nov 2004 00:16:39 -0000	1.18
+++ tests/debugger/interpreter.exp2	19 Nov 2004 00:08:55 -0000
@@ -15,11 +15,9 @@
 mdb> vars
         1 File (arg 1)
         2 Database0 (arg 2)
-        3 DCG_0 (arg 4)
 mdb> print *
        File (arg 1)           	"interpreter.m"
        Database0 (arg 2)      	[]
-       DCG_0 (arg 4)          	state('<<c_pointer>>')
 mdb> b database_assert_clause
  0: + stop  interface pred interpreter.database_assert_clause/4-0 (det)
 mdb> c
Index: tests/debugger/multi_parameter.exp
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/debugger/multi_parameter.exp,v
retrieving revision 1.12
diff -u -b -r1.12 multi_parameter.exp
--- tests/debugger/multi_parameter.exp	17 Jan 2003 05:56:54 -0000	1.12
+++ tests/debugger/multi_parameter.exp	28 Oct 2004 07:47:39 -0000
@@ -41,5 +41,5 @@
        8:      1  1 EXIT pred multi_parameter.main/2-0 (det)
                          multi_parameter.m:23
 mdb> print *
-       DCG_2 (arg 2)          	state('<<c_pointer>>')
+mdb: there are no live variables.
 mdb> continue -S
Index: tests/debugger/print_goal.exp
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/debugger/print_goal.exp,v
retrieving revision 1.7
diff -u -b -r1.7 print_goal.exp
--- tests/debugger/print_goal.exp	16 Nov 2004 00:16:39 -0000	1.7
+++ tests/debugger/print_goal.exp	19 Nov 2004 00:09:11 -0000
@@ -24,9 +24,8 @@
         2 _W (arg 2)
         3 X (arg 3)
         4 Y (arg 6)
-        5 DCG_0 (arg 8)
 mdb> p goal
-print_goal(yes, 100, 101, _, _, 102, _, state(<<c_pointer>>), _)
+print_goal(yes, 100, 101, _, _, 102, _, _, _)
 mdb> finish
       E5:     C3 EXIT pred print_goal.print_goal/9-0 (det)
 mdb> v
@@ -37,9 +36,8 @@
         5 HeadVar__5
         6 Y (arg 6)
         7 HeadVar__7
-        8 DCG_1 (arg 9)
 mdb> p goal
-print_goal(yes, 100, 101, 102, 103, 102, 103, _, state(<<c_pointer>>))
+print_goal(yes, 100, 101, 102, 103, 102, 103, _, _)
 mdb> c
 103.
 103.
@@ -49,7 +47,6 @@
         2 _W (arg 2)
         3 X (arg 3)
         4 Y (arg 6)
-        5 DCG_0 (arg 8)
 mdb> finish
       E7:     C4 EXIT pred print_goal.print_goal/9-0 (det)
 mdb> v
@@ -60,7 +57,6 @@
         5 HeadVar__5
         6 Y (arg 6)
         7 HeadVar__7
-        8 DCG_1 (arg 9)
 mdb> c
 104.
 104.
Index: tests/debugger/queens.exp
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/debugger/queens.exp,v
retrieving revision 1.28
diff -u -b -r1.28 queens.exp
--- tests/debugger/queens.exp	16 Nov 2004 00:16:39 -0000	1.28
+++ tests/debugger/queens.exp	19 Nov 2004 00:09:53 -0000
@@ -5,7 +5,7 @@
 mdb> retry 1
 not that many ancestors
 mdb> print *
-       DCG_0 (arg 1)          	state('<<c_pointer>>')
+mdb: there are no live variables.
 mdb> b data
  0: + stop  interface pred queens.data/1-0 (det)
 mdb> continue
Index: tests/debugger/queens.exp2
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/debugger/queens.exp2,v
retrieving revision 1.9
diff -u -b -r1.9 queens.exp2
--- tests/debugger/queens.exp2	16 Nov 2004 00:16:40 -0000	1.9
+++ tests/debugger/queens.exp2	19 Nov 2004 03:24:32 -0000
@@ -5,7 +5,7 @@
 mdb> retry 1
 not that many ancestors
 mdb> print *
-       DCG_0 (arg 1)          	state('<<c_pointer>>')
+mdb: there are no live variables.
 mdb> b data
  0: + stop  interface pred queens.data/1-0 (det)
 mdb> continue
Index: tests/debugger/tabled_read.exp
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/debugger/tabled_read.exp,v
retrieving revision 1.9
diff -u -b -r1.9 tabled_read.exp
--- tests/debugger/tabled_read.exp	16 Nov 2004 00:16:40 -0000	1.9
+++ tests/debugger/tabled_read.exp	19 Nov 2004 00:10:01 -0000
@@ -19,20 +19,17 @@
        Stream (arg 1)         	'<<c_pointer>>'
        SoFar (arg 2)          	0
        N (arg 3)              	123
-       DCG_2 (arg 5)          	state('<<c_pointer>>')
 mdb> retry -o -a
       E2:     C2 CALL pred tabled_read.test/5-0 (det)
 mdb> print *
        Stream (arg 1)         	'<<c_pointer>>'
        SoFar (arg 2)          	0
-       DCG_0 (arg 4)          	state('<<c_pointer>>')
 mdb> finish -n
       E3:     C2 EXIT pred tabled_read.test/5-0 (det)
 mdb> print *
        Stream (arg 1)         	'<<c_pointer>>'
        SoFar (arg 2)          	0
        N (arg 3)              	123
-       DCG_2 (arg 5)          	state('<<c_pointer>>')
 mdb> table_io end
 I/O tabling stopped.
 mdb> continue
@@ -45,7 +42,6 @@
        Stream (arg 1)         	'<<c_pointer>>'
        SoFar (arg 2)          	0
        N (arg 3)              	789
-       DCG_2 (arg 5)          	state('<<c_pointer>>')
 mdb> retry -f
       E4:     C3 CALL pred tabled_read.test/5-0 (det)
 mdb> finish -n
@@ -54,6 +50,5 @@
        Stream (arg 1)         	'<<c_pointer>>'
        SoFar (arg 2)          	0
        N (arg 3)              	42
-       DCG_2 (arg 5)          	state('<<c_pointer>>')
 mdb> continue -S
 42
Index: tests/debugger/tabled_read_decl.exp
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/debugger/tabled_read_decl.exp,v
retrieving revision 1.10
diff -u -b -r1.10 tabled_read_decl.exp
--- tests/debugger/tabled_read_decl.exp	16 Nov 2004 00:16:40 -0000	1.10
+++ tests/debugger/tabled_read_decl.exp	19 Nov 2004 00:10:07 -0000
@@ -19,20 +19,17 @@
        Stream (arg 1)         	'<<c_pointer>>'
        SoFar (arg 2)          	0
        N (arg 3)              	123
-       DCG_2 (arg 5)          	state('<<c_pointer>>')
 mdb> retry -o -a
       E2:     C2 CALL pred tabled_read_decl.test/5-0 (det)
 mdb> print *
        Stream (arg 1)         	'<<c_pointer>>'
        SoFar (arg 2)          	0
-       DCG_0 (arg 4)          	state('<<c_pointer>>')
 mdb> finish -n
       E3:     C2 EXIT pred tabled_read_decl.test/5-0 (det)
 mdb> print *
        Stream (arg 1)         	'<<c_pointer>>'
        SoFar (arg 2)          	0
        N (arg 3)              	123
-       DCG_2 (arg 5)          	state('<<c_pointer>>')
 mdb> break tabled_read_decl__poly_test
  1: + stop  interface pred tabled_read_decl.poly_test/6-0 (det)
 mdb> continue
@@ -45,7 +42,6 @@
        Unused (arg 2)         	['a', 'b', 'c']
        SoFar (arg 3)          	0
        N (arg 4)              	456
-       DCG_2 (arg 6)          	state('<<c_pointer>>')
 mdb> retry -o -a
       E4:     C3 CALL pred tabled_read_decl.poly_test/6-0 (det)
 mdb> finish -n
@@ -55,7 +51,6 @@
        Unused (arg 2)         	['a', 'b', 'c']
        SoFar (arg 3)          	0
        N (arg 4)              	456
-       DCG_2 (arg 6)          	state('<<c_pointer>>')
 mdb> delete *
  0: E stop  interface pred tabled_read_decl.test/5-0 (det)
  1: E stop  interface pred tabled_read_decl.poly_test/6-0 (det)
cvs diff: Diffing tests/debugger/declarative
Index: tests/debugger/declarative/io_stream_test.exp
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/debugger/declarative/io_stream_test.exp,v
retrieving revision 1.3
diff -u -b -r1.3 io_stream_test.exp
--- tests/debugger/declarative/io_stream_test.exp	16 Nov 2004 00:16:42 -0000	1.3
+++ tests/debugger/declarative/io_stream_test.exp	19 Nov 2004 03:26:36 -0000
@@ -13,17 +13,15 @@
       E2:     C2 CALL pred io_stream_test.test/4-0 (det)
 mdb> print *
        Stream (arg 1)         	stream(0, input, text, file("tabled_read_decl.data"))
-       DCG_0 (arg 3)          	state('<<c_pointer>>')
 mdb> finish -n
       E3:     C2 EXIT pred io_stream_test.test/4-0 (det)
 mdb> print *
        Stream (arg 1)         	stream(0, input, text, file("tabled_read_decl.data"))
        N (arg 2)              	1123
-       DCG_1 (arg 4)          	state('<<c_pointer>>')
 mdb> print
-test(stream(0, input, text, file("tabled_read_decl.data")), 1123, _, state('<<c_pointer>>'))
+test(stream(0, input, text, file("tabled_read_decl.data")), 1123, _, _)
 mdb> dd -a
-test(stream(0, input, text, file("tabled_read_decl.data")), 1123, _, state('<<c_pointer>>'))
+test(stream(0, input, text, file("tabled_read_decl.data")), 1123, _, _)
 4 io actions:
 read_char_code(stream(0, input, text, file("tabled_read_decl.data")), 49)
 read_char_code(stream(0, input, text, file("tabled_read_decl.data")), 50)
@@ -32,7 +30,7 @@
 Valid? print 1-2
 stream(0, input, text, file("tabled_read_decl.data"))
 1123
-test(stream(0, input, text, file("tabled_read_decl.data")), 1123, _, state('<<c_pointer>>'))
+test(stream(0, input, text, file("tabled_read_decl.data")), 1123, _, _)
 4 io actions:
 read_char_code(stream(0, input, text, file("tabled_read_decl.data")), 49)
 read_char_code(stream(0, input, text, file("tabled_read_decl.data")), 50)
@@ -41,14 +39,14 @@
 Valid? p io 1-2
 read_char_code(stream(0, input, text, file("tabled_read_decl.data")), 49)
 read_char_code(stream(0, input, text, file("tabled_read_decl.data")), 50)
-test(stream(0, input, text, file("tabled_read_decl.data")), 1123, _, state('<<c_pointer>>'))
+test(stream(0, input, text, file("tabled_read_decl.data")), 1123, _, _)
 4 io actions:
 read_char_code(stream(0, input, text, file("tabled_read_decl.data")), 49)
 read_char_code(stream(0, input, text, file("tabled_read_decl.data")), 50)
 read_char_code(stream(0, input, text, file("tabled_read_decl.data")), 51)
 read_char_code(stream(0, input, text, file("tabled_read_decl.data")), 10)
 Valid? no
-test_2(stream(0, input, text, file("tabled_read_decl.data")), 1, 1123, _, state('<<c_pointer>>'))
+test_2(stream(0, input, text, file("tabled_read_decl.data")), 1, 1123, _, _)
 4 io actions:
 read_char_code(stream(0, input, text, file("tabled_read_decl.data")), 49)
 read_char_code(stream(0, input, text, file("tabled_read_decl.data")), 50)
@@ -56,7 +54,7 @@
 read_char_code(stream(0, input, text, file("tabled_read_decl.data")), 10)
 Valid? yes
 Found incorrect contour:
-test(stream(0, input, text, file("tabled_read_decl.data")), 1123, _, state('<<c_pointer>>'))
+test(stream(0, input, text, file("tabled_read_decl.data")), 1123, _, _)
 4 io actions:
 read_char_code(stream(0, input, text, file("tabled_read_decl.data")), 49)
 read_char_code(stream(0, input, text, file("tabled_read_decl.data")), 50)
Index: tests/debugger/declarative/io_stream_test.exp2
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/debugger/declarative/io_stream_test.exp2,v
retrieving revision 1.3
diff -u -b -r1.3 io_stream_test.exp2
--- tests/debugger/declarative/io_stream_test.exp2	16 Nov 2004 00:16:42 -0000	1.3
+++ tests/debugger/declarative/io_stream_test.exp2	19 Nov 2004 00:11:16 -0000
@@ -13,29 +13,27 @@
       E2:     C2 CALL pred io_stream_test.test/4-0 (det)
 mdb> print *
        Stream (arg 1)         	stream(0, input, text, file("tabled_read_decl.data"))
-       DCG_0 (arg 3)          	state('<<c_pointer>>')
 mdb> finish -n
       E3:     C2 EXIT pred io_stream_test.test/4-0 (det)
 mdb> print *
        Stream (arg 1)         	stream(0, input, text, file("tabled_read_decl.data"))
        N (arg 2)              	1123
-       DCG_1 (arg 4)          	state('<<c_pointer>>')
 mdb> print
-test(stream(0, input, text, file("tabled_read_decl.data")), 1123, _, state('<<c_pointer>>'))
+test(stream(0, input, text, file("tabled_read_decl.data")), 1123, _, _)
 mdb> dd -a
-test(stream(0, input, text, file("tabled_read_decl.data")), 1456, _, state('<<c_pointer>>'))
+test(stream(0, input, text, file("tabled_read_decl.data")), 1456, _, _)
 Valid? print 1-2
 stream(0, input, text, file("tabled_read_decl.data"))
 1456
-test(stream(0, input, text, file("tabled_read_decl.data")), 1456, _, state('<<c_pointer>>'))
+test(stream(0, input, text, file("tabled_read_decl.data")), 1456, _, _)
 Valid? p io 1-2
 No such IO action.
-test(stream(0, input, text, file("tabled_read_decl.data")), 1456, _, state('<<c_pointer>>'))
+test(stream(0, input, text, file("tabled_read_decl.data")), 1456, _, _)
 Valid? no
-test_2(stream(0, input, text, file("tabled_read_decl.data")), 1, 1456, _, state('<<c_pointer>>'))
+test_2(stream(0, input, text, file("tabled_read_decl.data")), 1, 1456, _, _)
 Valid? yes
 Found incorrect contour:
-test(stream(0, input, text, file("tabled_read_decl.data")), 1456, _, state('<<c_pointer>>'))
+test(stream(0, input, text, file("tabled_read_decl.data")), 1456, _, _)
 Is this a bug? yes
       E3:     C2 EXIT pred io_stream_test.test/4-0 (det)
 mdb> c -n -S
Index: tests/debugger/declarative/tabled_read_decl.exp
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/debugger/declarative/tabled_read_decl.exp,v
retrieving revision 1.10
diff -u -b -r1.10 tabled_read_decl.exp
--- tests/debugger/declarative/tabled_read_decl.exp	16 Nov 2004 00:16:43 -0000	1.10
+++ tests/debugger/declarative/tabled_read_decl.exp	16 Nov 2004 03:45:30 -0000
@@ -14,9 +14,9 @@
 mdb> finish -n
       E3:     C2 EXIT pred tabled_read_decl.test/4-0 (det)
 mdb> print
-test('<<c_pointer>>', 1123, _, state('<<c_pointer>>'))
+test('<<c_pointer>>', 1123, _, _)
 mdb> dd -a
-test('<<c_pointer>>', 1123, _, state('<<c_pointer>>'))
+test('<<c_pointer>>', 1123, _, _)
 4 io actions:
 read_char_code('<<c_pointer>>', 49)
 read_char_code('<<c_pointer>>', 50)
@@ -25,7 +25,7 @@
 Valid? print 1-2
 '<<c_pointer>>'
 1123
-test('<<c_pointer>>', 1123, _, state('<<c_pointer>>'))
+test('<<c_pointer>>', 1123, _, _)
 4 io actions:
 read_char_code('<<c_pointer>>', 49)
 read_char_code('<<c_pointer>>', 50)
@@ -34,7 +34,7 @@
 Valid? p io 1-2
 read_char_code('<<c_pointer>>', 49)
 read_char_code('<<c_pointer>>', 50)
-test('<<c_pointer>>', 1123, _, state('<<c_pointer>>'))
+test('<<c_pointer>>', 1123, _, _)
 4 io actions:
 read_char_code('<<c_pointer>>', 49)
 read_char_code('<<c_pointer>>', 50)
@@ -43,7 +43,7 @@
 Valid? print io 2-1
 read_char_code('<<c_pointer>>', 49)
 read_char_code('<<c_pointer>>', 50)
-test('<<c_pointer>>', 1123, _, state('<<c_pointer>>'))
+test('<<c_pointer>>', 1123, _, _)
 4 io actions:
 read_char_code('<<c_pointer>>', 49)
 read_char_code('<<c_pointer>>', 50)
@@ -54,19 +54,19 @@
 read_char_code('<<c_pointer>>', 10)
 browser> set num_io_actions 3
 browser> quit
-test('<<c_pointer>>', 1123, _, state('<<c_pointer>>'))
+test('<<c_pointer>>', 1123, _, _)
 4 io actions: too many to show
 Valid? browse 1
 browser> set num_io_actions 10
 browser> quit
-test('<<c_pointer>>', 1123, _, state('<<c_pointer>>'))
+test('<<c_pointer>>', 1123, _, _)
 4 io actions:
 read_char_code('<<c_pointer>>', 49)
 read_char_code('<<c_pointer>>', 50)
 read_char_code('<<c_pointer>>', 51)
 read_char_code('<<c_pointer>>', 10)
 Valid? no
-test_2('<<c_pointer>>', 1, 1123, _, state('<<c_pointer>>'))
+test_2('<<c_pointer>>', 1, 1123, _, _)
 4 io actions:
 read_char_code('<<c_pointer>>', 49)
 read_char_code('<<c_pointer>>', 50)
@@ -74,7 +74,7 @@
 read_char_code('<<c_pointer>>', 10)
 Valid? yes
 Found incorrect contour:
-test('<<c_pointer>>', 1123, _, state('<<c_pointer>>'))
+test('<<c_pointer>>', 1123, _, _)
 4 io actions:
 read_char_code('<<c_pointer>>', 49)
 read_char_code('<<c_pointer>>', 50)
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
Index: trace/mercury_trace.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace.c,v
retrieving revision 1.74
diff -u -b -r1.74 mercury_trace.c
--- trace/mercury_trace.c	6 Sep 2004 00:05:20 -0000	1.74
+++ trace/mercury_trace.c	11 Nov 2004 06:49:40 -0000
@@ -580,22 +580,21 @@
 
     arg_max = 0;
 
+    if (MR_proc_has_io_state_pair(level_layout)) {
+        has_io_state = MR_TRUE;
+        found_io_action_counter = MR_find_saved_io_counter(call_label,
+            base_sp, base_curfr, &saved_io_action_counter);
+    } else {
     has_io_state = MR_FALSE;
-    found_io_action_counter = MR_FALSE;
         /* just to prevent uninitialized variable warnings */
+        found_io_action_counter = MR_FALSE;
     saved_io_action_counter = 0;
+    }
 
     for (i = 0; i < MR_all_desc_var_count(call_label); i++) {
         arg_value = MR_trace_find_input_arg(return_label_layout,
             saved_regs, base_sp, base_curfr,
             call_label->MR_sll_var_nums[i], &succeeded);
-
-        if (MR_is_io_state(MR_var_pti(call_label, i))) {
-            has_io_state = MR_TRUE;
-            found_io_action_counter = MR_find_saved_io_counter(
-                call_label, base_sp, base_curfr,
-                &saved_io_action_counter);
-        }
 
         if (! succeeded) {
             if (! MR_is_io_state(MR_var_pti(call_label, i))) {
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
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