Diff: Improved det stack dump output

Andrew Bromage bromage at students.cs.mu.oz.au
Fri Apr 4 15:11:31 AEST 1997


G'day all.

Changes have been reviewed by zs and committed.

Cheers,
Andrew Bromage

Estimated hours taken: 0.5

Module qualify predicate names attached to incr_sp instructions to
improve error reporting in debug grades.

compiler/code_gen.m:
compiler/code_info.m:
compiler/middle_rec.m:
        Various minor changes to do above.

Index: code_gen.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/code_gen.m,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- code_gen.m	1997/03/06 05:08:56	1.22
+++ code_gen.m	1997/04/04 04:41:11	1.23
@@ -327,10 +327,12 @@
 	->
 		{ CodeB = CodeA }
 	;
+		{ predicate_module(ModuleInfo, PredId, ModuleName) },
 		{ predicate_name(ModuleInfo, PredId, PredName) },
+		{ string__append_list([ModuleName, ":", PredName], PushMsg) },
 		{ CodeB = tree(
 			CodeA,
-			node([incr_sp(NS, PredName) - "Allocate stack frame"])
+			node([incr_sp(NS, PushMsg) - "Allocate stack frame"])
 		) }
 	),
 	{ PStart = node([comment("Start of procedure prologue") - ""]) },
@@ -428,10 +430,12 @@
 	->
 		{ CodeB = CodeA }
 	;
+		{ predicate_module(ModuleInfo, PredId, ModuleName) },
 		{ predicate_name(ModuleInfo, PredId, PredName) },
+		{ string__append_list([ModuleName, ":", PredName], PushMsg) },
 		{ CodeB = tree(
 			CodeA,
-			node([incr_sp(NS, PredName) - "Allocate stack frame"])
+			node([incr_sp(NS, PushMsg) - "Allocate stack frame"])
 		) }
 	),
 	{ PStart = node([comment("Start of procedure prologue") - ""]) },
Index: code_info.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/code_info.m,v
retrieving revision 1.197
retrieving revision 1.198
diff -u -r1.197 -r1.198
--- code_info.m	1997/02/23 06:05:32	1.197
+++ code_info.m	1997/04/04 04:41:08	1.198
@@ -1910,8 +1910,10 @@
 		% can figure out what is going on later.
 		code_info__get_module_info(ModuleInfo),
 		code_info__get_pred_id(PredId),
+		{ predicate_name(ModuleInfo, PredId, ModuleName) },
 		{ predicate_name(ModuleInfo, PredId, PredName) },
-		{ string__append("commit in ", PredName, Message) },
+		{ string__append_list(["commit in ", ModuleName, ":", PredName],
+			Message) },
 		{ PushCode = node([
 			incr_sp(3, Message) -
 				"push space for curfr, maxfr, and redoip"
Index: middle_rec.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/middle_rec.m,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- middle_rec.m	1997/02/23 06:07:15	1.61
+++ middle_rec.m	1997/04/04 04:41:13	1.62
@@ -28,6 +28,7 @@
 :- import_module hlds_module, hlds_data.
 :- import_module code_gen, unify_gen, code_util, code_aux, opt_util.
 :- import_module bool, set, int, std_util, tree, list, assoc_list, require.
+:- import_module string.
 
 %---------------------------------------------------------------------------%
 
@@ -114,7 +115,6 @@
 	code_info__get_module_info(ModuleInfo),
 	code_info__get_pred_id(PredId),
 	code_info__get_proc_id(ProcId),
-	{ predicate_name(ModuleInfo, PredId, PredName) },
 	{ code_util__make_local_entry_label(ModuleInfo, PredId, ProcId, no,
 		EntryLabel) },
 
@@ -182,7 +182,10 @@
 				label(Loop2Label))
 				- "test on upward loop"]
 	;
-		MaybeIncrSp = [incr_sp(FrameSize, PredName) - ""],
+		predicate_module(ModuleInfo, PredId, ModuleName),
+		predicate_name(ModuleInfo, PredId, PredName),
+		string__append_list([ModuleName, ":", PredName], PushMsg),
+		MaybeIncrSp = [incr_sp(FrameSize, PushMsg) - ""],
 		MaybeDecrSp = [decr_sp(FrameSize) - ""],
 		InitAuxReg =  [assign(AuxReg, lval(sp))
 				- "initialize counter register"],



More information about the developers mailing list