Commit | Line | Data |
---|---|---|
38a93523 NJ |
1 | @page |
2 | @node Debugging | |
3 | @chapter Internal Debugging Interface | |
4 | ||
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. | |
8 | ||
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 | |
17 | ignored. | |
18 | @end deffn | |
19 | ||
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 | |
24 | output. | |
25 | @end deffn | |
26 | ||
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. | |
34 | @end deffn | |
35 | ||
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. | |
40 | @end deffn | |
41 | ||
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 | |
45 | of malloced objects. | |
46 | @var{what} is the second argument to @code{scm_must_malloc}, | |
47 | @var{n} is the number of objects of that type currently | |
48 | allocated. | |
49 | @end deffn | |
50 | ||
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}. | |
56 | @end deffn | |
57 | ||
58 | @c docstring begin (texi-doc-string "guile" "with-traps") | |
59 | @deffn primitive with-traps thunk | |
60 | Call @var{thunk} with traps enabled. | |
61 | @end deffn | |
62 | ||
63 | @c docstring begin (texi-doc-string "guile" "memoized?") | |
64 | @deffn primitive memoized? obj | |
65 | Return @code{#t} if @var{obj} is memoized. | |
66 | @end deffn | |
67 | ||
68 | @c docstring begin (texi-doc-string "guile" "unmemoize") | |
69 | @deffn primitive unmemoize m | |
70 | Unmemoize the memoized expression @var{m}, | |
71 | @end deffn | |
72 | ||
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}. | |
76 | @end deffn | |
77 | ||
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} | |
81 | @end deffn | |
82 | ||
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}. | |
86 | @end deffn | |
87 | ||
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}. | |
91 | @end deffn | |
92 | ||
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. | |
96 | @end deffn | |
97 | ||
98 | @c docstring begin (texi-doc-string "guile" "frame-arguments") | |
99 | @deffn primitive frame-arguments frame | |
100 | Return the arguments of @var{frame}. | |
101 | @end deffn | |
102 | ||
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. | |
106 | @end deffn | |
107 | ||
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. | |
112 | @end deffn | |
113 | ||
114 | @c docstring begin (texi-doc-string "guile" "frame-number") | |
115 | @deffn primitive frame-number frame | |
116 | Return the frame number of @var{frame}. | |
117 | @end deffn | |
118 | ||
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. | |
122 | @end deffn | |
123 | ||
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. | |
128 | @end deffn | |
129 | ||
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}. | |
134 | @end deffn | |
135 | ||
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}. | |
139 | @end deffn | |
140 | ||
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. | |
144 | @end deffn | |
145 | ||
146 | @c docstring begin (texi-doc-string "guile" "frame-source") | |
147 | @deffn primitive frame-source frame | |
148 | Return the source of @var{frame}. | |
149 | @end deffn | |
150 | ||
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. | |
154 | @end deffn | |
155 | ||
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. | |
161 | @end deffn | |
162 | ||
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. | |
171 | @end deffn | |
172 | ||
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}. | |
176 | @end deffn | |
177 | ||
178 | @c docstring begin (texi-doc-string "guile" "stack-length") | |
179 | @deffn primitive stack-length stack | |
180 | Return the length of @var{stack}. | |
181 | @end deffn | |
182 | ||
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}. | |
186 | @end deffn | |
187 | ||
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. | |
191 | @end deffn | |
192 | ||
193 | ||
194 | @c Local Variables: | |
195 | @c TeX-master: "guile.texi" | |
196 | @c End: |