Skip to content

Commit 0b7ff43

Browse files
committed
Add clasp stepping
1 parent abe87bc commit 0b7ff43

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/cl-jupyter/kernel.lisp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@
152152
debugger-hook
153153
invoke-debugger
154154
break
155+
#+clasp core:breakstep
155156
#+sbcl sb-debug::run-hook
156157
#+sbcl sb-int::%break)
157158
:test #'equal)))
@@ -366,6 +367,7 @@
366367
(jupyter:debug-stop
367368
(typecase condition
368369
#+sbcl (sb-impl::step-form-condition "step")
370+
#+clasp (clasp-debug:step-form "step")
369371
(otherwise "exception"))
370372
environment)
371373
(abort)))
@@ -414,23 +416,26 @@
414416
:interactive-function #'read-evaluated-form
415417
:report-function (lambda (stream)
416418
(write-string "Evaluate form in selected frame." stream)))
417-
#+sbcl
419+
#+(or clasp sbcl)
418420
(step
419421
(lambda ()
420-
(sb-impl::enable-stepping)
422+
#+clasp (core:set-breakstep)
423+
#+sbcl (sb-impl::enable-stepping)
421424
(continue))
422425
:report-function (lambda (stream)
423426
(write-string "Enable stepping and continue." stream))
424427
:test-function (lambda (condition)
425428
(and *lisp-debugger*
426-
(not (sb-impl::stepping-enabled-p))
429+
(not #+clasp (core:breakstepping-p)
430+
#+sbcl (sb-impl::stepping-enabled-p))
427431
(find-restart 'continue condition))))
428432
(abort (lambda ()
429433
(return (values "ABORT" "Cell execution halted." nil)))
430434
:report-function (lambda (stream)
431435
(write-string +abort-report+ stream))))
432436
,@body
433437
(values)))
438+
#+clasp (core:unset-breakstep)
434439
#+sbcl (sb-impl::disable-stepping)))
435440

436441

@@ -449,6 +454,7 @@
449454

450455
(defmethod jupyter:debug-in ((k kernel) environment)
451456
(invoke-first-restart environment
457+
#+clasp 'clasp-debug:step-into
452458
#+sbcl 'sb-impl::step-into
453459
'continue))
454460

@@ -461,6 +467,7 @@
461467

462468
(defmethod jupyter:debug-next ((k kernel) environment)
463469
(invoke-first-restart environment
470+
#+clasp 'clasp-debug:step-over
464471
#+sbcl 'sb-impl::step-next
465472
'continue))
466473

0 commit comments

Comments
 (0)