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 @c docstring begin (texi-doc-string "guile" "display-error")
10 @deffn primitive display-error stack port subr message args rest
11 Display an error message to the output port @var{port}.
12 @var{stack} is the saved stack for the error, @var{subr} is
13 the name of the procedure in which the error occured and
14 @var{message} is the actual error message, which may contain
15 formatting instructions. These will format the arguments in
16 the list @var{args} accordingly. @var{rest} is currently
20 @c docstring begin (texi-doc-string "guile" "display-application")
21 @deffn primitive display-application frame [port [indent]]
22 Display a procedure application @var{frame} to the output port
23 @var{port}. @var{indent} specifies the indentation of the
27 @c docstring begin (texi-doc-string "guile" "display-backtrace")
28 @deffn primitive display-backtrace stack port [first [depth]]
29 Display a backtrace to the output port @var{port}. @var{stack}
30 is the stack to take the backtrace from, @var{first} specifies
31 where in the stack to start and @var{depth} how much frames
32 to display. Both @var{first} and @var{depth} can be @code{#f},
33 which means that default values will be used.
36 @c docstring begin (texi-doc-string "guile" "backtrace")
37 @deffn primitive backtrace
38 Display a backtrace of the stack saved by the last error
39 to the current output port.
42 @c docstring begin (texi-doc-string "guile" "malloc-stats")
43 @deffn primitive malloc-stats
44 Return an alist ((@var{what} . @var{n}) ...) describing number
46 @var{what} is the second argument to @code{scm_must_malloc},
47 @var{n} is the number of objects of that type currently
51 @c docstring begin (texi-doc-string "guile" "debug-options-interface")
52 @deffn primitive debug-options-interface [setting]
53 Option interface for the debug options. Instead of using
54 this procedure directly, use the procedures @code{debug-enable},
55 @code{debug-disable}, @code{debug-set!} and @var{debug-options}.
58 @c docstring begin (texi-doc-string "guile" "with-traps")
59 @deffn primitive with-traps thunk
60 Call @var{thunk} with traps enabled.
63 @c docstring begin (texi-doc-string "guile" "memoized?")
64 @deffn primitive memoized? obj
65 Return @code{#t} if @var{obj} is memoized.
68 @c docstring begin (texi-doc-string "guile" "unmemoize")
69 @deffn primitive unmemoize m
70 Unmemoize the memoized expression @var{m},
73 @c docstring begin (texi-doc-string "guile" "memoized-environment")
74 @deffn primitive memoized-environment m
75 Return the environment of the memoized expression @var{m}.
78 @c docstring begin (texi-doc-string "guile" "procedure-name")
79 @deffn primitive procedure-name proc
80 Return the name of the procedure @var{proc}
83 @c docstring begin (texi-doc-string "guile" "procedure-source")
84 @deffn primitive procedure-source proc
85 Return the source of the procedure @var{proc}.
88 @c docstring begin (texi-doc-string "guile" "procedure-environment")
89 @deffn primitive procedure-environment proc
90 Return the environment of the procedure @var{proc}.
93 @c docstring begin (texi-doc-string "guile" "debug-object?")
94 @deffn primitive debug-object? obj
95 Return @code{#t} if @var{obj} is a debug object.
98 @c docstring begin (texi-doc-string "guile" "frame-arguments")
99 @deffn primitive frame-arguments frame
100 Return the arguments of @var{frame}.
103 @c docstring begin (texi-doc-string "guile" "frame-evaluating-args?")
104 @deffn primitive frame-evaluating-args? frame
105 Return @code{#t} if @var{frame} contains evaluated arguments.
108 @c docstring begin (texi-doc-string "guile" "frame-next")
109 @deffn primitive frame-next frame
110 Return the next frame of @var{frame}, or @code{#f} if
111 @var{frame} is the last frame in its stack.
114 @c docstring begin (texi-doc-string "guile" "frame-number")
115 @deffn primitive frame-number frame
116 Return the frame number of @var{frame}.
119 @c docstring begin (texi-doc-string "guile" "frame-overflow?")
120 @deffn primitive frame-overflow? frame
121 Return @code{#t} if @var{frame} is an overflow frame.
124 @c docstring begin (texi-doc-string "guile" "frame-previous")
125 @deffn primitive frame-previous frame
126 Return the previous frame of @var{frame}, or @code{#f} if
127 @var{frame} is the first frame in its stack.
130 @c docstring begin (texi-doc-string "guile" "frame-procedure")
131 @deffn primitive frame-procedure frame
132 Return the procedure for @var{frame}, or @code{#f} if no
133 procedure is associated with @var{frame}.
136 @c docstring begin (texi-doc-string "guile" "frame-procedure?")
137 @deffn primitive frame-procedure? frame
138 Return @code{#t} if a procedure is associated with @var{frame}.
141 @c docstring begin (texi-doc-string "guile" "frame-real?")
142 @deffn primitive frame-real? frame
143 Return @code{#t} if @var{frame} is a real frame.
146 @c docstring begin (texi-doc-string "guile" "frame-source")
147 @deffn primitive frame-source frame
148 Return the source of @var{frame}.
151 @c docstring begin (texi-doc-string "guile" "frame?")
152 @deffn primitive frame? obj
153 Return @code{#t} if @var{obj} is a stack frame.
156 @c docstring begin (texi-doc-string "guile" "last-stack-frame")
157 @deffn primitive last-stack-frame obj
158 Return a stack which consists of a single frame, which is the
159 last stack frame for @var{obj}. @var{obj} must be either a
160 debug object or a continuation.
163 @c docstring begin (texi-doc-string "guile" "make-stack")
164 @deffn primitive make-stack obj . args
165 Create a new stack. If @var{obj} is @code{#t}, the current
166 evaluation stack is used for creating the stack frames,
167 otherwise the frames are taken from @var{obj} (which must be
168 either a debug object or a continuation).
169 @var{args} must be a list if integers and specifies how the
170 resulting stack will be narrowed.
173 @c docstring begin (texi-doc-string "guile" "stack-id")
174 @deffn primitive stack-id stack
175 Return the identifier given to @var{stack} by @code{start-stack}.
178 @c docstring begin (texi-doc-string "guile" "stack-length")
179 @deffn primitive stack-length stack
180 Return the length of @var{stack}.
183 @c docstring begin (texi-doc-string "guile" "stack-ref")
184 @deffn primitive stack-ref stack i
185 Return the @var{i}'th frame from @var{stack}.
188 @c docstring begin (texi-doc-string "guile" "stack?")
189 @deffn primitive stack? obj
190 Return @code{#t} if @var{obj} is a calling stack.
195 @c TeX-master: "guile.texi"