for review: interface to external opium-style debugger

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Feb 10 16:19:15 AEDT 1998


On 10-Feb-1998, Erwan JAHIER <jahier at cs.mu.OZ.AU> wrote:
> Fergus Henderson wrote:
> 
> 
> +%-----------------------------------------------------------------------
> > +% File: debugger_interface.m
> ...
> > +% This module exports the following C functions:
> > +%      ML_DI_output_current
> > +%      ML_DI_found_match
> 
> I'am not very happy with that name. I the long run, we want to be able
> to support backward move in the trace history. 
> What do you think of "ML_DI_forward_match" ?

I agree that is a better name.

> > +found_match(EventNumber, CallNumber, DepthNumber, Port,
> > +               ModuleName, PredName, Arity, ModeNum, Determinism, Args,
> > +               Path, DebuggerRequest) :-
> > +       (
> > +               DebuggerRequest = forward_move(MatchEventNumber,
> > +                       MatchCallNumber, MatchDepthNumber, MatchPort,
> > +                       MatchModuleName, MatchPredName, MatchArity,
> > +                       MatchModeNum, MatchDeterminism, MatchArgs, MatchPath)
> > +       ->
> > +               match(MatchEventNumber, EventNumber),
> > +               match(MatchCallNumber, CallNumber),
> > +               match(MatchDepthNumber, DepthNumber),
> > +               match(MatchPort, Port),
> > +               match(MatchModuleName, ModuleName),
> > +               match(MatchPredName, PredName),
> > +               match(MatchArity, Arity),
> > +               match(MatchModeNum, ModeNum),
> > +               match(MatchDeterminism, Determinism),
> > +               match(MatchArgs, Args),
> > +               match(MatchPath, Path)
> > +       ;
> > +               error("found_match: forward_move expected")
> > +       ).
> > +
> > +% match(MatchPattern, Value) is true iff Value matches the specified pattern.
> > +:- pred match(match(T), T).
> > +:- mode match(in, in) is semidet.
> > +
> > +match(nop, _).
> > +match(exact(X), X).
> > +match(neg(X), Y) :- X \= Y.
> 
> 
> As Zoltan noticed the day you were hacking that stuff, that is not the
> way we (Mireille and I) want this thing to be done. We only want to find
> out a given attribute if it is wanted (especially for the argument
> attribute of course) and if an attribute didn't match, it then become
> unnecessary to find out the other attributes. 

I think you were worried about the cost of sending attributes over the socket
to the other process.  That is a reasonable concern, but that's not what
is happening here.  Here we are just passing the attributes to a Mercury
procedure in the same process.  The cost of finding the attributes
and passing them to a Mercury procedure is pretty small.

-- 
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