Fix a bug which prevented bootstrapping in MLDS grades.

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.)
This commit is contained in:
Fergus Henderson
2000-11-18 11:28:50 +00:00
parent a207687b4c
commit 08e3821ff7
2 changed files with 13 additions and 4 deletions

View File

@@ -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.
@@ -126,5 +126,15 @@
; 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).
%-----------------------------------------------------------------------------%
%-----------------------------------------------------------------------------%

View File

@@ -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_handle_cmd(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
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 @@ MR_trace_handle_cmd(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
"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);