[m-rev.] for review: --trace-table-io-require

Zoltan Somogyi zs at cs.mu.OZ.AU
Mon Jul 22 16:49:23 AEST 2002


On 22-Jul-2002, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> It is?  Ah.  This is certainly not clear from the name.
> This meaning should be documented on the definition of tabled_for_io.
> (Currently there are no comments on that type definition.)

I intend to document I/O tabling soon, but only after we decide what its
relationship to the debug grades should be.

> One way to do it would be to continue forward execution to the exit port
> of p, and only then do the retry.  Then on retry, execution should skip
> the C code for p (since it has already been executed), and only reexecute
> the Mercury code that it calls (q1, ..., qn).

However, at the moment there is no way that you can get back control after the
call to q1 and proceed to call q2 *without* executing the stuff between the two
calls in the code of p. For that matter, there is no mechanism that would let
you skip to the call of q1 from the call of p.

> Hmm.  Since call_gcc_backend invokes virtually the whole of the Mercury
> compiler, that would basically prevent debugging the Mercury compiler
> using mdb when --target asm is specified.  So at very least execution
> tracing should only be disabled in such procedures if I/O tabling is
> enabled.

In the code I wrote yesterday, the disabling is done by code that is invoked
only if the call is I/O tabled. I was going to ask whether that should be
extended to disable tracing in the children of such procedures even if the 
call is not I/O tabled for the sake of consistency. I guess I can take
your paragraph above as a strong vote against.

> In the longer term, I'd like to see something along the lines of what
> I wrote above.

You volunteering?

The cleanest approach I could think of is to make pragma export create an
extra version of the foreign language function of the specified Mercury
procedure, put all the machinery required to mimic p as a driver of calls to
the qi (i.e. to record the calls the first time and then replay them later)
in that new version, and require the appropriate procedures to call only
these specialized versions.

Zoltan.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list