[m-dev.] diff: fix MLDS bug in mdb `proc_body' command

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Nov 18 22:28:22 AEDT 2000


Estimated hours taken: 0.75

Fix a bug which prevented bootstrapping in MLDS grades.

browser/program_representation.m:
	Export to C a function ML_goal_rep_type() which returns the
	type_info for a goal_rep.

trace/mercury_trace_internal.c:
	Use ML_goal_rep_type(), rather than hard-coding the mangled
	name for the type_ctor_info.  (The hard-coded mangled name
	was wrong for MLDS grades.)

Workspace: /home/pgrad/fjh/ws/hg3
Index: browser/program_representation.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/program_representation.m,v
retrieving revision 1.2
diff -u -d -r1.2 program_representation.m
--- browser/program_representation.m	2000/09/25 04:37:01	1.2
+++ browser/program_representation.m	2000/11/18 10:05:06
@@ -33,7 +33,7 @@
 
 :- interface.
 
-:- import_module list.
+:- import_module list, std_util.
 
 	% A representation of the goal we execute.  These need to be
 	% generated statically and stored inside the executable.
@@ -125,6 +125,16 @@
 	;	cc_multidet_rep
 	;	erroneous_rep
 	;	failure_rep.
+
+	% Returns type_of(_ `with_type` goal_rep), for use in C code.
+:- func goal_rep_type = type_desc.
+
+%-----------------------------------------------------------------------------%
+
+:- implementation.
+
+:- pragma export(goal_rep_type = out, "ML_goal_rep_type").
+goal_rep_type = type_of(_ `with_type` goal_rep).
 
 %-----------------------------------------------------------------------------%
 %-----------------------------------------------------------------------------%
Index: trace/mercury_trace_internal.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_internal.c,v
retrieving revision 1.86
diff -u -d -r1.86 mercury_trace_internal.c
--- trace/mercury_trace_internal.c	2000/11/01 04:03:07	1.86
+++ trace/mercury_trace_internal.c	2000/11/18 10:10:53
@@ -28,6 +28,7 @@
 #include "mercury_trace_readline.h"
 
 #include "mdb.browse.h"
+#include "mdb.program_representation.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -1741,8 +1742,6 @@
 			MR_trace_usage("help", "help");
 		}
 	} else if (streq(words[0], "proc_body")) {
-		extern const struct MR_TypeCtorInfo_Struct
-			mercury_data_mdb__program_representation__type_ctor_info_goal_rep_0;
 		const MR_Stack_Layout_Entry	*entry;
 
 		entry = event_info->MR_event_sll->MR_sll_entry;
@@ -1751,7 +1750,7 @@
 				"current procedure has no body info\n");
 		} else {
 			MR_trace_browse_internal(
-				(MR_Word) &mercury_data_mdb__program_representation__type_ctor_info_goal_rep_0,
+				ML_goal_rep_type(),
 				entry->MR_sle_proc_rep,
 				MR_BROWSE_CALLER_PRINT,
 				MR_BROWSE_DEFAULT_FORMAT);

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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