Go to the first, previous, next, last section, table of contents.


Internal Debugging Interface

--- The name of this chapter needs to clearly distinguish it from the appendix describing the debugger UI. The intro should have a pointer to the UI appendix.

Scheme Procedure: display-error stack port subr message args rest
C Function: scm_display_error (stack, port, subr, message, args, rest)
Display an error message to the output port port. stack is the saved stack for the error, subr is the name of the procedure in which the error occurred and message is the actual error message, which may contain formatting instructions. These will format the arguments in the list args accordingly. rest is currently ignored.

Scheme Procedure: display-application frame [port [indent]]
C Function: scm_display_application (frame, port, indent)
Display a procedure application frame to the output port port. indent specifies the indentation of the output.

Scheme Procedure: display-backtrace stack port [first [depth]]
C Function: scm_display_backtrace (stack, port, first, depth)
Display a backtrace to the output port port. stack is the stack to take the backtrace from, first specifies where in the stack to start and depth how much frames to display. Both first and depth can be #f, which means that default values will be used.

Scheme Procedure: backtrace
C Function: scm_backtrace ()
Display a backtrace of the stack saved by the last error to the current output port.

Scheme Procedure: malloc-stats
Return an alist ((what . n) ...) describing number of malloced objects. what is the second argument to scm_gc_malloc, n is the number of objects of that type currently allocated.

Scheme Procedure: debug-options-interface [setting]
C Function: scm_debug_options (setting)
Option interface for the debug options. Instead of using this procedure directly, use the procedures debug-enable, debug-disable, debug-set! and debug-options.

Scheme Procedure: with-traps thunk
C Function: scm_with_traps (thunk)
Call thunk with traps enabled.

Scheme Procedure: memoized? obj
C Function: scm_memoized_p (obj)
Return #t if obj is memoized.

Scheme Procedure: unmemoize m
C Function: scm_unmemoize (m)
Unmemoize the memoized expression m,

Scheme Procedure: memoized-environment m
C Function: scm_memoized_environment (m)
Return the environment of the memoized expression m.

Scheme Procedure: procedure-name proc
C Function: scm_procedure_name (proc)
Return the name of the procedure proc

Scheme Procedure: procedure-source proc
C Function: scm_procedure_source (proc)
Return the source of the procedure proc.

Scheme Procedure: procedure-environment proc
C Function: scm_procedure_environment (proc)
Return the environment of the procedure proc.

Scheme Procedure: debug-object? obj
C Function: scm_debug_object_p (obj)
Return #t if obj is a debug object.

Scheme Procedure: frame-arguments frame
C Function: scm_frame_arguments (frame)
Return the arguments of frame.

Scheme Procedure: frame-evaluating-args? frame
C Function: scm_frame_evaluating_args_p (frame)
Return #t if frame contains evaluated arguments.

Scheme Procedure: frame-next frame
C Function: scm_frame_next (frame)
Return the next frame of frame, or #f if frame is the last frame in its stack.

Scheme Procedure: frame-number frame
C Function: scm_frame_number (frame)
Return the frame number of frame.

Scheme Procedure: frame-overflow? frame
C Function: scm_frame_overflow_p (frame)
Return #t if frame is an overflow frame.

Scheme Procedure: frame-previous frame
C Function: scm_frame_previous (frame)
Return the previous frame of frame, or #f if frame is the first frame in its stack.

Scheme Procedure: frame-procedure frame
C Function: scm_frame_procedure (frame)
Return the procedure for frame, or #f if no procedure is associated with frame.

Scheme Procedure: frame-procedure? frame
C Function: scm_frame_procedure_p (frame)
Return #t if a procedure is associated with frame.

Scheme Procedure: frame-real? frame
C Function: scm_frame_real_p (frame)
Return #t if frame is a real frame.

Scheme Procedure: frame-source frame
C Function: scm_frame_source (frame)
Return the source of frame.

Scheme Procedure: frame? obj
C Function: scm_frame_p (obj)
Return #t if obj is a stack frame.

Scheme Procedure: last-stack-frame obj
C Function: scm_last_stack_frame (obj)
Return a stack which consists of a single frame, which is the last stack frame for obj. obj must be either a debug object or a continuation.

Scheme Procedure: make-stack obj . args
C Function: scm_make_stack (obj, args)
Create a new stack. If obj is #t, the current evaluation stack is used for creating the stack frames, otherwise the frames are taken from obj (which must be either a debug object or a continuation).

args should be a list containing any combination of integer, procedure and #t values.

These values specify various ways of cutting away uninteresting stack frames from the top and bottom of the stack that make-stack returns. They come in pairs like this: (inner_cut_1 outer_cut_1 inner_cut_2 outer_cut_2 ...).

Each inner_cut_N can be #t, an integer, or a procedure. #t means to cut away all frames up to but excluding the first user module frame. An integer means to cut away exactly that number of frames. A procedure means to cut away all frames up to but excluding the application frame whose procedure matches the specified one.

Each outer_cut_N can be an integer or a procedure. An integer means to cut away that number of frames. A procedure means to cut away frames down to but excluding the application frame whose procedure matches the specified one.

If the outer_cut_N of the last pair is missing, it is taken as 0.

Scheme Procedure: stack-id stack
C Function: scm_stack_id (stack)
Return the identifier given to stack by start-stack.

Scheme Procedure: stack-length stack
C Function: scm_stack_length (stack)
Return the length of stack.

Scheme Procedure: stack-ref stack index
C Function: scm_stack_ref (stack, index)
Return the index'th frame from stack.

Scheme Procedure: stack? obj
C Function: scm_stack_p (obj)
Return #t if obj is a calling stack.


Go to the first, previous, next, last section, table of contents.