[m-dev.] For review: Fix a bug in the external debugger

Erwan Jahier Erwan.Jahier at irisa.fr
Sat Feb 20 02:31:36 AEDT 1999


| On 19-Feb-1999, Erwan Jahier <Erwan.Jahier at irisa.fr> wrote:
| > runtime/mercury_layout_util.c
| > 	Filter out variables which names begin by "TypeClassInfo" in
| > 	MR_get_type_and_value_filtered() (as it was already done in
| > 	MR_get_type_filtered()).
| 
| The code to filter out variables whose names begin with "HLDS"
| and "ModuleInfo" is obsolete, at least for the internal debugger,
| so if that filtering is not needed for the external debugger then
| you could delete that too while you're at it.
| 
| > +++ mercury_trace_external.c	1999/02/19 00:44:50
| > @@ -709,6 +709,14 @@
| >  	var_names_list = list_empty();
| >  	for (i = var_count - 1; i >= 0; i--) {
| >  		name = MR_name_if_present(vars, i);
| > +		if ((strncmp(name, "TypeInfo", 8) == 0)
| > +		    || (strncmp(name, "TypeClassInfo", 13) == 0)
| > +		    || (strncmp(name, "ModuleInfo", 10) == 0)
| > +		    || (strncmp(name, "HLDS", 4) == 0)
| > +		    ) {
| > +		  continue;
| > +		}
| 
| There should be a comment here similar to the one in mercury_trace_layout.c
| explaining why those variables are filtered out.

The actual comment in mercury_trace_layout.c is:

/*
** get_type_and_value() and get_type() will succeed to retrieve "variables"
** that we do not want to send to the user; "variables" beginning with
** `ModuleInfo', or `HLDS' may occur when debugging the compiler and are too
** big to be displayed.  "Variables" beginning with `TypeInfo' denote the
** additional parameters introduced by compiler/polymorphism.m that we don't
** want to show neither.
** That's why we define filtered version of get_type_and_value() and get_type()
** that will fail to retrieve such variables.
*/

Shouldn't it be (as in mercury-trace_internal.c):

/*
** XXX The printing of type_infos is buggy at the moment
** due to the fake arity of the type private_builtin:typeinfo/1.
*/

?
Or do I miss something ?
-- 
R1.





More information about the developers mailing list