* tags.h (scm_tc7_variable): New.
[bpt/guile.git] / doc / scheme-debug.texi
CommitLineData
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
10Display an error message to the output port @var{port}.
11@var{stack} is the saved stack for the error, @var{subr} is
12the name of the procedure in which the error occured and
13@var{message} is the actual error message, which may contain
14formatting instructions. These will format the arguments in
15the list @var{args} accordingly. @var{rest} is currently
16ignored.
17@end deffn
18
38a93523
NJ
19@deffn primitive display-application frame [port [indent]]
20Display a procedure application @var{frame} to the output port
21@var{port}. @var{indent} specifies the indentation of the
22output.
23@end deffn
24
38a93523
NJ
25@deffn primitive display-backtrace stack port [first [depth]]
26Display a backtrace to the output port @var{port}. @var{stack}
27is the stack to take the backtrace from, @var{first} specifies
28where in the stack to start and @var{depth} how much frames
29to display. Both @var{first} and @var{depth} can be @code{#f},
30which means that default values will be used.
31@end deffn
32
38a93523
NJ
33@deffn primitive backtrace
34Display a backtrace of the stack saved by the last error
35to the current output port.
36@end deffn
37
38a93523
NJ
38@deffn primitive malloc-stats
39Return an alist ((@var{what} . @var{n}) ...) describing number
40of 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
43allocated.
44@end deffn
45
38a93523
NJ
46@deffn primitive debug-options-interface [setting]
47Option interface for the debug options. Instead of using
48this 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
53Call @var{thunk} with traps enabled.
54@end deffn
55
38a93523
NJ
56@deffn primitive memoized? obj
57Return @code{#t} if @var{obj} is memoized.
58@end deffn
59
38a93523
NJ
60@deffn primitive unmemoize m
61Unmemoize the memoized expression @var{m},
62@end deffn
63
38a93523
NJ
64@deffn primitive memoized-environment m
65Return the environment of the memoized expression @var{m}.
66@end deffn
67
38a93523
NJ
68@deffn primitive procedure-name proc
69Return the name of the procedure @var{proc}
70@end deffn
71
38a93523
NJ
72@deffn primitive procedure-source proc
73Return the source of the procedure @var{proc}.
74@end deffn
75
38a93523
NJ
76@deffn primitive procedure-environment proc
77Return the environment of the procedure @var{proc}.
78@end deffn
79
38a93523
NJ
80@deffn primitive debug-object? obj
81Return @code{#t} if @var{obj} is a debug object.
82@end deffn
83
38a93523
NJ
84@deffn primitive frame-arguments frame
85Return the arguments of @var{frame}.
86@end deffn
87
38a93523
NJ
88@deffn primitive frame-evaluating-args? frame
89Return @code{#t} if @var{frame} contains evaluated arguments.
90@end deffn
91
38a93523
NJ
92@deffn primitive frame-next frame
93Return 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
98Return the frame number of @var{frame}.
99@end deffn
100
38a93523
NJ
101@deffn primitive frame-overflow? frame
102Return @code{#t} if @var{frame} is an overflow frame.
103@end deffn
104
38a93523
NJ
105@deffn primitive frame-previous frame
106Return 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
111Return the procedure for @var{frame}, or @code{#f} if no
112procedure is associated with @var{frame}.
113@end deffn
114
38a93523
NJ
115@deffn primitive frame-procedure? frame
116Return @code{#t} if a procedure is associated with @var{frame}.
117@end deffn
118
38a93523
NJ
119@deffn primitive frame-real? frame
120Return @code{#t} if @var{frame} is a real frame.
121@end deffn
122
38a93523
NJ
123@deffn primitive frame-source frame
124Return the source of @var{frame}.
125@end deffn
126
38a93523
NJ
127@deffn primitive frame? obj
128Return @code{#t} if @var{obj} is a stack frame.
129@end deffn
130
38a93523
NJ
131@deffn primitive last-stack-frame obj
132Return a stack which consists of a single frame, which is the
133last stack frame for @var{obj}. @var{obj} must be either a
134debug object or a continuation.
135@end deffn
136
38a93523
NJ
137@deffn primitive make-stack obj . args
138Create a new stack. If @var{obj} is @code{#t}, the current
139evaluation stack is used for creating the stack frames,
140otherwise the frames are taken from @var{obj} (which must be
141either a debug object or a continuation).
7a095584 142@var{args} must be a list of integers and specifies how the
38a93523
NJ
143resulting stack will be narrowed.
144@end deffn
145
38a93523
NJ
146@deffn primitive stack-id stack
147Return the identifier given to @var{stack} by @code{start-stack}.
148@end deffn
149
38a93523
NJ
150@deffn primitive stack-length stack
151Return the length of @var{stack}.
152@end deffn
153
38a93523
NJ
154@deffn primitive stack-ref stack i
155Return the @var{i}'th frame from @var{stack}.
156@end deffn
157
38a93523
NJ
158@deffn primitive stack? obj
159Return @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: