[m-rev.] refactor nondet stack traversal code

Zoltan Somogyi zs at cs.mu.OZ.AU
Tue Nov 11 19:56:20 AEDT 2003

On 11-Nov-2003, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> The reason for that is that when we're stepping over the "terminal top
> frame of a nondet side branch", I/O happens, but func doesn't get called.
> (That's not a bug, is it?  That is, is it right to not traverse the
> variables in such a frame?)

I would think that *any* I/O during garbage collection would be a very
obvious bug.

The top frames of nondet side branches *should* be considered in general
to contain root pointers as specified by the layout structure of the label
whose address is in the top redoip slot referring to that frame. If the label
there indicates that backtracking will fail out of that call immediately,
which is when the current code prints a message about "terminal top frame",
then the frame contains no roots, but performing I/O is still bad. It would
better to call func with an extra parameter, or to call a different function,
to signify that the debugger should take action but agc shouldn't.

The current code has two jobs: traversal, and printing out information about
each frame. Leaving in a FILE * argument implies, at least to me, that you
haven't separated the two completely enough.

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