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

Erwan Jahier Erwan.Jahier at irisa.fr
Thu Jul 30 18:56:28 AEST 1998


Fergus Henderson wrote:
> 
> On 29-Jul-1998, Erwan Jahier <Erwan.Jahier at irisa.fr> wrote:
> > Fergus Henderson wrote:
> >
> > > > --- 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.
> >
> > I don't think so.
> 
> In that case, the meaning of the return value from
> MR_trace_get_type_and_value_filtered must be the opposite of
> that for MR_trace_get_type_and_value, since in the old code above
> it had a `!'.  I thought you agreed it would be better to make
> the meanings of the return values of these two function the same?

Yes I still agree.
But I think you are not looking in the right part of the code; this call
to MR_trace_get_type_and_value_filtered() is the one made in
MR_trace_make_nth_var().

"
|if (MR_trace_get_type_and_value_filtered(var, name, &type_info, 
|					     &value))
|  {
|    field(mktag(0), univ, UNIV_OFFSET_FOR_TYPEINFO) = type_info;
|    field(mktag(0), univ, UNIV_OFFSET_FOR_DATA) = value;
|  }
"
in this case, we want to put the type_info and the value in univ when
MR_trace_get_type_and_value_filtered() succeeds.

> 
> > > > +/*
> > > > +** "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/
> >
> > ah yes.
> > but the same way MR_trace_get_type_and_value should succeed for these
> > variables and the zoltan's comment I've moved is wrong too. right ?
> 
> Uh, I'm not sure -- I don't know which comment you mean.

Sorry it wasn't clear.
|** "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.
    -----
this "fails" should be a "succeeds".


-- 
R1.



More information about the developers mailing list