Skip to content

Instantly share code, notes, and snippets.

@svetlyak40wt
Created June 19, 2023 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save svetlyak40wt/e4afab04a73110f76fd197ee824ce7fc to your computer and use it in GitHub Desktop.
Save svetlyak40wt/e4afab04a73110f76fd197ee824ce7fc to your computer and use it in GitHub Desktop.
(defun save-me (core-file)
"This function closes all threads and dumps image of SBCL into the core file."
(flet ((saver ()
(loop for thread in (sb-thread:list-all-threads)
unless (eql thread
sb-thread:*current-thread*)
do (sb-thread:terminate-thread thread)
finally (save-lisp-and-die core-file))))
(loop for thread in (sb-thread:list-all-threads)
when (string-equal (sb-thread:thread-name thread)
"main thread")
do (sb-thread:interrupt-thread thread #'saver))))
@svetlyak40wt
Copy link
Author

To connect back from Portacle using core, do in the Portacle C-u M-x slime.
Then enter: /Applications/portacle/mac/bin/sbcl -core /tmp/portacle.core

It starts SBCL and connects to it. But something strange happened – all loaded packages are disappeared after the load, however core size increased comparing to the core without Dexador loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment