deprecate arity access via (procedure-properties proc 'arity)
[bpt/guile.git] / emacs / gds-faq.txt
CommitLineData
1a228575
NJ
1
2* Installation
3
4** How do I install guile-debugging?
5
6After unpacking the .tar.gz file, run the usual sequence of commands:
7
8$ ./configure
9$ make
10$ sudo make install
11
12Then you need to make sure that the directory where guile-debugging's
13Scheme files were installed is included in your Guile's load path.
14(The sequence above will usually install guile-debugging under
15/usr/local, and /usr/local is not in Guile's load path by default,
16unless Guile itself was installed under /usr/local.) You can discover
17your Guile's default load path by typing
18
19$ guile -q -c '(begin (write %load-path) (newline))'
20
21There are two ways to add guile-debugging's installation directory to
22Guile's load path, if it isn't already there.
23
241. Edit or create the `init.scm' file, which Guile reads on startup,
25 so that it includes a line like this:
26
27 (set! %load-path (cons "/usr/local/share/guile" %load-path))
28
29 but with "/usr/local" replaced by the prefix that you installed
30 guile-debugging under, if not /usr/local.
31
32 The init.scm file must be installed (if it does not already exist
33 there) in one of the directories in Guile's default load-path.
34
352. Add this line to your .emacs file:
36
37 (setq gds-scheme-directory "/usr/local/share/guile")
38
39 before the `require' or `load' line that loads GDS, but with
40 "/usr/local" replaced by the prefix that you installed
41 guile-debugging under, if not /usr/local.
42
43Finally, if you want guile-debugging's GDS interface to be loaded
44automatically whenever you run Emacs, add this line to your .emacs:
45
46(require 'gds)
47
48* Troubleshooting
49
50** "error in process filter" when starting Emacs (or loading GDS)
51
52This is caused by an internal error in GDS's Scheme code, for which a
53backtrace will have appeared in the gds-debug buffer, so please switch
54to the gds-debug buffer and see what it says there.
55
56The most common cause is a load path problem: Guile cannot find GDS's
57Scheme code because it is not in the known load path. In this case
58you should see the error message "no code for module" somewhere in the
59backtrace. If you see this, please try the remedies described in `How
60do I install guile-debugging?' above, then restart Emacs and see if
61the problem has been cured.
62
63If you don't see "no code for module", or if the described remedies
64don't fix the problem, please send the contents of the gds-debug
65buffer to me at <neil@ossau.uklinux.net>, so I can debug the problem.
66
67If you don't see a backtrace at all in the gds-debug buffer, try the
68next item ...
69
70** "error in process filter" at some other time
71
72This is caused by an internal error somewhere in GDS's Emacs Lisp
73code. If possible, please
74
75- switch on the `debug-on-error' option (M-x set-variable RET
76 debug-on-error RET t RET)
77
78- do whatever you were doing so that the same error happens again
79
80- send the Emacs Lisp stack trace which pops up to me at
81 <neil@ossau.uklinux.net>.
82
83If that doesn't work, please just mail me with as much detail as
84possible of what you were doing when the error occurred.
85
86* GDS Features
87
88** How do I inspect variable values?
89
90Type `e' followed by the name of the variable, then <RET>. This
91works whenever GDS is displaying a stack for an error at at a
92breakpoint. (You can actually `e' to evaluate any expression in the
93local environment of the selected stack frame; inspecting variables is
94the special case of this where the expression is only a variable name.)
95
96If GDS is displaying the associated source code in the window above or
97below the stack, you can see the values of any variables in the
98highlighted code just by hovering your mouse over them.
99
100** How do I change a variable's value?
101
102Type `e' and then `(set! VARNAME NEWVAL)', where VARNAME is the name
103of the variable you want to set and NEWVAL is an expression which
104Guile can evaluate to get the new value. This works whenever GDS is
105displaying a stack for an error at at a breakpoint. The setting will
106take effect in the local environment of the selected stack frame.
107
108** How do I change the expression that Guile is about to evaluate?
109
110Type `t' followed by the expression that you want Guile to evaluate
111instead, then <RET>.
112
113Then type one of the commands that tells Guile to continue execution.
114
115(Tweaking expressions, as described here, is only supported by the
116latest CVS version of Guile. The GDS stack display tells you when
117tweaking is possible by adding "(tweakable)" to the first line of the
118stack window.)
119
120** How do I return a value from the current stack frame different to what the evaluator has calculated?
121
122You have to be at the normal exit of the relevant frame first, so if
123GDS is not already showing you the normally calculated return value,
124type `o' to finish the evaluation of the selected frame.
125
126Then type `t' followed by the value you want to return, and <RET>.
127The value that you type can be any expression, but note that it will
128not be evaluated before being returned; for example if you type `(+ 2
1293)', the return value will be a three-element list, not 5.
130
131Finally type one of the commands that tells Guile to continue
132execution.
133
134(Tweaking return values, as described here, is only supported by the
135latest CVS version of Guile. The GDS stack display tells you when
136tweaking is possible by adding "(tweakable)" to the first line of the
137stack window.)
138
139** How do I step over a line of code?
140
141Scheme isn't organized by lines, so it doesn't really make sense to
142think of stepping over lines. Instead please see the next entry on
143stepping over expressions.
144
145** How do I step over an expression?
146
147It depends what you mean by "step over". If you mean that you want
148Guile to evaluate that expression normally, but then show you its
149return value, type `o', which does exactly that.
150
151If you mean that you want to skip the evaluation of that expression
152(for example because it has side effects that you don't want to
153happen), use `t' to change the expression to something else which
154Guile will evaluate instead.
155
156There has to be a substitute expression so Guile can calculate a value
157to return to the calling frame. If you know at a particular point
158that the return value is not important, you can type `t #f <RET>' or
159`t 0 <RET>'.
160
161See `How do I change the expression that Guile is about to evaluate?'
162above for more on using `t'.
163
164** How do I move up and down the call stack?
165
166Type `u' to move up and `d' to move down. "Up" in GDS means to a more
167"inner" frame, and "down" means to a more "outer" frame.
168
169** How do I run until the next breakpoint?
170
171Type `g' (for "go").
172
173** How do I run until the end of the selected stack frame?
174
175Type `o'.
176
177** How do I set a breakpoint?
178
179First identify the code that you want to set the breakpoint in, and
180what kind of breakpoint you want. To set a breakpoint on entry to a
181top level procedure, move the cursor to anywhere in the procedure
182definition, and make sure that the region/mark is inactive. To set a
183breakpoint on a particular expression (or sequence of expressions) set
184point and mark so that the region covers the opening parentheses of
185all the target expressions.
186
187Then type ...
188
189 `C-c C-b d' for a `debug' breakpoint, which means that GDS will
190 display the stack when the breakpoint is hit
191
192 `C-c C-b t' for a `trace' breakpoint, which means that the start and
193 end of the relevant procedure or expression(s) will be traced to the
194 *GDS Trace* buffer
195
196 `C-c C-b T' for a `trace-subtree' breakpoint, which means that every
197 evaluation step involved in the evaluation of the relevant procedure
198 or expression(s) will be traced to the *GDS Trace* buffer.
199
200You can also type `C-x <SPC>', which does the same as one of the
201above, depending on the value of `gds-default-breakpoint-type'.
202
203** How do I clear a breakpoint?
204
205Select a region containing the breakpoints that you want to clear, and
206type `C-c C-b <DEL>'.
207
208** How do I trace calls to a particular procedure or evaluations of a particular expression?
209
210In GDS this means setting a breakpoint whose type is `trace' or
211`trace-subtree'. See `How do I set a breakpoint?' above.
212
213* Development
214
215** How can I follow or contribute to guile-debugging's development?
216
217guile-debugging is hosted at http://gna.org, so please see the project
218page there. Feel free to raise bugs, tasks containing patches or
219feature requests, and so on. You can also write directly to me by
220email: <neil@ossau.uklinux.net>.
221
222
223Local Variables:
224mode: outline
225End: