[m-dev.] debugging grades and I/O tabling

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Aug 19 18:04:05 AEST 2002

On 19-Aug-2002, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> On 19-Aug-2002, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > It would be very bad for code which compiles in the default grade to
> > not compile with `--debug'.  So if we're going to make that an error in
> > debug grades, I think we should make it an error in all grades.
> That would be fine by me.
> > But doing that would break a lot of existing code.
> For small values of "break".
> Most broken code can be fixed by adding an annotation. Very few foreign_procs
> will have to be rewritten; for example there were none in the Mercury
> implementation itself.

I think the breakage is of a medium degree, not a small degree.

In order for users to fix it, they need to
(1) understand the meaning of the different annotations
(2) understand the C code fragement which was broken
(3) figure out which annotation is appropriate
(4) modify their source to add the annotation

Part (4) is fairly easy, but (1)-(3) impose a reasonably significant
burden on users, IMHO.

> > What's the corresponding benefit to users?
> Being able to retry past I/O actions *safely* in the debugger.

Isn't there some way to enable users who want it to get this benefit without
imposing the costs on those who aren't using it?

For example, leave `--trace-table-io-require' as optional,
and not implied by `--require-tracing'.  Make the mdb "retry"
command check whether it might be retrying over an I/O action which
was not appropriately annotated, and if so, issue a message explaining
the need for the annotations and telling the user about the
"--trace-table-io-require" option.

That way, people who actually use this feature will learn about that
option and can enable it, but people who don't won't have their code

Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au

More information about the developers mailing list