[m-dev.] For review: handling one by one variable retrieval within the external debugger

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Jul 30 00:59:05 AEST 1998


On 29-Jul-1998, Erwan Jahier <Erwan.Jahier at irisa.fr> wrote:
> Fergus Henderson wrote:
> 
> > These functions should be either declared in a header file
> > or defined as `static' and declared near the start of the .c file.
> 
> Well in fact, they were declared in mercury_trace_util.h (that's why I
> didn't get any warnings...) but I made a wrong manipulation during the
> diff (I wasn't in the rigth directory).
> 
> 
> > I think it would be a lot clearer if the sense of the
> > return value from `MR_trace_get_type_filtered' was
> > the same as that of `MR_trace_get_type', rather than being
> > the opposite, as it is in your change.
> 
> I agree.
> 
> > 
> > Can I see another relative diff this time?
> 
> 
> --- mercury_trace_external.c.save	Wed Jul 29 15:10:43 1998
> +++ mercury_trace_external.c	Wed Jul 29 16:05:59 1998
> @@ -612,16 +619,12 @@
>  	restore_transient_registers();
>  	incr_hp(univ, 2);
>  
> -	if ((strncmp(name, "TypeInfo", 8) == 0)
> -	    || (strncmp(name, "ModuleInfo", 10) == 0)
> -	    || (strncmp(name, "HLDS", 4) == 0)
> -	    || !MR_trace_get_type_and_value(var, NULL, &type_info, &value))
> +
> +	if (MR_trace_get_type_and_value_filtered(var, name, &type_info, 
> +						     &value))

I think there should be a `!' there.

> +/*
> +** "variables" representing the saved values of succip, hp etc,
> +** which are the "variables" for which get_type_and_value
> +** fails, are not of interest to the trace analyzer.
> +** MR_trace_get_type_and_value_filtered() and MR_trace_get_type_filtered()
> +** will succeed for theses variables.

s/succeed/fail/

And last but of course by far the worst --
you used the T word -- _plural_!  The horror! ;-)

[I think you meant "these variables".]

Also you should document why it fails for variables with names
that start with `TypeInfo', `ModuleInfo', or `HLDS'.

Otherwise that looks OK.

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



More information about the developers mailing list