chickadee » trace

trace

Introduction

The extension provides traced execution of procedures and setting breakpoints on procedure entry.

This replaces the tracing facilities of CHICKEN versions prior to 4.2.12.

Requirements

advice, miscmacros

Documentation

trace

(trace [PROCEDURE ...]) procedure

Modifies the given procedures by printing some information on entry and exit. When given no arguments, (trace) lists all currently traced procedures.

Note that PROCEDURE may be any procedure and doesn't necessarily have to be a toplevel definition.

untrace

(untrace [PROCEDURE ...]) procedure

Removes tracing from PROCEDURE ..., which should previously have been traced with trace. When given no arguments, (untrace) removes untraces all currently traced procedures.

trace/untrace

(trace/untrace PROCEDURE ...) procedure

Toggles tracing on/off for the given procedures.

trace-module

(trace-module MODULENAME ...) procedure

Traces all exported toplevel procedures of the modules with the names given in MODULENAME .... The module must already be loaded. Note that core-library modules can not be traced.

untrace-module

(untrace-module MODULENAME ...) procedure

Untraces all currently traced exports of the given modules.

break

(break [PROCEDURE ...]) procedure

Modifies the given procedures to signal a condition on entry. The condition is of the kinds exn and breakpoint and will terminate execution unless caught. In the interpreter, the condition is accessible on the toplevel using the ,exn command. Use (continue) to continue execution. If no arguments are given, (break) lists all procedures that currently have breakpoints set.

Note that PROCEDURE may be any procedure and doesn't necessarily have to be a toplevel definition.

unbreak

(unbreak [PROCEDURE ...]) procedure

Removes breakpoints from the given procedures (or from all, if no arguments are given).

continue

(continue [CONDITION]) procedure
(c [CONDITION]) procedure

Continues execution from the breakpoint that signalled CONDITION, or from the last breakpoint if CONDITION is not given.

trace-output-port

(trace-output-port [PORT]) parameter

Specifies the port to which tracing information should be written and defaults to the value of (current-output-port).

trace-verbose

(trace-verbose [BOOL]) parameter

If true (the default) show a message when enabling or disabling trace- or break-points for a procedure.

License

This code is placed into the public domain.

Version history

0.6
added trace-module and untrace-module
0.4
added trace/untrace and trace-verbose
0.3
handles non-local exits correctly
0.2
fixed incorrect category
0.1
initial release

Contents »