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 | ||
38a93523 NJ |
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 | |
16 | ignored. | |
17 | @end deffn | |
18 | ||
38a93523 NJ |
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 | |
22 | output. | |
23 | @end deffn | |
24 | ||
38a93523 NJ |
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. | |
31 | @end deffn | |
32 | ||
38a93523 NJ |
33 | @deffn primitive backtrace |
34 | Display a backtrace of the stack saved by the last error | |
35 | to the current output port. | |
36 | @end deffn | |
37 | ||
38a93523 NJ |
38 | @deffn primitive malloc-stats |
39 | Return an alist ((@var{what} . @var{n}) ...) describing number | |
40 | of malloced objects. | |
41 | @var{what} is the second argument to @code{scm_must_malloc}, | |
42 | @var{n} is the number of objects of that type currently | |
43 | allocated. | |
44 | @end deffn | |
45 | ||
38a93523 NJ |
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}. | |
50 | @end deffn | |
51 | ||
38a93523 NJ |
52 | @deffn primitive with-traps thunk |
53 | Call @var{thunk} with traps enabled. | |
54 | @end deffn | |
55 | ||
38a93523 NJ |
56 | @deffn primitive memoized? obj |
57 | Return @code{#t} if @var{obj} is memoized. | |
58 | @end deffn | |
59 | ||
38a93523 NJ |
60 | @deffn primitive unmemoize m |
61 | Unmemoize the memoized expression @var{m}, | |
62 | @end deffn | |
63 | ||
38a93523 NJ |
64 | @deffn primitive memoized-environment m |
65 | Return the environment of the memoized expression @var{m}. | |
66 | @end deffn | |
67 | ||
38a93523 NJ |
68 | @deffn primitive procedure-name proc |
69 | Return the name of the procedure @var{proc} | |
70 | @end deffn | |
71 | ||
38a93523 NJ |
72 | @deffn primitive procedure-source proc |
73 | Return the source of the procedure @var{proc}. | |
74 | @end deffn | |
75 | ||
38a93523 NJ |
76 | @deffn primitive procedure-environment proc |
77 | Return the environment of the procedure @var{proc}. | |
78 | @end deffn | |
79 | ||
38a93523 NJ |
80 | @deffn primitive debug-object? obj |
81 | Return @code{#t} if @var{obj} is a debug object. | |
82 | @end deffn | |
83 | ||
38a93523 NJ |
84 | @deffn primitive frame-arguments frame |
85 | Return the arguments of @var{frame}. | |
86 | @end deffn | |
87 | ||
38a93523 NJ |
88 | @deffn primitive frame-evaluating-args? frame |
89 | Return @code{#t} if @var{frame} contains evaluated arguments. | |
90 | @end deffn | |
91 | ||
38a93523 NJ |
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. | |
95 | @end deffn | |
96 | ||
38a93523 NJ |
97 | @deffn primitive frame-number frame |
98 | Return the frame number of @var{frame}. | |
99 | @end deffn | |
100 | ||
38a93523 NJ |
101 | @deffn primitive frame-overflow? frame |
102 | Return @code{#t} if @var{frame} is an overflow frame. | |
103 | @end deffn | |
104 | ||
38a93523 NJ |
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. | |
108 | @end deffn | |
109 | ||
38a93523 NJ |
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}. | |
113 | @end deffn | |
114 | ||
38a93523 NJ |
115 | @deffn primitive frame-procedure? frame |
116 | Return @code{#t} if a procedure is associated with @var{frame}. | |
117 | @end deffn | |
118 | ||
38a93523 NJ |
119 | @deffn primitive frame-real? frame |
120 | Return @code{#t} if @var{frame} is a real frame. | |
121 | @end deffn | |
122 | ||
38a93523 NJ |
123 | @deffn primitive frame-source frame |
124 | Return the source of @var{frame}. | |
125 | @end deffn | |
126 | ||
38a93523 NJ |
127 | @deffn primitive frame? obj |
128 | Return @code{#t} if @var{obj} is a stack frame. | |
129 | @end deffn | |
130 | ||
38a93523 NJ |
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. | |
135 | @end deffn | |
136 | ||
38a93523 NJ |
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). | |
7a095584 | 142 | @var{args} must be a list of integers and specifies how the |
38a93523 NJ |
143 | resulting stack will be narrowed. |
144 | @end deffn | |
145 | ||
38a93523 NJ |
146 | @deffn primitive stack-id stack |
147 | Return the identifier given to @var{stack} by @code{start-stack}. | |
148 | @end deffn | |
149 | ||
38a93523 NJ |
150 | @deffn primitive stack-length stack |
151 | Return the length of @var{stack}. | |
152 | @end deffn | |
153 | ||
38a93523 NJ |
154 | @deffn primitive stack-ref stack i |
155 | Return the @var{i}'th frame from @var{stack}. | |
156 | @end deffn | |
157 | ||
38a93523 NJ |
158 | @deffn primitive stack? obj |
159 | Return @code{#t} if @var{obj} is a calling stack. | |
160 | @end deffn | |
161 | ||
162 | ||
163 | @c Local Variables: | |
164 | @c TeX-master: "guile.texi" | |
165 | @c End: |