[m-rev.] for review: do not generate trace events in private_builtin

Julien Fischer juliensf at cs.mu.OZ.AU
Mon Nov 21 16:36:58 AEDT 2005


On Thu, 17 Nov 2005, Ian MacLarty wrote:

> Define locals copies of some procedures called by private_builtin that
> are in modules which could be traced.  In decldebug grades the
> declarative debugger assumes all calls are traced, unless they are to
> builtin predicates.  If a builtin predicate then generates events (by
> calling a predicate from a module that is traced) the subterm dependency
> tracking algorithm gets confused, because it can't match the goals in
> the body of the predicate that calls the builtin predicate with the
> events generated by the predicate.
>
> library/builtin.m:
> 	Remove unneccesary imports.
>
> library/exception.m:
> 	Export builtin_throw so that it can be called directly from
> 	private_builtin. private_builtin must call builtin_throw directory
> 	to avoid generating trace events.  builtin_throw is exported in
> 	such a way that it won't appear in the library reference.
>
In the long run it may be better to move builtin_throw (and builtin_catch)
into private_builtin, but this will do for now.

> library/private_builtin.m:
> library/type_desc.m:
> 	Move the implementation of type_of from type_desc to private_builtin
> 	so that it doesn't generate trace events when called from
> 	private_builtin.
>
> 	Define duplicate versions of some predicates in the string, std_util
> 	and char modules to avoid generating events in private_builtin.
> 	The duplicate predicates are all simple, and so are unlikely to
> 	require maintenance.  Also only the required modes of the predicates
> 	are duplicated in private_builtin.
>
> 	Replace calls to string.append_list with single strings.
>
> 	Define a duplicate version of error which does the same thing as
> 	require.error, but doesn't generate any events.
>
> library/std_util.m:
> 	(Secretly) export the definition of the univ type, so that
> 	private_builtin can construct a univ without calling the univ function
> 	and so generating trace events.
>

I don't like the idea of doing this.  Since the runtime defines macros
for constructing univs in C code I suggest that a better way of handling
this might to have a foreign_proc in private_builtin that constructs
the univ (See runtime/mercury_univ.h).

> tests/debugger/declarative/Mmakefile:
> tests/debugger/declarative/typed_unify.exp:
> tests/debugger/declarative/typed_unify.inp:
> tests/debugger/declarative/typed_unify.m:
> 	Add a regression test that tracks a subterm through type_to_univ
> 	(which calls private_builtin.typed_unify).  Previously the
> 	declarative debugger bailed out when tracking the subterm.
> 	The test in only applicable to decldebug grades.
>
> tests/debugger/loopcheck.exp
> 	The event reported by this test case has changed, because the calls
> 	to procedures in private_builtin no longer generate any trace events.
>

To be continued ...

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