-----

Debugging commands

-----

Scheme48 includes a debugger and an inspector.

Debugging commands

,preview
Sort of like a backtrace, but because of tail recursion you see less than you might in debuggers for some other languages.

,threads
Invoke the inspector on the threads running on the next level out.

,proceed < exp > ...
Proceed after an interrupt or error, delivering the values of ... to the continuation.

,trace < name > ...
Start tracing calls to the named procedure or procedures. With no arguments, displays all procedures currently traced. This affects the binding of <name>, not the behavior of the procedure that's it's current value. The effect is similar to (define <name> (make-traced <name>)) where make-traced is a procedure-returning procedure.

,untrace < name > ...
Stop tracing calls to the named procedure or procedures. With no argument, stop tracing all calls to all procedures.

,condition
The ,condition command selects and displays the condition object describing the error or interrupt that initiated the current command level. This is particularly useful in conjunction with the inspector. E.g. if a procedure is passed the wrong number of arguments, do ,condition followed by ,inspect ## to inspect the procedure and its arguments.

,bound? < name >
Display the binding of <name>, if there is one.

,expand < name >
Show macro expansion of <form>, if any.

,where < procedure >
Display name of source file in which <procedure> is defined.

Inspector

There is a low-tech inspector available via the ,inspect and ,debug commands. The ,inspect command starts an inspector command loop. There is a focus object (the same as the command processor's ##), for which a menu of selectable components is displayed. To inspect a particular component, just type the corresponding number in the menu. For example:

	,inspect '(a (b c) d)
	(a (b c) d)

	[0] a
	[1] (b c)
	[2] d
	inspect: 1
	(b c)

	[0] b
	[1] c
	inspect: 

When a new object is selected, the previous one is pushed onto a stack. You can pop the stack, reverting to the previous object, with the U command.

The inspector is particularly useful with procedures, continuations, and records.

Other inspector commands:

u
pop object stack
d
down stack (current object must be a continuation)
m
print more of a long menu
(...)
evaluate a form and select result
t
select a closure or continuation's template
q
quit

## is always the object currently being inspected. After a Q command, or an error in the inspector, ## is the last object that was being inspected.

The inspector also accepts arbitrary command processor commands, e.g. the ,dis command (see below). The leading comma is optional.

After an error occurs, ,debug invokes the inspector on the continuation at the point of the error. The U and D (up and down) commands then make the inspector look like a conventional stack debugger, with continuations playing the role of stack frames. D goes to older or deeper continuations (frames), and U goes back up to more recent ones.

Templates are the static components of procedures; these are found inside of procedures and continuations, and contain the quoted constants and top-level variables referred to by byte-compiled code.

-----

Ownership, Maintenance and Disclaimers

Scheme48 Manual Top Page

Envision Manual Top Page

Last modified