[m-dev.] For review: handling one by one variable retrieval within the external debugger
Fergus Henderson
fjh at cs.mu.OZ.AU
Wed Jul 29 23:39:27 AEST 1998
On 29-Jul-1998, Erwan Jahier <Erwan.Jahier at irisa.fr> wrote:
> Many thanks for your comments Fergus.
> --- mercury_trace_util.c.save Wed Jul 29 14:55:21 1998
> +++ mercury_trace_util.c Wed Jul 29 14:55:33 1998
> +bool
> +MR_trace_get_type_and_value_filtered(const MR_Stack_Layout_Var *var,
> + const char *name,
> + Word *type_info, Word *value)
> +{
> + return ((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));
> +}
> +
> +
> +bool
> +MR_trace_get_type_filtered(const MR_Stack_Layout_Var *var,
> + const char *name, Word *type_info)
> +{
> + return ((strncmp(name, "TypeInfo", 8) == 0)
> + || (strncmp(name, "ModuleInfo", 10) == 0)
> + || (strncmp(name, "HLDS", 4) == 0)
> + || !MR_trace_get_type(var, NULL, type_info));
> +}
These functions should be either declared in a header file
or defined as `static' and declared near the start of the .c file.
(You should have got some compiler warnings about that.
Please make sure that your code compiles without any warnings.
If you didn't get any warnings, let us know, because that
would indicate a problem with gcc's warnings not being properly
enabled for some reason.)
Also, you should document these functions.
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.
Can I see another relative diff this time?
Thanks,
Fergus.
--
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