Thibault Langlois <tl <at> di.fc.ul.pt> writes:

> 
> Hello,
> I would like to have a function that saves a core file and quits when 
> I am working with slime. First I tried:
>  (defun shutdown ()
>   (extensions:save-lisp "/mnt/ldisk1/worlds/last.core")
>   (quit))
> but it did not work because save-lisp should be called by the
> mp::*initial-process*. I tried this:
> (defun shutdown ()
>   (setf mp:*current-process* mp::*initial-process*)
>   (extensions:save-lisp "/mnt/ldisk1/worlds/last.core")
>   (quit))
> which seems to be a bad idea 
> 
> Anybody knows how to do this ?

This following function actually saves a core file:
(defun shutdown ()
  (mp:process-interrupt
   (first (last (mp:all-processes)))
   #'(lambda () (extensions:save-lisp "/mnt/ldisk1/worlds/last.core")))
  (quit))

but then I get an error when I try to use this core:

$ /usr/local/cmucl-19a/bin/lisp -core /mnt/ldisk1/worlds/last.core 
Help! 12 nested errors.  KERNEL:*MAXIMUM-ERROR-DEPTH* exceeded.

Debug  (type H for help)

(UNIX::SIGSEGV-HANDLER #<unused-arg> #<unused-arg> #.(SYSTEM:INT-SAP 
#x3FFFECA8))
%primitive halt called; the party is over.
LDB monitor
ldb> 

Thibault




Reply via email to