3 @chapter Internal Debugging Interface
5 --- The name of this chapter needs to clearly distinguish it
6 from the appendix describing the debugger UI. The intro
7 should have a pointer to the UI appendix.
9 @deffn primitive display-error stack port subr message args rest
10 Display an error message to the output port @var{port}.
11 @var{stack} is the saved stack for the error, @var{subr} is
12 the name of the procedure in which the error occured and
13 @var{message} is the actual error message, which may contain
14 formatting instructions. These will format the arguments in
15 the list @var{args} accordingly. @var{rest} is currently
19 @deffn primitive display-application frame [port [indent]]
20 Display a procedure application @var{frame} to the output port
21 @var{port}. @var{indent} specifies the indentation of the
25 @deffn primitive display-backtrace stack port [first [depth]]
26 Display a backtrace to the output port @var{port}. @var{stack}
27 is the stack to take the backtrace from, @var{first} specifies
28 where in the stack to start and @var{depth} how much frames
29 to display. Both @var{first} and @var{depth} can be @code{#f},
30 which means that default values will be used.
33 @deffn primitive backtrace
34 Display a backtrace of the stack saved by the last error
35 to the current output port.
38 @deffn primitive malloc-stats
39 Return an alist ((@var{what} . @var{n}) ...) describing number
41 @var{what} is the second argument to @code{scm_must_malloc},
42 @var{n} is the number of objects of that type currently
46 @deffn primitive debug-options-interface [setting]
47 Option interface for the debug options. Instead of using
48 this procedure directly, use the procedures @code{debug-enable},
49 @code{debug-disable}, @code{debug-set!} and @var{debug-options}.
52 @deffn primitive with-traps thunk
53 Call @var{thunk} with traps enabled.
56 @deffn primitive memoized? obj
57 Return @code{#t} if @var{obj} is memoized.
60 @deffn primitive unmemoize m
61 Unmemoize the memoized expression @var{m},
64 @deffn primitive memoized-environment m
65 Return the environment of the memoized expression @var{m}.
68 @deffn primitive procedure-name proc
69 Return the name of the procedure @var{proc}
72 @deffn primitive procedure-source proc
73 Return the source of the procedure @var{proc}.
76 @deffn primitive procedure-environment proc
77 Return the environment of the procedure @var{proc}.
80 @deffn primitive debug-object? obj
81 Return @code{#t} if @var{obj} is a debug object.
84 @deffn primitive frame-arguments frame
85 Return the arguments of @var{frame}.
88 @deffn primitive frame-evaluating-args? frame
89 Return @code{#t} if @var{frame} contains evaluated arguments.
92 @deffn primitive frame-next frame
93 Return the next frame of @var{frame}, or @code{#f} if
94 @var{frame} is the last frame in its stack.
97 @deffn primitive frame-number frame
98 Return the frame number of @var{frame}.
101 @deffn primitive frame-overflow? frame
102 Return @code{#t} if @var{frame} is an overflow frame.
105 @deffn primitive frame-previous frame
106 Return the previous frame of @var{frame}, or @code{#f} if
107 @var{frame} is the first frame in its stack.
110 @deffn primitive frame-procedure frame
111 Return the procedure for @var{frame}, or @code{#f} if no
112 procedure is associated with @var{frame}.
115 @deffn primitive frame-procedure? frame
116 Return @code{#t} if a procedure is associated with @var{frame}.
119 @deffn primitive frame-real? frame
120 Return @code{#t} if @var{frame} is a real frame.
123 @deffn primitive frame-source frame
124 Return the source of @var{frame}.
127 @deffn primitive frame? obj
128 Return @code{#t} if @var{obj} is a stack frame.
131 @deffn primitive last-stack-frame obj
132 Return a stack which consists of a single frame, which is the
133 last stack frame for @var{obj}. @var{obj} must be either a
134 debug object or a continuation.
137 @deffn primitive make-stack obj . args
138 Create a new stack. If @var{obj} is @code{#t}, the current
139 evaluation stack is used for creating the stack frames,
140 otherwise the frames are taken from @var{obj} (which must be
141 either a debug object or a continuation).
142 @var{args} must be a list of integers and specifies how the
143 resulting stack will be narrowed.
146 @deffn primitive stack-id stack
147 Return the identifier given to @var{stack} by @code{start-stack}.
150 @deffn primitive stack-length stack
151 Return the length of @var{stack}.
154 @deffn primitive stack-ref stack i
155 Return the @var{i}'th frame from @var{stack}.
158 @deffn primitive stack? obj
159 Return @code{#t} if @var{obj} is a calling stack.
164 @c TeX-master: "guile.texi"