1 | ABCL-STEPPER |
---|
2 | ============ |
---|
3 | |
---|
4 | ABCL-STEPPER provides a working implementation of an stepper as a replacement for the empty cl:step, you can get more documentation in the related paper presented in the European Lisp Symposium (ELS) 2023, see https://zenodo.org/record/7815887 |
---|
5 | |
---|
6 | Some characteristics: |
---|
7 | |
---|
8 | - For intepreted code, it won't step into compiled functions |
---|
9 | |
---|
10 | - It is ready to use from a plain REPL and from SLIME. |
---|
11 | |
---|
12 | - In general it doesn't handle unexpected conditions in the code to step, if the the code to step fails the stepper will fail too |
---|
13 | |
---|
14 | ':?' will print a minimal help (you can type :help) |
---|
15 | |
---|
16 | ':i' can inspect variables and symbols (case-insensitive when inspecting, you can also type :inspect) |
---|
17 | |
---|
18 | ':c' will resume the evaluation until the end without the stepper (you can type :continue) |
---|
19 | |
---|
20 | ':s' will resume the evaluation until the next form to be analyzed (you can type :step) |
---|
21 | |
---|
22 | ':sn' will to step to the next form |
---|
23 | |
---|
24 | ':l' will show the local bindings for variables and functions |
---|
25 | in the current environment passed to the current form to evaluate (you can type :locals) |
---|
26 | |
---|
27 | ':b' will add a breakpoint to a symbol to use with next (n) (you can type :br+ or :add-breakpoint) |
---|
28 | |
---|
29 | ':r' will remove an existent symbol breakpoint to use with next (n) (you can type :br- or :remove-breakpoint) |
---|
30 | |
---|
31 | ':d' will remove all existent symbol breakpoints to use with next (n) (you can type :br! or :delete-breakpoints) |
---|
32 | |
---|
33 | ':w' (or :watch) allows to pin binding to see in all steps |
---|
34 | |
---|
35 | ':u' (or :unwatch) allows to remove the bindings established by :watch |
---|
36 | |
---|
37 | ':bt' (or :backtrace) shows the current backtrace |
---|
38 | |
---|
39 | ':q': The quit q feature will abort the evaluation in the stepper |
---|
40 | and return NIL. This is useful to avoid running the remaining (you can type :quit) |
---|
41 | forms in the code when the user wants to leave the |
---|
42 | stepper, specially if the rest of the program is doing costly |
---|
43 | operations. |
---|
44 | |
---|
45 | :'n' allows to jump the next (n) symbol: |
---|
46 | The next n feature allow to stop the stepper only when the |
---|
47 | interpreter is analyzing one of the symbols specified in the |
---|
48 | list of stepper::*stepper-stop-symbols* or any of the exported |
---|
49 | symbols presented in any of the list of packages specified in |
---|
50 | stepper::*stepper-stop-packages*. These variables will have |
---|
51 | initially the value NIL and if they are not modified, next will |
---|
52 | behave exactly as continue. It is useful when we want to |
---|
53 | step large or complex code and avoid stepping every form in |
---|
54 | order to jump only to the interested ones. |
---|
55 | |
---|
56 | Usage: |
---|
57 | |
---|
58 | Attaching a sample session to illustrate the use of the stepper |
---|
59 | |
---|
60 | ``` |
---|
61 | CL-USER(1): (require :asdf) |
---|
62 | NIL |
---|
63 | CL-USER(2): (require :abcl-contrib) |
---|
64 | NIL |
---|
65 | CL-USER(3): (require :abcl-stepper) |
---|
66 | NIL |
---|
67 | CL-USER(4): (defparameter *some-var* 1) |
---|
68 | *SOME-VAR* |
---|
69 | CL-USER(5): (defun test () |
---|
70 | (let ((*some-var* nil) |
---|
71 | (x 3)) |
---|
72 | (list *some-var* 3))) |
---|
73 | TEST |
---|
74 | CL-USER(6): (stepper:step (test)) |
---|
75 | We are in the stepper mode |
---|
76 | Evaluating step 1 --> |
---|
77 | (TEST) |
---|
78 | Type ':?' for a list of options |
---|
79 | :i |
---|
80 | Type the name of the symbol: *some-var* |
---|
81 | 1 |
---|
82 | Type ':?' for a list of options |
---|
83 | :s |
---|
84 | We are in the stepper mode |
---|
85 | Evaluating step 2 --> |
---|
86 | (BLOCK TEST |
---|
87 | (LET ((*SOME-VAR* NIL) (X 3)) |
---|
88 | (LIST *SOME-VAR* 3))) |
---|
89 | Type ':?' for a list of options |
---|
90 | :s |
---|
91 | We are in the stepper mode |
---|
92 | Evaluating step 3 --> |
---|
93 | (LET ((*SOME-VAR* NIL) (X 3)) |
---|
94 | (LIST *SOME-VAR* 3)) |
---|
95 | Type ':?' for a list of options |
---|
96 | :? |
---|
97 | Type ':l' to see the values of bindings on the local environment |
---|
98 | Type ':c' to resume the evaluation until the end without the stepper |
---|
99 | Type ':n' to resume the evaluation until the next form previously selected to step in |
---|
100 | Type ':s' to step into the form |
---|
101 | Type ':i' to inspect the current value of a variable or symbol |
---|
102 | Type ':b' to add a symbol as a breakpoint to use with next (n) |
---|
103 | Type ':r' to remove a symbol used as a breakpoint with next (n) |
---|
104 | Type ':d' to remove all breakpoints used with next (n) |
---|
105 | Type ':w' to print the value of a binding in all the steps (watch) |
---|
106 | Type ':u' to remove a watched binding (unwatch) |
---|
107 | Type ':bt' to show the backtrace |
---|
108 | Type ':q' to quit the evaluation and return NIL |
---|
109 | Type ':?' for a list of options |
---|
110 | :s |
---|
111 | We are in the stepper mode |
---|
112 | Evaluating step 4 --> |
---|
113 | (LIST *SOME-VAR* 3) |
---|
114 | Type ':?' for a list of options |
---|
115 | :l |
---|
116 | Showing the values of variable bindings. |
---|
117 | From inner to outer scopes: |
---|
118 | X=3 |
---|
119 | *SOME-VAR*=NIL |
---|
120 | Showing the values of function bindings. |
---|
121 | From inner to outer scopes: |
---|
122 | Type ':?' for a list of options |
---|
123 | :i |
---|
124 | Type the name of the symbol: x |
---|
125 | 3 |
---|
126 | Type ':?' for a list of options |
---|
127 | :i |
---|
128 | Type the name of the symbol: *some-var* |
---|
129 | NIL |
---|
130 | Type ':?' for a list of options |
---|
131 | :s |
---|
132 | step 4 ==> value: (NIL 3) |
---|
133 | step 3 ==> value: (NIL 3) |
---|
134 | step 2 ==> value: (NIL 3) |
---|
135 | step 1 ==> value: (NIL 3) |
---|
136 | (NIL 3) |
---|
137 | CL-USER(7): (stepper:step (flet ((flet1 (n) (+ n n))) |
---|
138 | (flet ((flet2 (n) (+ 2 (flet1 n)))) |
---|
139 | (flet2 2)))) |
---|
140 | We are in the stepper mode |
---|
141 | Evaluating step 1 --> |
---|
142 | (FLET ((FLET1 (N) (+ N N))) |
---|
143 | (FLET ((FLET2 (N) (+ 2 (FLET1 N)))) (FLET2 2))) |
---|
144 | Type ':?' for a list of options |
---|
145 | :s |
---|
146 | We are in the stepper mode |
---|
147 | Evaluating step 2 --> |
---|
148 | (FLET ((FLET2 (N) (+ 2 (FLET1 N)))) (FLET2 2)) |
---|
149 | Type ':?' for a list of options |
---|
150 | :s |
---|
151 | We are in the stepper mode |
---|
152 | Evaluating step 3 --> |
---|
153 | ((FLET FLET2) 2) |
---|
154 | Type ':?' for a list of options |
---|
155 | :l |
---|
156 | Showing the values of variable bindings. |
---|
157 | From inner to outer scopes: |
---|
158 | Showing the values of function bindings. |
---|
159 | From inner to outer scopes: |
---|
160 | FLET2=#<FUNCTION #<(FLET FLET2) {152C83E7}> {152C83E7}> |
---|
161 | FLET1=#<FUNCTION #<(FLET FLET1) {7AA67C0B}> {7AA67C0B}> |
---|
162 | Type ':?' for a list of options |
---|
163 | :s |
---|
164 | We are in the stepper mode |
---|
165 | Evaluating step 4 --> |
---|
166 | (BLOCK FLET2 (+ 2 (FLET1 N))) |
---|
167 | Type ':?' for a list of options |
---|
168 | :l |
---|
169 | Showing the values of variable bindings. |
---|
170 | From inner to outer scopes: |
---|
171 | N=2 |
---|
172 | Showing the values of function bindings. |
---|
173 | From inner to outer scopes: |
---|
174 | FLET1=#<FUNCTION #<(FLET FLET1) {7AA67C0B}> {7AA67C0B}> |
---|
175 | Type ':?' for a list of options |
---|
176 | :s |
---|
177 | We are in the stepper mode |
---|
178 | Evaluating step 5 --> |
---|
179 | (+ 2 (FLET1 N)) |
---|
180 | Type ':?' for a list of options |
---|
181 | :s |
---|
182 | We are in the stepper mode |
---|
183 | Evaluating step 6 --> |
---|
184 | ((FLET FLET1) N) |
---|
185 | Type ':?' for a list of options |
---|
186 | :s |
---|
187 | We are in the stepper mode |
---|
188 | Evaluating step 7 --> |
---|
189 | (BLOCK FLET1 (+ N N)) |
---|
190 | Type ':?' for a list of options |
---|
191 | :c |
---|
192 | step 7 ==> value: 4 |
---|
193 | step 6 ==> value: 4 |
---|
194 | step 5 ==> value: 6 |
---|
195 | step 4 ==> value: 6 |
---|
196 | step 3 ==> value: 6 |
---|
197 | step 2 ==> value: 6 |
---|
198 | step 1 ==> value: 6 |
---|
199 | 6 |
---|
200 | CL-USER(8): (stepper:step (progn |
---|
201 | ((lambda (c d) (list c d)) 3 7))) |
---|
202 | We are in the stepper mode |
---|
203 | Evaluating step 1 --> |
---|
204 | (PROGN ((LAMBDA (C D) (LIST C D)) 3 7)) |
---|
205 | Type ':?' for a list of options |
---|
206 | :s |
---|
207 | We are in the stepper mode |
---|
208 | Evaluating step 2 --> |
---|
209 | (#<FUNCTION #<FUNCTION (LAMBDA (C D)) {22A1D243}> {22A1D243}> 3 7) |
---|
210 | Type ':?' for a list of options |
---|
211 | :s |
---|
212 | We are in the stepper mode |
---|
213 | Evaluating step 3 --> |
---|
214 | (LIST C D) |
---|
215 | Type ':?' for a list of options |
---|
216 | :i |
---|
217 | Type the name of the symbol: c |
---|
218 | 3 |
---|
219 | Type ':?' for a list of options |
---|
220 | :i |
---|
221 | Type the name of the symbol: d |
---|
222 | 7 |
---|
223 | Type ':?' for a list of options |
---|
224 | :l |
---|
225 | Showing the values of variable bindings. |
---|
226 | From inner to outer scopes: |
---|
227 | D=7 |
---|
228 | C=3 |
---|
229 | Showing the values of function bindings. |
---|
230 | From inner to outer scopes: |
---|
231 | Type ':?' for a list of options |
---|
232 | :s |
---|
233 | step 3 ==> value: (3 7) |
---|
234 | step 2 ==> value: (3 7) |
---|
235 | step 1 ==> value: (3 7) |
---|
236 | (3 7) |
---|
237 | CL-USER(9): (stepper:step (let ((a 1)) ;; for skip(q) feature, it should return NIl anyhow |
---|
238 | (block whatever (list 1 2)) |
---|
239 | a)) |
---|
240 | We are in the stepper mode |
---|
241 | Evaluating step 1 --> |
---|
242 | (LET ((A 1)) |
---|
243 | (BLOCK WHATEVER (LIST 1 2)) |
---|
244 | A) |
---|
245 | Type ':?' for a list of options |
---|
246 | :s |
---|
247 | We are in the stepper mode |
---|
248 | Evaluating step 2 --> |
---|
249 | (BLOCK WHATEVER (LIST 1 2)) |
---|
250 | Type ':?' for a list of options |
---|
251 | :l |
---|
252 | Showing the values of variable bindings. |
---|
253 | From inner to outer scopes: |
---|
254 | A=1 |
---|
255 | Showing the values of function bindings. |
---|
256 | From inner to outer scopes: |
---|
257 | Type ':?' for a list of options |
---|
258 | :s |
---|
259 | We are in the stepper mode |
---|
260 | Evaluating step 3 --> |
---|
261 | (LIST 1 2) |
---|
262 | Type ':?' for a list of options |
---|
263 | :q |
---|
264 | NIL |
---|
265 | CL-USER(10): (stepper:step (let ((a 1)) ;; for skip(q) feature, it should return NIl anyhow |
---|
266 | (block whatever (list 1 2)) |
---|
267 | a)) |
---|
268 | We are in the stepper mode |
---|
269 | Evaluating step 1 --> |
---|
270 | (LET ((A 1)) |
---|
271 | (BLOCK WHATEVER (LIST 1 2)) |
---|
272 | A) |
---|
273 | Type ':?' for a list of options |
---|
274 | :c |
---|
275 | step 1 ==> value: 1 |
---|
276 | 1 |
---|
277 | CL-USER(11): (stepper:step (let ((a 1)) |
---|
278 | (let ((a 2) (b 1)) |
---|
279 | (- a b)) ;; <-- list locals |
---|
280 | (+ a 3 7))) |
---|
281 | We are in the stepper mode |
---|
282 | Evaluating step 1 --> |
---|
283 | (LET ((A 1)) |
---|
284 | (LET ((A 2) (B 1)) |
---|
285 | (- A B)) |
---|
286 | (+ A 3 7)) |
---|
287 | Type ':?' for a list of options |
---|
288 | :s |
---|
289 | We are in the stepper mode |
---|
290 | Evaluating step 2 --> |
---|
291 | (LET ((A 2) (B 1)) |
---|
292 | (- A B)) |
---|
293 | Type ':?' for a list of options |
---|
294 | :s |
---|
295 | We are in the stepper mode |
---|
296 | Evaluating step 3 --> |
---|
297 | (- A B) |
---|
298 | Type ':?' for a list of options |
---|
299 | :l |
---|
300 | Showing the values of variable bindings. |
---|
301 | From inner to outer scopes: |
---|
302 | B=1 |
---|
303 | A=2 |
---|
304 | A=1 |
---|
305 | Showing the values of function bindings. |
---|
306 | From inner to outer scopes: |
---|
307 | Type ':?' for a list of options |
---|
308 | :s |
---|
309 | step 3 ==> value: 1 |
---|
310 | step 2 ==> value: 1 |
---|
311 | We are in the stepper mode |
---|
312 | Evaluating step 4 --> |
---|
313 | (+ A 3 7) |
---|
314 | Type ':?' for a list of options |
---|
315 | :l |
---|
316 | Showing the values of variable bindings. |
---|
317 | From inner to outer scopes: |
---|
318 | A=1 |
---|
319 | Showing the values of function bindings. |
---|
320 | From inner to outer scopes: |
---|
321 | Type ':?' for a list of options |
---|
322 | :s |
---|
323 | step 4 ==> value: 11 |
---|
324 | step 1 ==> value: 11 |
---|
325 | 11 |
---|
326 | CL-USER(12): (stepper:step (progn (defparameter *azf* 1))) |
---|
327 | We are in the stepper mode |
---|
328 | Evaluating step 1 --> |
---|
329 | (PROGN (DEFPARAMETER *AZF* 1)) |
---|
330 | Type ':?' for a list of options |
---|
331 | :c |
---|
332 | step 1 ==> value: *AZF* |
---|
333 | *AZF* |
---|
334 | CL-USER(13): (assert (= *azf* 1)) |
---|
335 | NIL |
---|
336 | CL-USER(14): (defpackage step-next (:use :cl)) |
---|
337 | #<PACKAGE STEP-NEXT> |
---|
338 | CL-USER(15): (in-package :step-next) |
---|
339 | #<PACKAGE STEP-NEXT> |
---|
340 | STEP-NEXT(16): (defun loop-1 (a b) |
---|
341 | (loop :for i :below a |
---|
342 | :collect (list a b))) |
---|
343 | LOOP-1 |
---|
344 | STEP-NEXT(17): (defun loop-2 (a) |
---|
345 | (loop :for i :below a |
---|
346 | :collect i)) |
---|
347 | LOOP-2 |
---|
348 | STEP-NEXT(18): (defun loop-3 (n &optional (times 1)) |
---|
349 | (loop :for i :below times |
---|
350 | :collect times)) |
---|
351 | LOOP-3 |
---|
352 | STEP-NEXT(19): (defun test-next (n) |
---|
353 | (loop-1 (1+ n) n) |
---|
354 | (loop-2 (1- n)) |
---|
355 | (loop-3 n 3) |
---|
356 | ;; quit (q) here |
---|
357 | (defparameter *test-next-var* |
---|
358 | (loop :for i :below (expt 10 6) |
---|
359 | :collect i))) |
---|
360 | TEST-NEXT |
---|
361 | STEP-NEXT(20): (push 'loop-1 stepper::*stepper-stop-symbols*) |
---|
362 | (LOOP-1) |
---|
363 | STEP-NEXT(21): (export 'loop-3) |
---|
364 | T |
---|
365 | STEP-NEXT(22): (push 'step-next stepper::*stepper-stop-packages*) |
---|
366 | (STEP-NEXT) |
---|
367 | STEP-NEXT(23): (stepper:step (test-next 7)) |
---|
368 | We are in the stepper mode |
---|
369 | Evaluating step 1 --> |
---|
370 | (TEST-NEXT 7) |
---|
371 | Type ':?' for a list of options |
---|
372 | :n |
---|
373 | We are in the stepper mode |
---|
374 | Evaluating step 2 --> |
---|
375 | (LOOP-1 (1+ N) N) |
---|
376 | Type ':?' for a list of options |
---|
377 | :n |
---|
378 | step 2 ==> value: ((8 7) (8 7) (8 7) (8 7) (8 7) (8 7) (8 7) (8 7)) |
---|
379 | We are in the stepper mode |
---|
380 | Evaluating step 3 --> |
---|
381 | (LOOP-3 N 3) |
---|
382 | Type ':?' for a list of options |
---|
383 | :q |
---|
384 | NIL |
---|
385 | STEP-NEXT(24): (assert (not (boundp '*test-next-var*))) |
---|
386 | NIL |
---|
387 | STEP-NEXT(25): (stepper:step (test-next 7)) |
---|
388 | We are in the stepper mode |
---|
389 | Evaluating step 1 --> |
---|
390 | (TEST-NEXT 7) |
---|
391 | Type ':?' for a list of options |
---|
392 | :r |
---|
393 | Type the name of the breakpoint symbol to remove: loop-1 |
---|
394 | Type ':?' for a list of options |
---|
395 | :b |
---|
396 | Type the name of the symbol to use as a breakpoint with next (n): loop-2 |
---|
397 | Type ':?' for a list of options |
---|
398 | :n |
---|
399 | We are in the stepper mode |
---|
400 | Evaluating step 2 --> |
---|
401 | (LOOP-2 (1- N)) |
---|
402 | Type ':?' for a list of options |
---|
403 | :n |
---|
404 | step 2 ==> value: (0 1 2 3 4 5) |
---|
405 | We are in the stepper mode |
---|
406 | Evaluating step 3 --> |
---|
407 | (LOOP-3 N 3) |
---|
408 | Type ':?' for a list of options |
---|
409 | :c |
---|
410 | step 3 ==> value: (3 3 3) |
---|
411 | step 1 ==> value: *TEST-NEXT-VAR* |
---|
412 | *TEST-NEXT-VAR* |
---|
413 | STEP-NEXT(26): (defun test-watch () |
---|
414 | (let ((x 1)) |
---|
415 | (dotimes (i 7) |
---|
416 | (incf x)) |
---|
417 | x)) |
---|
418 | TEST-WATCH |
---|
419 | STEP-NEXT(27): (stepper:step (test-watch)) |
---|
420 | We are in the stepper mode |
---|
421 | Evaluating step 1 --> |
---|
422 | (TEST-WATCH) |
---|
423 | Type ':?' for a list of options |
---|
424 | :w |
---|
425 | Type the name of the symbol to watch: x |
---|
426 | Type ':?' for a list of options |
---|
427 | Watched bindings: |
---|
428 | Couldn't find a value for symbol X |
---|
429 | :s |
---|
430 | We are in the stepper mode |
---|
431 | Evaluating step 2 --> |
---|
432 | (BLOCK TEST-WATCH |
---|
433 | (LET ((X 1)) |
---|
434 | (DOTIMES (I 7) (SETQ X (+ X 1))) |
---|
435 | X)) |
---|
436 | Type ':?' for a list of options |
---|
437 | Watched bindings: |
---|
438 | Couldn't find a value for symbol X |
---|
439 | :s |
---|
440 | We are in the stepper mode |
---|
441 | Evaluating step 3 --> |
---|
442 | (LET ((X 1)) |
---|
443 | (DOTIMES (I 7) (SETQ X (+ X 1))) |
---|
444 | X) |
---|
445 | Type ':?' for a list of options |
---|
446 | Watched bindings: |
---|
447 | Couldn't find a value for symbol X |
---|
448 | :s |
---|
449 | We are in the stepper mode |
---|
450 | Evaluating step 4 --> |
---|
451 | (DOTIMES (I 7) (SETQ X (+ X 1))) |
---|
452 | Type ':?' for a list of options |
---|
453 | Watched bindings: |
---|
454 | X=1 |
---|
455 | :s |
---|
456 | We are in the stepper mode |
---|
457 | Evaluating step 5 --> |
---|
458 | (SETQ X (+ X 1)) |
---|
459 | Type ':?' for a list of options |
---|
460 | Watched bindings: |
---|
461 | X=1 |
---|
462 | :s |
---|
463 | We are in the stepper mode |
---|
464 | Evaluating step 6 --> |
---|
465 | (+ X 1) |
---|
466 | Type ':?' for a list of options |
---|
467 | Watched bindings: |
---|
468 | X=1 |
---|
469 | :s |
---|
470 | step 6 ==> value: 2 |
---|
471 | step 5 ==> value: 2 |
---|
472 | We are in the stepper mode |
---|
473 | Evaluating step 7 --> |
---|
474 | (SETQ X (+ X 1)) |
---|
475 | Type ':?' for a list of options |
---|
476 | Watched bindings: |
---|
477 | X=2 |
---|
478 | :s |
---|
479 | We are in the stepper mode |
---|
480 | Evaluating step 8 --> |
---|
481 | (+ X 1) |
---|
482 | Type ':?' for a list of options |
---|
483 | Watched bindings: |
---|
484 | X=2 |
---|
485 | :s |
---|
486 | step 8 ==> value: 3 |
---|
487 | step 7 ==> value: 3 |
---|
488 | We are in the stepper mode |
---|
489 | Evaluating step 9 --> |
---|
490 | (SETQ X (+ X 1)) |
---|
491 | Type ':?' for a list of options |
---|
492 | Watched bindings: |
---|
493 | X=3 |
---|
494 | :s |
---|
495 | We are in the stepper mode |
---|
496 | Evaluating step 10 --> |
---|
497 | (+ X 1) |
---|
498 | Type ':?' for a list of options |
---|
499 | Watched bindings: |
---|
500 | X=3 |
---|
501 | :s |
---|
502 | step 10 ==> value: 4 |
---|
503 | step 9 ==> value: 4 |
---|
504 | We are in the stepper mode |
---|
505 | Evaluating step 11 --> |
---|
506 | (SETQ X (+ X 1)) |
---|
507 | Type ':?' for a list of options |
---|
508 | Watched bindings: |
---|
509 | X=4 |
---|
510 | :s |
---|
511 | We are in the stepper mode |
---|
512 | Evaluating step 12 --> |
---|
513 | (+ X 1) |
---|
514 | Type ':?' for a list of options |
---|
515 | Watched bindings: |
---|
516 | X=4 |
---|
517 | :s |
---|
518 | step 12 ==> value: 5 |
---|
519 | step 11 ==> value: 5 |
---|
520 | We are in the stepper mode |
---|
521 | Evaluating step 13 --> |
---|
522 | (SETQ X (+ X 1)) |
---|
523 | Type ':?' for a list of options |
---|
524 | Watched bindings: |
---|
525 | X=5 |
---|
526 | :u |
---|
527 | Type the name of the symbol to (un)watch : x |
---|
528 | Type ':?' for a list of options |
---|
529 | :s |
---|
530 | We are in the stepper mode |
---|
531 | Evaluating step 14 --> |
---|
532 | (+ X 1) |
---|
533 | Type ':?' for a list of options |
---|
534 | :s |
---|
535 | step 14 ==> value: 6 |
---|
536 | step 13 ==> value: 6 |
---|
537 | We are in the stepper mode |
---|
538 | Evaluating step 15 --> |
---|
539 | (SETQ X (+ X 1)) |
---|
540 | Type ':?' for a list of options |
---|
541 | :s |
---|
542 | We are in the stepper mode |
---|
543 | Evaluating step 16 --> |
---|
544 | (+ X 1) |
---|
545 | Type ':?' for a list of options |
---|
546 | :s |
---|
547 | step 16 ==> value: 7 |
---|
548 | step 15 ==> value: 7 |
---|
549 | We are in the stepper mode |
---|
550 | Evaluating step 17 --> |
---|
551 | (SETQ X (+ X 1)) |
---|
552 | Type ':?' for a list of options |
---|
553 | :s |
---|
554 | We are in the stepper mode |
---|
555 | Evaluating step 18 --> |
---|
556 | (+ X 1) |
---|
557 | Type ':?' for a list of options |
---|
558 | :s |
---|
559 | step 18 ==> value: 8 |
---|
560 | step 17 ==> value: 8 |
---|
561 | step 4 ==> value: NIL |
---|
562 | step 3 ==> value: 8 |
---|
563 | step 2 ==> value: 8 |
---|
564 | step 1 ==> value: 8 |
---|
565 | 8 |
---|
566 | STEP-NEXT(28): (defun test-backtrace (x) |
---|
567 | (labels ((f1 (x) (f2 (1+ x))) |
---|
568 | (f2 (x) (f3 (* x 3))) |
---|
569 | (f3 (x) (+ x 10))) |
---|
570 | (f1 x))) |
---|
571 | TEST-BACKTRACE |
---|
572 | STEP-NEXT(29): (stepper:step (test-backtrace 3)) |
---|
573 | We are in the stepper mode |
---|
574 | Evaluating step 1 --> |
---|
575 | (TEST-BACKTRACE 3) |
---|
576 | Type ':?' for a list of options |
---|
577 | :s |
---|
578 | We are in the stepper mode |
---|
579 | Evaluating step 2 --> |
---|
580 | (BLOCK TEST-BACKTRACE |
---|
581 | (LABELS ((F1 (X) (F2 (1+ X))) |
---|
582 | (F2 (X) (F3 (* X 3))) |
---|
583 | (F3 (X) (+ X 10))) |
---|
584 | (F1 X))) |
---|
585 | Type ':?' for a list of options |
---|
586 | :s |
---|
587 | We are in the stepper mode |
---|
588 | Evaluating step 3 --> |
---|
589 | (LABELS ((F1 (X) (F2 (1+ X))) |
---|
590 | (F2 (X) (F3 (* X 3))) |
---|
591 | (F3 (X) (+ X 10))) |
---|
592 | (F1 X)) |
---|
593 | Type ':?' for a list of options |
---|
594 | :s |
---|
595 | We are in the stepper mode |
---|
596 | Evaluating step 4 --> |
---|
597 | ((LABELS F1) X) |
---|
598 | Type ':?' for a list of options |
---|
599 | :s |
---|
600 | We are in the stepper mode |
---|
601 | Evaluating step 5 --> |
---|
602 | (BLOCK F1 (F2 (1+ X))) |
---|
603 | Type ':?' for a list of options |
---|
604 | :s |
---|
605 | We are in the stepper mode |
---|
606 | Evaluating step 6 --> |
---|
607 | ((LABELS F2) (1+ X)) |
---|
608 | Type ':?' for a list of options |
---|
609 | :s |
---|
610 | We are in the stepper mode |
---|
611 | Evaluating step 7 --> |
---|
612 | (1+ X) |
---|
613 | Type ':?' for a list of options |
---|
614 | :s |
---|
615 | step 7 ==> value: 4 |
---|
616 | We are in the stepper mode |
---|
617 | Evaluating step 8 --> |
---|
618 | (BLOCK F2 (F3 (* X 3))) |
---|
619 | Type ':?' for a list of options |
---|
620 | :s |
---|
621 | We are in the stepper mode |
---|
622 | Evaluating step 9 --> |
---|
623 | ((LABELS F3) (* X 3)) |
---|
624 | Type ':?' for a list of options |
---|
625 | :s |
---|
626 | We are in the stepper mode |
---|
627 | Evaluating step 10 --> |
---|
628 | (* X 3) |
---|
629 | Type ':?' for a list of options |
---|
630 | :s |
---|
631 | step 10 ==> value: 12 |
---|
632 | We are in the stepper mode |
---|
633 | Evaluating step 11 --> |
---|
634 | (BLOCK F3 (+ X 10)) |
---|
635 | Type ':?' for a list of options |
---|
636 | :s |
---|
637 | We are in the stepper mode |
---|
638 | Evaluating step 12 --> |
---|
639 | (+ X 10) |
---|
640 | Type ':?' for a list of options |
---|
641 | :bt |
---|
642 | |
---|
643 | (#<LISP-STACK-FRAME ((LABELS F3) 12) {3839E350}> |
---|
644 | #<LISP-STACK-FRAME ((LABELS F2) 4) {42EF4336}> |
---|
645 | #<LISP-STACK-FRAME ((LABELS F1) 3) {71E556E2}> |
---|
646 | #<LISP-STACK-FRAME (TEST-BACKTRACE 3) {2D1E31F3}> |
---|
647 | #<LISP-STACK-FRAME (SYSTEM::%EVAL (ABCL-STEPPER:STEP (TEST-BACKTRACE 3))) {5ACA7463}> |
---|
648 | #<LISP-STACK-FRAME (EVAL (ABCL-STEPPER:STEP (TEST-BACKTRACE 3))) {62846AFF}> |
---|
649 | #<LISP-STACK-FRAME (SYSTEM:INTERACTIVE-EVAL (ABCL-STEPPER:STEP (TEST-BACKTRACE 3))) {390D720B}> |
---|
650 | #<LISP-STACK-FRAME (TOP-LEVEL::REPL) {65405D70}> |
---|
651 | #<LISP-STACK-FRAME (TOP-LEVEL::TOP-LEVEL-LOOP) {6CA054D7}>) |
---|
652 | Type ':?' for a list of options |
---|
653 | :c |
---|
654 | step 12 ==> value: 22 |
---|
655 | step 11 ==> value: 22 |
---|
656 | step 9 ==> value: 22 |
---|
657 | step 8 ==> value: 22 |
---|
658 | step 6 ==> value: 22 |
---|
659 | step 5 ==> value: 22 |
---|
660 | step 4 ==> value: 22 |
---|
661 | step 3 ==> value: 22 |
---|
662 | step 2 ==> value: 22 |
---|
663 | step 1 ==> value: 22 |
---|
664 | 22 |
---|
665 | STEP-NEXT(30): (stepper:step (values (list (cons 1 3) (cons 1 7)) |
---|
666 | (list (cons 2 4) (cons 2 8)))) |
---|
667 | We are in the stepper mode |
---|
668 | Evaluating step 1 --> |
---|
669 | (VALUES (LIST (CONS 1 3) (CONS 1 7)) (LIST (CONS 2 4) (CONS 2 8))) |
---|
670 | Type ':?' for a list of options |
---|
671 | :s |
---|
672 | We are in the stepper mode |
---|
673 | Evaluating step 2 --> |
---|
674 | (LIST (CONS 1 3) (CONS 1 7)) |
---|
675 | Type ':?' for a list of options |
---|
676 | :s |
---|
677 | We are in the stepper mode |
---|
678 | Evaluating step 3 --> |
---|
679 | (CONS 1 3) |
---|
680 | Type ':?' for a list of options |
---|
681 | :s |
---|
682 | step 3 ==> value: (1 . 3) |
---|
683 | We are in the stepper mode |
---|
684 | Evaluating step 4 --> |
---|
685 | (CONS 1 7) |
---|
686 | Type ':?' for a list of options |
---|
687 | :s |
---|
688 | step 4 ==> value: (1 . 7) |
---|
689 | step 2 ==> value: ((1 . 3) (1 . 7)) |
---|
690 | We are in the stepper mode |
---|
691 | Evaluating step 5 --> |
---|
692 | (LIST (CONS 2 4) (CONS 2 8)) |
---|
693 | Type ':?' for a list of options |
---|
694 | :sn |
---|
695 | step 5 ==> value: ((2 . 4) (2 . 8)) |
---|
696 | step 1 ==> value: ((1 . 3) (1 . 7)) |
---|
697 | step 1 ==> value: ((2 . 4) (2 . 8)) |
---|
698 | ((1 . 3) (1 . 7)) |
---|
699 | ((2 . 4) (2 . 8)) |
---|
700 | STEP-NEXT(31): |
---|
701 | ``` |
---|
702 | |
---|
703 | For steps with ASDF systems we can use asdf:load-source-op |
---|
704 | |
---|
705 | ``` |
---|
706 | CL-USER(1): (require :asdf) |
---|
707 | NIL |
---|
708 | CL-USER(2): (require :abcl-contrib) |
---|
709 | NIL |
---|
710 | CL-USER(3): (require :abcl-stepper) |
---|
711 | NIL |
---|
712 | CL-USER(4): (asdf:load-system :quicklisp-abcl) |
---|
713 | T |
---|
714 | CL-USER(5): (ql:quickload :alexandria) |
---|
715 | To load "alexandria": |
---|
716 | Load 1 ASDF system: |
---|
717 | alexandria |
---|
718 | ; Loading "alexandria" |
---|
719 | |
---|
720 | (:ALEXANDRIA) |
---|
721 | CL-USER(6): (asdf:operate 'asdf:load-source-op :alexandria) |
---|
722 | #<ASDF/LISP-ACTION:LOAD-SOURCE-OP > |
---|
723 | #<ASDF/PLAN:SEQUENTIAL-PLAN {34FAF8EA}> |
---|
724 | CL-USER(7): (stepper:step (alexandria:plist-hash-table '(:a 1 :b 2 :c 3))) |
---|
725 | We are in the stepper mode |
---|
726 | Evaluating step 1 --> |
---|
727 | (ALEXANDRIA:PLIST-HASH-TABLE '(:A 1 :B 2 :C 3)) |
---|
728 | Type ':?' for a list of options |
---|
729 | :s |
---|
730 | We are in the stepper mode |
---|
731 | Evaluating step 2 --> |
---|
732 | '(:A 1 :B 2 :C 3) |
---|
733 | Type ':?' for a list of options |
---|
734 | :s |
---|
735 | step 2 ==> value: (:A 1 :B 2 :C 3) |
---|
736 | We are in the stepper mode |
---|
737 | Evaluating step 3 --> |
---|
738 | (BLOCK ALEXANDRIA:PLIST-HASH-TABLE |
---|
739 | (LET ((ALEXANDRIA::TABLE |
---|
740 | (APPLY #'MAKE-HASH-TABLE ALEXANDRIA::HASH-TABLE-INITARGS))) |
---|
741 | (DO ((ALEXANDRIA::TAIL ALEXANDRIA::PLIST |
---|
742 | (CDDR ALEXANDRIA::TAIL))) |
---|
743 | ((NOT ALEXANDRIA::TAIL)) |
---|
744 | (LET ((#:KEY29386 (CAR ALEXANDRIA::TAIL)) |
---|
745 | (#:HASH-TABLE29387 ALEXANDRIA::TABLE)) |
---|
746 | (MULTIPLE-VALUE-BIND (#:VALUE29388 #:PRESENTP29389) |
---|
747 | (GETHASH #:KEY29386 #:HASH-TABLE29387) |
---|
748 | (IF #:PRESENTP29389 |
---|
749 | (VALUES #:VALUE29388 #:PRESENTP29389) |
---|
750 | (VALUES (SYSTEM:PUTHASH #:KEY29386 |
---|
751 | #:HASH-TABLE29387 |
---|
752 | (CADR ALEXANDRIA::TAIL)) |
---|
753 | NIL))))) |
---|
754 | ALEXANDRIA::TABLE)) |
---|
755 | Type ':?' for a list of options |
---|
756 | :s |
---|
757 | We are in the stepper mode |
---|
758 | Evaluating step 4 --> |
---|
759 | (LET ((ALEXANDRIA::TABLE |
---|
760 | (APPLY #'MAKE-HASH-TABLE ALEXANDRIA::HASH-TABLE-INITARGS))) |
---|
761 | (DO ((ALEXANDRIA::TAIL ALEXANDRIA::PLIST (CDDR ALEXANDRIA::TAIL))) |
---|
762 | ((NOT ALEXANDRIA::TAIL)) |
---|
763 | (LET ((#:KEY29386 (CAR ALEXANDRIA::TAIL)) |
---|
764 | (#:HASH-TABLE29387 ALEXANDRIA::TABLE)) |
---|
765 | (MULTIPLE-VALUE-BIND (#:VALUE29388 #:PRESENTP29389) |
---|
766 | (GETHASH #:KEY29386 #:HASH-TABLE29387) |
---|
767 | (IF #:PRESENTP29389 |
---|
768 | (VALUES #:VALUE29388 #:PRESENTP29389) |
---|
769 | (VALUES (SYSTEM:PUTHASH #:KEY29386 |
---|
770 | #:HASH-TABLE29387 |
---|
771 | (CADR ALEXANDRIA::TAIL)) |
---|
772 | NIL))))) |
---|
773 | ALEXANDRIA::TABLE) |
---|
774 | Type ':?' for a list of options |
---|
775 | :s |
---|
776 | We are in the stepper mode |
---|
777 | Evaluating step 5 --> |
---|
778 | (APPLY #'MAKE-HASH-TABLE ALEXANDRIA::HASH-TABLE-INITARGS) |
---|
779 | Type ':?' for a list of options |
---|
780 | :l |
---|
781 | Showing the values of variable bindings. |
---|
782 | From inner to outer scopes: |
---|
783 | HASH-TABLE-INITARGS=NIL |
---|
784 | PLIST=(A 1 B 2 C 3) |
---|
785 | HASH-TABLE-INITARGS=NIL |
---|
786 | PLIST=(A 1 B 2 C 3) |
---|
787 | Showing the values of function bindings. |
---|
788 | From inner to outer scopes: |
---|
789 | Type ':?' for a list of options |
---|
790 | :s |
---|
791 | We are in the stepper mode |
---|
792 | Evaluating step 6 --> |
---|
793 | #'MAKE-HASH-TABLE |
---|
794 | Type ':?' for a list of options |
---|
795 | :s |
---|
796 | step 6 ==> value: #<MAKE-HASH-TABLE {646E548B}> |
---|
797 | step 5 ==> value: #<EQL HASH-TABLE 0 entries, 11 buckets {733688E9}> |
---|
798 | We are in the stepper mode |
---|
799 | Evaluating step 7 --> |
---|
800 | (DO ((ALEXANDRIA::TAIL ALEXANDRIA::PLIST (CDDR ALEXANDRIA::TAIL))) |
---|
801 | ((NOT ALEXANDRIA::TAIL)) |
---|
802 | (LET ((#:KEY29386 (CAR ALEXANDRIA::TAIL)) |
---|
803 | (#:HASH-TABLE29387 ALEXANDRIA::TABLE)) |
---|
804 | (MULTIPLE-VALUE-BIND (#:VALUE29388 #:PRESENTP29389) |
---|
805 | (GETHASH #:KEY29386 #:HASH-TABLE29387) |
---|
806 | (IF #:PRESENTP29389 |
---|
807 | (VALUES #:VALUE29388 #:PRESENTP29389) |
---|
808 | (VALUES (SYSTEM:PUTHASH #:KEY29386 |
---|
809 | #:HASH-TABLE29387 |
---|
810 | (CADR ALEXANDRIA::TAIL)) |
---|
811 | NIL))))) |
---|
812 | Type ':?' for a list of options |
---|
813 | :s |
---|
814 | We are in the stepper mode |
---|
815 | Evaluating step 8 --> |
---|
816 | (NOT ALEXANDRIA::TAIL) |
---|
817 | Type ':?' for a list of options |
---|
818 | :s |
---|
819 | step 8 ==> value: NIL |
---|
820 | We are in the stepper mode |
---|
821 | Evaluating step 9 --> |
---|
822 | (LET ((#:KEY29386 (CAR ALEXANDRIA::TAIL)) |
---|
823 | (#:HASH-TABLE29387 ALEXANDRIA::TABLE)) |
---|
824 | (MULTIPLE-VALUE-BIND (#:VALUE29388 #:PRESENTP29389) |
---|
825 | (GETHASH #:KEY29386 #:HASH-TABLE29387) |
---|
826 | (IF #:PRESENTP29389 |
---|
827 | (VALUES #:VALUE29388 #:PRESENTP29389) |
---|
828 | (VALUES (SYSTEM:PUTHASH #:KEY29386 |
---|
829 | #:HASH-TABLE29387 |
---|
830 | (CADR ALEXANDRIA::TAIL)) |
---|
831 | NIL)))) |
---|
832 | Type ':?' for a list of options |
---|
833 | :s |
---|
834 | We are in the stepper mode |
---|
835 | Evaluating step 10 --> |
---|
836 | (CAR ALEXANDRIA::TAIL) |
---|
837 | Type ':?' for a list of options |
---|
838 | :c |
---|
839 | step 10 ==> value: :A |
---|
840 | step 9 ==> value: 1 |
---|
841 | step 7 ==> value: NIL |
---|
842 | step 4 ==> value: #<EQL HASH-TABLE 3 entries, 11 buckets {733688E9}> |
---|
843 | step 3 ==> value: #<EQL HASH-TABLE 3 entries, 11 buckets {733688E9}> |
---|
844 | step 1 ==> value: #<EQL HASH-TABLE 3 entries, 11 buckets {733688E9}> |
---|
845 | #<EQL HASH-TABLE 3 entries, 11 buckets {733688E9}> |
---|
846 | CL-USER(8): |
---|
847 | ``` |
---|