Debugging Standard ML

Abstract:

Traditional ''source--level'' debuggers for compiled languages
actually operate at machine level, which makes them complex, difficult
to port, and intolerant of compiler optimization. For type--safe
languages, however, debugging support can be provided without
reference to the underlying machine, by adding instrumentation to
program source code before compilation. Because the instrumented code
is (almost) ordinary source, it can be processed by the ordinary
compiler. The debugger is thus independent from the underlying
hardware and runtime systems, and from the optimization strategies
used by the compiler. This dissertation describes the design and
implementation of instrumentation--based debuggers for the Standard ML
of New Jersey compiler. Three systems are described: a simple
debugger with ordinary variable display and breakpoint facilities, a
debugger supporting --- and taking advantage of --- reverse execution,
and a debugger for ML Threads, a concurrent extension of ML running on
multiprocessors. A formal operational semantics for a subset of ML is
used to define debugging operations precisely, and to provide a basis
for determining the concrete types of polymorphic variables at
runtime. Debugger performance measurements are presented for a range
of real programs.