Next Previous Up Top Contents Index

5 Debugging

5.7 Tracing

Beside the stack browser, MLWorks has another facility to help the debugging process: tracing. It is also controlled from the trace and breakpoint manager, invoked from the MLWorks podium with Tools > Break / Trace. The trace options of the trace and breakpoint manager work in exactly the same way as the break points: they contain a list of functions whose execution must be traced each time they are called. You can add or remove functions in the list. Again, functions that are to be traced must have been compiled in debug mode.

A trace of a function listed in the trace and breakpoint manager proceeds as follows: whenever the function is called, MLWorks reports that it has been called, and also reports the result of the call when the function returns.

If you now add efact to the trace manager and type efact 6 in the listener, MLWorks will trace all the recursive calls to efact:

MLWorks> efact 6;
efact 6
	efact 4
		efact 2
			efact 0
			efact returns 1
		efact returns 2
	efact returns 24
efact returns 720
val it : int = 720 

You can tell the difference between trace points and breakpoints in the trace and breakpoint manager through their prefixes - trace points start with (T), whereas break points start with (B).


MLWorks User Guide version 2.0 for UNIX/Linux - 31 Jul 1998

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker