Added tracing capabilities to debugtools.lua