I am debugging a library with an FFI which sometimes segfaults because
of memory problems (not a problem with SBCL, but bugs in the interface
I am writing). Then I have to restart the lisp process, load
everything, etc, which is a bit cumbersome.
I thought of saving a lisp image at a "safe" point (ie before testing
the buggy functions) and reloading it, but I could not figure out how
to do this in SLIME. The reloading looks easy with
(setq slime-lisp-implementations
'((my-image ("sbcl" "--core /home/tpapp/my.core"))))
in my .emacs, but when I want to use
CL-USER> (sb-ext:save-lisp-and-die #P"/home/tpapp/my.core")
SBCL complains about multiple threads -- I guess this is SLIME/swank,
I don't use threads in my code. I looked at the docs, which told me
that I can take care of this with SB-EXT:*SAVE-HOOKS*, but I don't
know how to go about this. I wonder if someone could give me
details/examples on how to establish a workflow of saving and using
images with SLIME & SBCL.
Thanks,
Tamas
PS.: If that matters, I am using SBCL 1.0.45 (but I can upgrade if
necessary) and SLIME 2011-03-13.
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Sbcl-help mailing list
Sbcl...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help
The easiest way to dump an image is to do the dumping before threads
even enter the picture at all.
So you make a load.lisp file containing the code to load everything
you need in the image, and the last thing this file does is invoke
SAVE-LISP-AND-DIE.
Then it's a simple matter of "sbcl --script load.lisp" and you have your image!