atlas-engineer / ndebug Goto Github PK
View Code? Open in Web Editor NEWA Common Lisp toolkit to construct interface-aware yet standard-compliant debugger hooks.
License: BSD 3-Clause "New" or "Revised" License
A Common Lisp toolkit to construct interface-aware yet standard-compliant debugger hooks.
License: BSD 3-Clause "New" or "Revised" License
Seems quite easy, really, although it may not work with ABCL:
(defclass slime-input-stream (fundamental-character-input-stream)
((input-fn :initarg :input-fn)
(buffer :initform "") (index :initform 0)
(lock :initform (make-lock :name "buffer read lock"))))
(defun make-output-stream (write-string)
(make-instance 'slime-output-stream :output-fn write-string))
(defun make-input-stream (read-string)
(make-instance 'slime-input-stream :input-fn read-string))
For ABCL:
(progn
(defimplementation make-output-stream (write-string)
(ext:make-slime-output-stream write-string))
(defimplementation make-input-stream (read-string)
(ext:make-slime-input-stream read-string
(make-synonym-stream '*standard-output*))))
Indeed, depending on Lparallel for library has some drawbacks, namely the kernel instantiation!
One way to do this properly is to wrap the lparallel calls in (let ((lparallel:*kernel* MY-KERNEL)) ...)
, with MY-KERNEL being something you initialize for instance with condition-wrapper
.
But really we barely need Lparallel here, as far as I can tell it's only used to pass one restart.
To replace Lparallel with BT, you can replace (lparallel:receive-result channel)
with bt:condition-wait
. Instead of one channel slot, you'll need 2 slots: one for the bt:condition, one of the value.
So it seems that invoke-debugger
is a function being the sole entry point into toplevel debugger. Redefining invoke-debugger
should be a simple way to allow any debugger, including a GUI one. Which kind of makes this library useless, because we can set Nyxt-internal (not internal really, it's image-global) invoke-debugger
to invoke GUI. Will be much cleaner too, I believe...
CC @Shinmera (because I remember you expressing the need in custom debuggers, tell me if that's not relevant anymore.)
Time for a 0.0.2
tag? @aartaka
Using latest ndebug, and loading all dependencies using latest quicklisp, I get the following errors:
CL-USER> (asdf:test-system :ndebug)
; compiling file "/Users/user/code/common-lisp/ndebug/tests/package.lisp" (written 03 JUN 2023 01:24:28 AM):
; wrote /Users/user/.cache/common-lisp/sbcl-2.3.5.nixos-macosx-arm64/Users/user/code/common-lisp/ndebug/tests/package-tmpGA31XWNO.fasl
; compilation finished in 0:00:00.007
; compiling file "/Users/user/code/common-lisp/ndebug/tests/tests.lisp" (written 03 JUN 2023 01:24:28 AM):
; wrote /Users/user/.cache/common-lisp/sbcl-2.3.5.nixos-macosx-arm64/Users/user/code/common-lisp/ndebug/tests/tests-tmp5HT23M6C.fasl
; compilation finished in 0:00:00.016
------- STARTING Testing: NDEBUG/TESTS
Starting: NDEBUG/TESTS::DEBUGGER-HANDLER-BIND
NDEBUG/TESTS::DEBUGGER-HANDLER-BIND - ERRORS (0.00s) : 2 assertions passed
| ERRORS (1)
| ERROR: The file
| #P"/var/folders/t0/t7hdj3915fbcz6r2ldrp6w580000gn/T/tmpA60KLDKY.tmp"
| already exists:
| File exists
| #<FILE-EXISTS {70086DA323}>
|
|
Starting: NDEBUG/TESTS::MULTITHREADED
NDEBUG/TESTS::MULTITHREADED - ERRORS (0.00s) : 0 assertions passed
| ERRORS (1)
| ERROR: The value
| "hello"
| is not of type
| NUMBER
| #<TYPE-ERROR expected-type: NUMBER datum: "hello">
|
|
Starting: NDEBUG/TESTS::WITH-DEBUGGER-HOOK-EXPANSION
NDEBUG/TESTS::WITH-DEBUGGER-HOOK-EXPANSION - ERRORS (0.00s) : 0 assertions passed
| ERRORS (1)
| ERROR: The value
| "hello"
| is not of type
| NUMBER
| #<TYPE-ERROR expected-type: NUMBER datum: "hello">
|
|
Starting: NDEBUG/TESTS::CLASS-BASED-DEBUGGING
NDEBUG/TESTS::CLASS-BASED-DEBUGGING - ERRORS (0.00s) : 0 assertions passed
| ERRORS (1)
| ERROR: The value
| "hello"
| is not of type
| NUMBER
| #<TYPE-ERROR expected-type: NUMBER datum: "hello">
|
|
Starting: NDEBUG/TESTS::CLASS-BASED-DEBUGGING-OVERRIDEN
NDEBUG/TESTS::CLASS-BASED-DEBUGGING-OVERRIDEN - ERRORS (0.00s) : 0 assertions passed
| ERRORS (1)
| ERROR: The value
| "hello"
| is not of type
| NUMBER
| #<TYPE-ERROR expected-type: NUMBER datum: "hello">
|
|
Starting: NDEBUG/TESTS::TRY-EVALUATE
NDEBUG/TESTS::TRY-EVALUATE - ERRORS (0.01s) : 3 assertions passed
| ERRORS (1)
| ERROR: The file
| #P"/var/folders/t0/t7hdj3915fbcz6r2ldrp6w580000gn/T/tmpD801X3GJ.tmp"
| already exists:
| File exists
| #<FILE-EXISTS {7008D98323}>
|
|
Test Summary for :NDEBUG/TESTS (6 tests 0.02 sec)
| 5 assertions total
| 5 passed
| 0 failed
| 6 execution errors
| 0 warnings
| 0 empty
| 0 missing tests
------- ENDING Testing: NDEBUG/TESTS
;
; compilation unit aborted
; caught 1 fatal ERROR condition
; Evaluation aborted on #<LISP-UNIT2:ALL-TESTS-COMPLETE {7008D99DF3}>.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.